Commit 44b10efa authored by Theo Steininger's avatar Theo Steininger

Modified descriptor in magnetic field classes.

parent f145f40d
......@@ -3,4 +3,6 @@
from magnetic_field_factory import MagneticFieldFactory
from magnetic_field import MagneticField
from constant_field_factory import ConstantFieldFactory
from jf12_factory import JF12Factory
......@@ -6,7 +6,9 @@ from magnetic_field_factory import MagneticFieldFactory
class JF12Factory(MagneticFieldFactory):
@property
def descriptor(self):
return 'JF12'
result_descriptor = super(JF12Factory, self).descriptor
result_descriptor += ['JF12']
return result_descriptor
def _initialize_parameter_defaults(self):
self._parameter_defaults = {'b51_ran_b1': 10.8,
......
......@@ -11,9 +11,11 @@ class MagneticField(Loggable, object):
def __init__(self, box_dimensions, resolution, descriptor,
parameters={}, create_array=None):
self._box_dimensions = box_dimensions
self._resolution = resolution
self._descriptor = str(descriptor)
self._box_dimensions = np.empty(3)
self._box_dimensions[:] = box_dimensions
self._resolution = np.empty(3)
self._resolution[:] = resolution
self._descriptor = descriptor
self._parameters = {}
for (key, value) in parameters.items():
......
......@@ -20,7 +20,7 @@ class MagneticFieldFactory(Loggable, object):
@abc.abstractproperty
def descriptor(self):
raise NotImplementedError
return []
def _initialize_parameter_defaults(self):
self._parameter_defaults = {}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment