Skip to content

Commit 66ba7d9

Browse files
committed
Explicitly set data_version=3 for snippets using public SDCC DBEntries
1 parent 41a53f1 commit 66ba7d9

File tree

3 files changed

+14
-8
lines changed

3 files changed

+14
-8
lines changed

docs/source/courses/basic/imaspy_snippets/explore_public_ec_launchers.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
import imaspy.util
22

33
# Open input data entry
4-
entry = imaspy.DBEntry(imaspy.ids_defs.HDF5_BACKEND, "ITER_MD", 120000, 204, "public")
4+
entry = imaspy.DBEntry(
5+
imaspy.ids_defs.HDF5_BACKEND, "ITER_MD", 120000, 204, "public", data_version="3"
6+
)
57
entry.open()
68

79
# Get the ec_launchers IDS

docs/source/courses/basic/imaspy_snippets/explore_public_pf_active.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
import imaspy.util
22

33
# Open input data entry
4-
entry = imaspy.DBEntry(imaspy.ids_defs.HDF5_BACKEND, "ITER_MD", 111001, 103, "public")
4+
entry = imaspy.DBEntry(
5+
imaspy.ids_defs.HDF5_BACKEND, "ITER_MD", 111001, 103, "public", data_version="3"
6+
)
57
entry.open()
68

79
# Get the pf_active IDS

docs/source/courses/basic/imaspy_snippets/plot_core_profiles_te.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,15 @@
99
else:
1010
matplotlib.use("TKagg")
1111

12+
from matplotlib import pyplot as plt
13+
1214
import imaspy
1315
from imaspy.ids_defs import MDSPLUS_BACKEND
14-
from matplotlib import pyplot as plt
1516

1617
database, pulse, run, user = "ITER", 134173, 106, "public"
17-
data_entry = imaspy.DBEntry(MDSPLUS_BACKEND, database, pulse, run, user)
18+
data_entry = imaspy.DBEntry(
19+
MDSPLUS_BACKEND, database, pulse, run, user, data_version="3"
20+
)
1821
data_entry.open()
1922
# Enable lazy loading with `lazy=True`:
2023
core_profiles = data_entry.get("core_profiles", lazy=True)
@@ -25,10 +28,9 @@
2528
print(f"Time has {len(time)} elements, between {time[0]} and {time[-1]}")
2629

2730
# Find the electron temperature at rho=0 for all time slices
28-
electon_temperature_0 = numpy.array([
29-
p1d.electrons.temperature[0]
30-
for p1d in core_profiles.profiles_1d
31-
])
31+
electon_temperature_0 = numpy.array(
32+
[p1d.electrons.temperature[0] for p1d in core_profiles.profiles_1d]
33+
)
3234

3335
# Plot the figure
3436
fig, ax = plt.subplots()

0 commit comments

Comments
 (0)