gafusion / omas

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

EFIT Mapping Definition Is Not Parsed Correctly #230

Closed torrinba closed 1 year ago

torrinba commented 1 year ago

For some reason the _efit.json file is not parsed correctly. When the mapping is loaded (opened dynamically and then the path is evaluated), a strange error occurs

LookupError: Not a valid IMAS 3.38.1 location: equilibrium.time_slice.0.profiles_2d.0.grid._type
                                                                                                                                             ^^^^^
Did you mean: dim2_error_upper, dim1_error_upper, volume_element_error_upper, volume_element, volume_element_error_lower, ...

This is caused by https://github.com/gafusion/omas/blob/ca544708d58d46473ea38ee4de1129c47d277cbf/omas/machine_mappings/_efit.json#L105 and when that block is removed the error no longer occurs.

orso82 commented 1 year ago

@bechtt I cannot seem to be able to reproduce this issue, at least with this piece of code.

from omas import *

ods = ODS()
with ods.open("d3d", 133221):
    print(ods["equilibrium.time_slice.:.profiles_2d.:.grid_type.index"])
torrinba commented 1 year ago

Thanks for trying that out. I agree that directly executing the ods does not produce any issues. After more testing this appears to be related to the paths method that you fixed in https://github.com/gafusion/omas/tree/paths_dynamic. When I am testing on the mapping fix PR #226 this code produces the error:

from omas import *

ods = ODS()
ods.open("d3d", 133221)
ods.paths()

Unfortunately other errors are encountered first if you are on a different branch.

torrinba commented 1 year ago

@orso82 the change in https://github.com/gafusion/omas/pull/226/commits/6fb175f212c8b65d12a326fed0aba005d80c22ca appears to have broken machine mappings completely. ods.open("d3d", 133221) is now returning an empty ODS

orso82 commented 1 year ago

Ok, try again https://github.com/gafusion/omas/pull/226/commits/b700fa47ecc33752a0219c95d31da7ffcc1b9703

torrinba commented 1 year ago

That solves it! I don't see any more problems with the machine mapping for DIII-D. Thanks for working through all of them with me