sandialabs / pyscan

Scientific Measurement Toolbox
https://pyscan.readthedocs.io/en/latest/
MIT License
4 stars 4 forks source link

hdf5 files do not save runinfo.measured #189

Open mplilly4395 opened 2 weeks ago

mplilly4395 commented 2 weeks ago

runinfo.measured is important for existing plot commands like PlotGenerator(). When you use the expt created in a jupyter notebook, the measured list is present. If you use ps.load_experiment(), measured is an empty list.

In checking on this problem,

  1. save_metadata() runs recursive_to_dict() and json.dumps()
  2. recursive_to_dict() makes a dictionary with measured and the list is correct at this point
  3. directly checking the hdf5 file runinfo attr: f.attrs['runinfo'], measured is an empty list.
i-am-mounce commented 2 weeks ago

Let's add this functionality to load_experiment

mplilly4395 commented 2 weeks ago

reason: metadata is saved before the experiment begins. The measured list is populated after the first data point, so it is empty when the metadata is saved.