From dfa1052ab833ebaf3beeb29a5f6456cf626fffac Mon Sep 17 00:00:00 2001 From: jobdewitte Date: Tue, 14 Jan 2025 12:36:25 +0100 Subject: [PATCH] Moved EffectivePointCharges assertion to lower class level to ensure compatibility with Traceon Pro --- traceon/field.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/traceon/field.py b/traceon/field.py index e41d654..ba2bc99 100644 --- a/traceon/field.py +++ b/traceon/field.py @@ -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 @@ -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)