demisjohn / pyFIMM

Python Interface to PhotonDesign's FimmWave/FimmProp software.
15 stars 4 forks source link

Device:import_device() :: variables not handled #70

Closed demisjohn closed 8 years ago

demisjohn commented 8 years ago

Will set the element length to the variable name, eg.

>>> Dev.lengths
[50.0, 'lMMI_2x2\n\x00', 50.0]

the 2nd is a variable This results in get_length() for the whole dev failing when it tries to add the lengths together. This causes Device.get_field() to fail since it need the total length of the device for the calc-Z-fields function.

>>> outMMI.lengths[1]+0
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: cannot concatenate 'str' and 'int' objects
demisjohn commented 8 years ago

Fixed in f2ee61777e207ec3fd72fd3f65d096058187a9c1.

Calls parent.checkvar() to see if lengths & wavelength can be resolved in Project's VariableNode.