1
- """Specifications for defining path integrals."""
1
+ """Module containing specifications for voltage and current path integrals."""
2
2
3
3
from __future__ import annotations
4
4
@@ -118,7 +118,7 @@ def _vertices_2D(self, axis: Axis) -> tuple[Coordinate2D, Coordinate2D]:
118
118
119
119
120
120
class VoltageIntegralAxisAlignedSpec (AxisAlignedPathIntegralSpec ):
121
- """Class for computing the voltage between two points defined by an axis-aligned line."""
121
+ """Class for specifying the voltage calculation between two points defined by an axis-aligned line."""
122
122
123
123
sign : Direction = pd .Field (
124
124
...,
@@ -152,13 +152,13 @@ def from_terminal_positions(
152
152
z : float = None
153
153
Position in z direction, only two of x,y,z can be specified to define line.
154
154
extrapolate_to_endpoints: bool = True
155
- Passed directly to :class:`VoltageIntegralAxisAligned `
155
+ Passed directly to :class:`VoltageIntegralAxisAlignedSpec `
156
156
snap_path_to_grid: bool = True
157
- Passed directly to :class:`VoltageIntegralAxisAligned `
157
+ Passed directly to :class:`VoltageIntegralAxisAlignedSpec `
158
158
159
159
Returns
160
160
-------
161
- VoltageIntegralAxisAligned
161
+ VoltageIntegralAxisAlignedSpec
162
162
The created path integral for computing voltage between the two terminals.
163
163
"""
164
164
axis_positions = Geometry .parse_two_xyz_kwargs (x = x , y = y , z = z )
@@ -237,7 +237,7 @@ def plot(
237
237
238
238
239
239
class CurrentIntegralAxisAlignedSpec (AbstractAxesRH , Box ):
240
- """Class for computing conduction current via Ampère's circuital law on an axis-aligned loop."""
240
+ """Class for specifying the computation of conduction current via Ampère's circuital law on an axis-aligned loop."""
241
241
242
242
_plane_validator = assert_plane ()
243
243
@@ -270,7 +270,7 @@ def main_axis(self) -> Axis:
270
270
def _to_path_integral_specs (
271
271
self , h_horizontal = None , h_vertical = None
272
272
) -> tuple [AxisAlignedPathIntegralSpec , ...]:
273
- """Returns four ``AxisAlignedPathIntegral `` instances, which represent a contour
273
+ """Returns four ``AxisAlignedPathIntegralSpec `` instances, which represent a contour
274
274
integral around the surface defined by ``self.size``."""
275
275
ax1 = self .remaining_axes [0 ]
276
276
ax2 = self .remaining_axes [1 ]
@@ -427,7 +427,7 @@ def plot(
427
427
428
428
429
429
class CustomPathIntegral2DSpec (AbstractAxesRH ):
430
- """Class for defining a custom path integral defined as a curve on an axis-aligned plane.
430
+ """Class for specifying a custom path integral defined as a curve on an axis-aligned plane.
431
431
432
432
Notes
433
433
-----
@@ -486,7 +486,7 @@ def from_circular_path(
486
486
radius : float
487
487
The radius of the circle.
488
488
num_points : int
489
- THe number of equidistant points to use along the perimeter of the circle.
489
+ The number of equidistant points to use along the perimeter of the circle.
490
490
normal_axis : Axis
491
491
The axis normal to the defined circle.
492
492
clockwise : bool
@@ -495,7 +495,7 @@ def from_circular_path(
495
495
496
496
Returns
497
497
-------
498
- :class:`.CustomPathIntegral2D `
498
+ :class:`.CustomPathIntegral2DSpec `
499
499
A path integral defined on a circular path.
500
500
"""
501
501
@@ -545,7 +545,7 @@ def _correct_shape(cls, val):
545
545
# overall shape of vertices
546
546
if val .shape [1 ] != 2 :
547
547
raise SetupError (
548
- "'CustomPathIntegral2D .vertices' must be a 2 dimensional array shaped (N, 2). "
548
+ "'CustomPathIntegral2DSpec .vertices' must be a 2 dimensional array shaped (N, 2). "
549
549
f"Given array with shape of '{ val .shape } '."
550
550
)
551
551
return val
@@ -574,13 +574,13 @@ def sign(self) -> Direction:
574
574
575
575
576
576
class CustomVoltageIntegral2DSpec (CustomPathIntegral2DSpec ):
577
- """Class for computing the voltage between two points defined by a custom path.
577
+ """Class for specfying the computation of voltage between two points defined by a custom path.
578
578
Computed voltage is :math:`V=V_b-V_a`, where position b is the final vertex in the supplied path.
579
579
580
580
Notes
581
581
-----
582
582
583
- Use :class:`.VoltageIntegralAxisAligned ` if possible, since interpolation
583
+ Use :class:`.VoltageIntegralAxisAlignedSpec ` if possible, since interpolation
584
584
near conductors will not be accurate.
585
585
586
586
.. TODO Improve by including extrapolate_to_endpoints field, non-trivial extension."""
@@ -636,7 +636,7 @@ def plot(
636
636
637
637
638
638
class CustomCurrentIntegral2DSpec (CustomPathIntegral2DSpec ):
639
- """Class for computing conduction current via Ampère's circuital law on a custom path.
639
+ """Class for specifying the computation of conduction current via Ampère's circuital law on a custom path.
640
640
To compute the current flowing in the positive ``axis`` direction, the vertices should be
641
641
ordered in a counterclockwise direction."""
642
642
@@ -720,9 +720,11 @@ class CompositeCurrentIntegralSpec(Box):
720
720
sum_spec : Literal ["sum" , "split" ] = pd .Field (
721
721
...,
722
722
title = "Sum Specification" ,
723
- description = "Determines the method used to combine the currents calculated by the different current integrals defined by ``path_specs``."
724
- "``sum`` simply adds all currents, while ``split`` keeps contributions with opposite phase separate, which allows for isolating "
725
- "the current flowing in opposite directions. In ``split`` version, the current returned is the maximum of the two contributions." ,
723
+ description = "Determines the method used to combine the currents calculated by the different "
724
+ "current integrals defined by ``path_specs``. ``sum`` simply adds all currents, while ``split`` "
725
+ "keeps contributions with opposite phase separate, which allows for isolating the current "
726
+ "flowing in opposite directions. In ``split`` version, the current returned is the maximum "
727
+ "of the two contributions." ,
726
728
)
727
729
728
730
@add_ax_if_none
0 commit comments