Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test_omas_dynamic_machine fails on master #284

Open
torrinba opened this issue Dec 27, 2023 · 2 comments
Open

test_omas_dynamic_machine fails on master #284

torrinba opened this issue Dec 27, 2023 · 2 comments

Comments

@torrinba
Copy link
Collaborator

When I run make test in the omas master branch on iris or omega the TDI functions in MDS+ calls from the machine mappings appear to cause issues. I've tried reverting to older omas versions, but still encounter the same errors. So something must have changed on the system or with the OMFIT environment I'm using. I don't have a clue what that would be.

test_omas_dynamic_machine (test_omas_examples.TestOmasExamples) ... 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
TestOmasExamples.test_omas_dynamic_machine
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
DEBUG (dynamic): Dynamic open  {'machine': 'd3d', 'pulse': 168830, 'options': {'EFIT_tree': 'EFIT01'}, 'branch': '', 'user_machine_mappings': None}
magnetics.flux_loop.:.flux.data must have COCOSIO specified
DEBUG (dynamic): Dynamic read  {'machine': 'd3d', 'pulse': 168830, 'options': {'EFIT_tree': 'EFIT01'}, 'branch': '', 'user_machine_mappings': None}: equilibrium.time_slice.:
DEBUG (dynamic): Dynamic read  {'machine': 'd3d', 'pulse': 168830, 'options': {'EFIT_tree': 'EFIT01'}, 'branch': '', 'user_machine_mappings': None}: equilibrium.time_slice.0.global_quantities.ip
Max Ip is 1263595.25 [A]
DEBUG (dynamic): Dynamic close {'machine': 'd3d', 'pulse': 168830, 'options': {'EFIT_tree': 'EFIT01'}, 'branch': '', 'user_machine_mappings': None}
DEBUG (dynamic): Dynamic open  {'machine': 'd3d', 'pulse': 168830, 'options': {'EFIT_tree': 'EFIT02'}, 'branch': '', 'user_machine_mappings': None}
DEBUG (dynamic): Dynamic read  {'machine': 'd3d', 'pulse': 168830, 'options': {'EFIT_tree': 'EFIT02'}, 'branch': '', 'user_machine_mappings': None}: equilibrium.time
DEBUG (dynamic): Dynamic read  {'machine': 'd3d', 'pulse': 168830, 'options': {'EFIT_tree': 'EFIT02'}, 'branch': '', 'user_machine_mappings': None}: equilibrium.time_slice.:
DEBUG (dynamic): Dynamic read  {'machine': 'd3d', 'pulse': 168830, 'options': {'EFIT_tree': 'EFIT02'}, 'branch': '', 'user_machine_mappings': None}: equilibrium.time_slice.0.time
DEBUG (dynamic): Dynamic read  {'machine': 'd3d', 'pulse': 168830, 'options': {'EFIT_tree': 'EFIT02'}, 'branch': '', 'user_machine_mappings': None}: wall.description_2d.:
DEBUG (dynamic): Dynamic read  {'machine': 'd3d', 'pulse': 168830, 'options': {'EFIT_tree': 'EFIT02'}, 'branch': '', 'user_machine_mappings': None}: equilibrium.time_slice.90.boundary.outline.r
ADDFUN("nan_where","exec('''def nan_where(a, b, n):
    import numpy as np

    a = a.data()
    b = b.data()
    a[b == n] = np.NaN
    return a''')"),nan_where(\EFIT02::TOP.RESULTS.GEQDSK.RBBBS, \EFIT02::TOP.RESULTS.GEQDSK.RBBBS, 0)
DEBUG (dynamic): Dynamic close {'machine': 'd3d', 'pulse': 168830, 'options': {'EFIT_tree': 'EFIT02'}, 'branch': '', 'user_machine_mappings': None}
ERROR

======================================================================
ERROR: test_omas_dynamic_machine (test_omas_examples.TestOmasExamples)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/bechtelt/omas/omas/omas_machine.py", line 917, in raw
    out_results = MDSplus.Data.data(conn.get(TDI))
  File "/fusion/projects/codes/atom/omfit_v3.x/atom_iris_test/miniconda3_master/lib/python3.7/site-packages/MDSplus/connection.py", line 254, in get
    ans = self.__getAnswer__()
  File "/fusion/projects/codes/atom/omfit_v3.x/atom_iris_test/miniconda3_master/lib/python3.7/site-packages/MDSplus/connection.py", line 132, in __getAnswer__
    raise MdsIpException(str(ans))
MDSplus.connection.MdsIpException: %MDSPLUS-E-Unknown, %TDI-E-UNKNOWN_VAR, Unknown/undefined variable name

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/bechtelt/omas/omas/omas_core.py", line 1303, in __getitem__
    value = self.dynamic.__getitem__(location)
  File "/home/bechtelt/omas/omas/omas_machine.py", line 982, in __getitem__
    self.cache,
  File "/home/bechtelt/omas/omas/omas_machine.py", line 150, in machine_to_omas
    return resolve_mapped(ods, machine, pulse,  mappings, location, idm, options_with_defaults, branch, cache=cache)
  File "/home/bechtelt/omas/omas/omas_machine.py", line 254, in resolve_mapped
    raise e
  File "/home/bechtelt/omas/omas/omas_machine.py", line 246, in resolve_mapped
    data0 = data = mdsvalue(machine, treename, pulse, TDI).raw()
  File "/home/bechtelt/omas/omas/omas_machine.py", line 927, in raw
    raise _excp.__class__(str(_excp) + '\n' + '\n'.join(txt))
MDSplus.connection.MdsIpException: %MDSPLUS-E-Unknown, %MDSPLUS-E-Unknown, %TDI-E-UNKNOWN_VAR, Unknown/undefined variable name
 - server: atlas.gat.com:8000
 - treename: EFIT02
 - pulse: 168830
 - TDI: ADDFUN("nan_where","exec('''def nan_where(a, b, n):\n    import numpy as np\n\n    a = a.data()\n    b = b.data()\n    a[b == n] = np.NaN\n    return a''')"),nan_where(\EFIT02::TOP.RESULTS.GEQDSK.RBBBS, \EFIT02::TOP.RESULTS.GEQDSK.RBBBS, 0)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/bechtelt/omas/omas/tests/test_omas_examples.py", line 143, in test_omas_dynamic_machine
    from omas.examples import omas_dynamic_machine
  File "/home/bechtelt/omas/omas/examples/omas_dynamic_machine.py", line 29, in <module>
    ods.plot_equilibrium_CX(time=2.1)
  File "/home/bechtelt/omas/omas/omas_plot.py", line 707, in equilibrium_CX
    ax.plot(eq['boundary.outline.r'], eq['boundary.outline.z'], label=label, **kw1)
  File "/home/bechtelt/omas/omas/omas_core.py", line 1324, in __getitem__
    return value.__getitem__(key[1:], cocos_and_coords)
  File "/home/bechtelt/omas/omas/omas_core.py", line 1324, in __getitem__
    return value.__getitem__(key[1:], cocos_and_coords)
  File "/home/bechtelt/omas/omas/omas_core.py", line 1305, in __getitem__
    raise OmasDynamicException(f'Error dynamic fetching of `{location}` for {self.dynamic.kw}: {repr(_excp)}')
omas.omas_core.OmasDynamicException: Error dynamic fetching of `equilibrium.time_slice.90.boundary.outline.r` for {'machine': 'd3d', 'pulse': 168830, 'options': {'EFIT_tree': 'EFIT02'}, 'branch': '', 'user_machine_mappings': None}: MdsIpException('%MDSPLUS-E-Unknown, %TDI-E-UNKNOWN_VAR, Unknown/undefined variable name\n - server: atlas.gat.com:8000\n - treename: EFIT02\n - pulse: 168830\n - TDI: ADDFUN("nan_where","exec(\'\'\'def nan_where(a, b, n):\\n    import numpy as np\\n\\n    a = a.data()\\n    b = b.data()\\n    a[b == n] = np.NaN\\n    return a\'\'\')"),nan_where(\\EFIT02::TOP.RESULTS.GEQDSK.RBBBS, \\EFIT02::TOP.RESULTS.GEQDSK.RBBBS, 0)')
@smithsp
Copy link
Member

smithsp commented Feb 27, 2024

I want to blame it (and other things) on the MDSplus server upgrade, but I haven't been able to put my finger on it. Maybe @ModestMC (M. Clark) can track it down.

Copy link

Stale issue message

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants