LISE-B26 / pylabcontrol

pylabcontrol: Laboratory Equipment Control for Scientific Experiments.
GNU General Public License v3.0
9 stars 9 forks source link

ScriptIterator: Sweep Parameter seems to have an issue with nested parameters #130

Open JanGieseler opened 6 years ago

JanGieseler commented 6 years ago

This happens in the current version of XY8-k, which has now one deeper level of nested parameters.

Todo:

akabcenell commented 6 years ago

The issue is that ScriptIterator assumes different behavior from Parameter than what actually has been implemented. In particular, ScriptIterator assumes that if you have nested parameters, all of the nested parameters are of type Parameter. However, the Parameter constructor changes them to dictionaries, so only the top level is a Parameter. For example, consider:

d = Parameter('d', 0.1, float, 'execution time of script (s)')
c = Parameter('c', [d])
print(type(c))
print(type(c['c']))

which has the output

<class 'PyLabControl.src.core.parameter.Parameter'> <type 'dict'>

We need to figure out what the intended behavior of Parameter actually is and what API we want, then correct it and Script Iterator appropriately.