gafusion / omas

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

NotImplementedError with run_machine_mapping_functions for new mapping #151

Closed dboeckenhoff closed 3 years ago

dboeckenhoff commented 3 years ago

When adding a new mapping "w7x" I followed the nice omas/machine_mappings/sample.py. I got

$ python omas/machine_mappings/w7x.py

Sanity check of w7x mapping files: ... Traceback (most recent call last): File "omas/machine_mappings/w7x.py", line 146, in omas.omas_machine.run_machine_mapping_functions(all, globals(), locals()) File "/home/IPP-HGW/dboe/git/omas/omas/omas_machine.py", line 601, in run_machine_mapping_functions machine_mappings(machine, '', raise_errors=True) File "/home/IPP-HGW/dboe/git/omas/omas/omas_machine.py", line 255, in machine_mappings filename = machines(machine, branch) File "/home/IPP-HGW/dboe/git/omas/omas/omas_machine.py", line 467, in machines raise NotImplementedError(f'Machine {machine} has no mapping defined') NotImplementedError: Machine w7x has no mapping defined

Took me a while to understand that the check for existing mappings checks the existence of a w7x.json Solved by $ touch omas/machine_mappings/w7x.json

Either this could be solved by also checking the existence of the corresponding .py file or by adding this step to the explanation. Cheers

orso82 commented 3 years ago

Thank you for the feedback @dboeckenhoff ! I'll update the comments in the sample.py file.

Also, please take a look at this recent tutorial: https://www.youtube.com/watch?v=jcWPCxWVamw&index=18&list=PLdksEfhRAD67q1fGDlZMAYcWSO8BlhbK5