Repository navigation
Fix a regression on mdsplus models generation - #147
Merged
olivhoenen merged 3 commits intoOct 22, 2026
Merged
Conversation
olivhoenen
requested review from
maarten-ic and
prasad-sawantdesai
as code owners
October 22, 2026 12:16
… models generation
olivhoenen
force-pushed
the
fix/mds_models_generation
branch
from
October 22, 2026 12:22
95cc14f to
af282ce
Compare
prasad-sawantdesai
approved these changes
Oct 22, 2026
Collaborator
There was a problem hiding this comment.
Thanks for the fix. It works..
$ python summary_rw.py
16:23:19 INFO Parsing data dictionary version 4.1.1 @dd_zip.py:89
16:23:19 INFO Creating and caching MDSplus model at /tmp/sawantp1/imas/mdsplus/4.1.1.xml-8183868f_1959966d92a34fc0959de542a41f0353, this may take a while @mdsplus_model.py:177
16:24:46 INFO MDSplus model at /tmp/sawantp1/imas/mdsplus/4.1.1.xml-8183868f_1959966d92a34fc0959de542a41f0353 created, moving to /home/ITER/sawantp1/.cache/imas/mdsplus/4.1.1.xml-8183868f @mdsplus_model.py:184
Wrote summary to imas:mdsplus?path=./summary_test (DD 4.1.1)
Read 11 time points
t = 0.000 s ip = -0.000 MA
t = 0.100 s ip = -6.932 MA
t = 0.200 s ip = -11.424 MA
t = 0.300 s ip = -13.577 MA
t = 0.400 s ip = -14.460 MA
t = 0.500 s ip = -14.799 MA
t = 0.600 s ip = -14.926 MA
t = 0.700 s ip = -14.973 MA
t = 0.800 s ip = -14.990 MA
t = 0.900 s ip = -14.996 MA
t = 1.000 s ip = -14.999 MA
Round-trip OK
$ module list 2>&1 | grep -i IMAS-Core
18) libffi/3.4.4-GCCcore-13.2.0 39) libxslt/1.1.38-GCCcore-13.2.0 60) LibTIFF/4.6.0-GCCcore-13.2.0 81) IMAS-Core/5.7.1-intel-2023b
$ python -c "import imas; print(imas.__version__)"
2.3.1.dev8
$ export IMAS_VERSION=3.42.2
$ python summary_rw.py
16:27:30 INFO Parsing data dictionary version 3.42.2 @dd_zip.py:89
16:27:30 INFO Creating and caching MDSplus model at /tmp/sawantp1/imas/mdsplus/3.42.2.xml-d66c8a74_e1e0ff1de52a466c8d0df4268b774b8e, this may take a while @mdsplus_model.py:177
16:29:02 INFO MDSplus model at /tmp/sawantp1/imas/mdsplus/3.42.2.xml-d66c8a74_e1e0ff1de52a466c8d0df4268b774b8e created, moving to /home/ITER/sawantp1/.cache/imas/mdsplus/3.42.2.xml-d66c8a74 @mdsplus_model.py:184
Wrote summary to imas:mdsplus?path=./summary_test (DD 3.42.2)
Read 11 time points
t = 0.000 s ip = -0.000 MA
t = 0.100 s ip = -6.932 MA
t = 0.200 s ip = -11.424 MA
t = 0.300 s ip = -13.577 MA
t = 0.400 s ip = -14.460 MA
t = 0.500 s ip = -14.799 MA
t = 0.600 s ip = -14.926 MA
t = 0.700 s ip = -14.973 MA
t = 0.800 s ip = -14.990 MA
t = 0.900 s ip = -14.996 MA
t = 1.000 s ip = -14.999 MA
Round-trip OK
$ cat summary_rw.py
#!/usr/bin/env python
import numpy as np
import imas
uri = f"imas:mdsplus?path=./summary_test"
# ---- Write ----
time = np.linspace(0.0, 1.0, 11) # s
ip = -15.0e6 * np.tanh(5.0 * time) # A (ramp-up to -15 MA)
with imas.DBEntry(uri, "w") as dbentry:
summary = dbentry.factory.summary()
summary.ids_properties.homogeneous_time = imas.ids_defs.IDS_TIME_MODE_HOMOGENEOUS
summary.ids_properties.comment = "Test summary IDS: time + ip"
summary.time = time
summary.global_quantities.ip.value = ip
dbentry.put(summary)
print(f"Wrote summary to {uri} (DD {dbentry.factory.version})")
# ---- Read ----
with imas.DBEntry(uri, "r") as dbentry:
summary = dbentry.get("summary")
t = summary.time
ip_r = summary.global_quantities.ip.value
print(f"Read {len(t)} time points")
for ti, ipi in zip(t, ip_r):
print(f" t = {ti:6.3f} s ip = {ipi / 1e6:8.3f} MA")
assert np.allclose(t, time) and np.allclose(ip_r, ip)
print("Round-trip OK")
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix #146
Affects IMAS-Python since 2.2.0 (but only when used with IMAS-Core>=5.6)
Also use this opportunity to remove a warning raised by Java-25 when running jTraverser.