gafusion / omas

Ordered Multidimensional Array Structure
http://gafusion.github.io/omas
MIT License
30 stars 14 forks source link

fix(structure): ensure add_extra_structures resets all required caches #290

Closed hassec closed 4 months ago

hassec commented 4 months ago

I think there is a small bug in add_extra_structures

If the structure is already loaded and then extended the extension doesn't properly show up. See below, where test_field is missing from the output of the second imas_structure call.

image

This means that e.g. a ODS().load() call will fail because the structure caches for limiter.unit will not contain test_filed.

This PR adds omas.omas_utils._ods_structure_cache = {} to the other resets in add_extra_structures to fix this behaviour.

I've also added a test for this.

orso82 commented 4 months ago

fantastic!

hassec commented 4 months ago

Thanks for the instant reply @orso82 😊 Any chance we can get a new PyPi release soon? There have been a couple of things merged that we are looking forward too.

orso82 commented 4 months ago

done. Version 0.93.0 was released