@@ -34,7 +34,7 @@ def make_voltage_integral(path_spec: VoltagePathSpecTypes) -> VoltageIntegralTyp
34
34
35
35
Parameters
36
36
----------
37
- path_spec : PathSpecTypes
37
+ path_spec : VoltagePathSpecTypes
38
38
Specification defining the path for voltage integration. Can be either an axis-aligned or
39
39
custom path specification.
40
40
@@ -48,6 +48,8 @@ def make_voltage_integral(path_spec: VoltagePathSpecTypes) -> VoltageIntegralTyp
48
48
v_integral = VoltageIntegralAxisAligned (** path_spec .dict (exclude = {"type" }))
49
49
elif isinstance (path_spec , CustomVoltageIntegral2DSpec ):
50
50
v_integral = CustomVoltageIntegral2D (** path_spec .dict (exclude = {"type" }))
51
+ else :
52
+ raise ValidationError (f"Unsupported voltage path specification type: { type (path_spec )} " )
51
53
return v_integral
52
54
53
55
@@ -56,7 +58,7 @@ def make_current_integral(path_spec: CurrentPathSpecTypes) -> CurrentIntegralTyp
56
58
57
59
Parameters
58
60
----------
59
- path_spec : PathSpecTypes
61
+ path_spec : CurrentPathSpecTypes
60
62
Specification defining the path for current integration. Can be either an axis-aligned,
61
63
custom, or composite path specification.
62
64
@@ -66,13 +68,14 @@ def make_current_integral(path_spec: CurrentPathSpecTypes) -> CurrentIntegralTyp
66
68
Current path integral instance corresponding to the provided specification type.
67
69
"""
68
70
i_integral = None
69
- if path_spec is not None :
70
- if isinstance (path_spec , CurrentIntegralAxisAlignedSpec ):
71
- i_integral = CurrentIntegralAxisAligned (** path_spec .dict (exclude = {"type" }))
72
- elif isinstance (path_spec , CustomCurrentIntegral2DSpec ):
73
- i_integral = CustomCurrentIntegral2D (** path_spec .dict (exclude = {"type" }))
74
- elif isinstance (path_spec , CompositeCurrentIntegralSpec ):
75
- i_integral = CompositeCurrentIntegral (** path_spec .dict (exclude = {"type" }))
71
+ if isinstance (path_spec , CurrentIntegralAxisAlignedSpec ):
72
+ i_integral = CurrentIntegralAxisAligned (** path_spec .dict (exclude = {"type" }))
73
+ elif isinstance (path_spec , CustomCurrentIntegral2DSpec ):
74
+ i_integral = CustomCurrentIntegral2D (** path_spec .dict (exclude = {"type" }))
75
+ elif isinstance (path_spec , CompositeCurrentIntegralSpec ):
76
+ i_integral = CompositeCurrentIntegral (** path_spec .dict (exclude = {"type" }))
77
+ else :
78
+ raise ValidationError (f"Unsupported current path specification type: { type (path_spec )} " )
76
79
return i_integral
77
80
78
81
0 commit comments