xraypy / xraylarch

Larch: Applications and Python Library for Data Analysis of X-ray Absorption Spectroscopy (XAS, XANES, XAFS, EXAFS), X-ray Fluorescence (XRF) Spectroscopy and Imaging, and more.
https://xraypy.github.io/xraylarch
Other
127 stars 62 forks source link

`nvict` not saved with other pre-edge attributes #481

Closed patrick-austin closed 3 months ago

patrick-austin commented 7 months ago

When calling pre_edge, the settings used (excluding e0 and step/edge_step which are set on the main group) are set as attributes on pre_edge_details: https://github.com/xraypy/xraylarch/blob/d0c3a74c9a414a86766f31ac145ff9a01d9869ed/larch/xafs/pre_edge.py#L377-L379

If you then save this as an Athena project, the list of keys to save from this group does not include nvict: https://github.com/xraypy/xraylarch/blob/d0c3a74c9a414a86766f31ac145ff9a01d9869ed/larch/io/athena_project.py#L168-L175

As a result I do not have a record of the value I used in my Athena project (so it will default to 0, when I would expect to be able to access the old settings like the other attributes in that group) when it gets read (i.e. here or one of the equivalent functions in athena_project.py): https://github.com/xraypy/xraylarch/blob/d0c3a74c9a414a86766f31ac145ff9a01d9869ed/larch/io/athena_project.py#L531-L532

I noticed #449 made reference to nvict not persisting, but that seems to be in a different part of the code base - so potentially not relevant here.

newville commented 7 months ago

@patrick-austin Ah, thanks -- will fix.

maurov commented 3 months ago

@patrick-austin this is fixed in master. A new release is coming soon.