gafusion / omas

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

Fix inability of the python debugger to work for machine mappings #238

Closed AreWeDreaming closed 1 year ago

AreWeDreaming commented 1 year ago

I keep running into issues with the mapping functions in d3d.py and the corresponding d3d.json. Some issues are caused by stale entries in the d3d.json some are caused by my mapping routines. The fact that I cannot properly debug them with a debugger is slowing me down a lot.

Is there any way to remove the "dark magic" (Orso) temporarily, so that I can actually work efficiently?

This is my test code, for the test to fail as intended you will have to use my branch.

I test my code with:

import matplotlib.pyplot as plt
fig = plt.figure(figsize=(9, 5) )
ods = ODS()
with ods.open("d3d", 194455001, options={'PROFILES_tree':"OMFIT_PROFS"}):
    ods.plot_core_profiles_summary(time=3.0, fig=fig, quantities=["temperature"])
plt.show()

Please note I am not necessarily looking for a solution to my current issue, but rather a better way for me to solve these problems myself.

AreWeDreaming commented 1 year ago

@orso82 Pointed out to me that: test_machine_mapping_functions(["<function_name>"], globals(), locals()) serves this purpose. This is sufficient for now.