Skip to content

Commit

Permalink
Moved EffectivePointCharges assertion to lower class level to ensure …
Browse files Browse the repository at this point in the history
…compatibility with Traceon Pro
  • Loading branch information
jobdewitte committed Jan 14, 2025
1 parent 7b21efc commit dfa1052
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions traceon/field.py
Original file line number Diff line number Diff line change
Expand Up @@ -367,9 +367,7 @@ class FieldBEM(Field, ABC):

def __init__(self, electrostatic_point_charges, magnetostatic_point_charges, current_point_charges):
super().__init__()
assert all([isinstance(eff, EffectivePointCharges) for eff in [electrostatic_point_charges,
magnetostatic_point_charges,
current_point_charges]])

self.electrostatic_point_charges = electrostatic_point_charges
self.magnetostatic_point_charges = magnetostatic_point_charges
self.current_point_charges = current_point_charges
Expand Down Expand Up @@ -488,7 +486,10 @@ def __init__(self, electrostatic_point_charges=None, magnetostatic_point_charges
magnetostatic_point_charges = EffectivePointCharges.empty_2d()
if current_point_charges is None:
current_point_charges = EffectivePointCharges.empty_3d()


assert all([isinstance(eff, EffectivePointCharges) for eff in [electrostatic_point_charges,
magnetostatic_point_charges,
current_point_charges]])
self.symmetry = E.Symmetry.RADIAL
super().__init__(electrostatic_point_charges, magnetostatic_point_charges, current_point_charges)

Expand Down

0 comments on commit dfa1052

Please sign in to comment.