imas-python 2.3.0__py3-none-any.whl → 2.3.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
imas/_version.py CHANGED
@@ -18,7 +18,7 @@ version_tuple: tuple[int | str, ...]
18
18
  commit_id: str | None
19
19
  __commit_id__: str | None
20
20
 
21
- __version__ = version = '2.3.0'
22
- __version_tuple__ = version_tuple = (2, 3, 0)
21
+ __version__ = version = '2.3.1'
22
+ __version_tuple__ = version_tuple = (2, 3, 1)
23
23
 
24
- __commit_id__ = commit_id = None
24
+ __commit_id__ = commit_id = 'gdc78cc36c'
@@ -12,7 +12,7 @@ import tempfile
12
12
  import time
13
13
  import uuid
14
14
  from pathlib import Path
15
- from subprocess import CalledProcessError, check_output
15
+ from subprocess import STDOUT, CalledProcessError, check_output
16
16
  from zlib import crc32
17
17
  from packaging.version import Version
18
18
 
@@ -324,12 +324,19 @@ def create_mdsplus_model(cache_dir_path: Path) -> None:
324
324
  "Could not determine CompileTree class in jTraverser.jar."
325
325
  )
326
326
  compiletree = compiletree_class.rpartition(".class")[0].replace("/", ".")
327
+ # only add option to suppress warning if the JVM supports it
328
+ native_access = ["--enable-native-access=ALL-UNNAMED"]
329
+ try:
330
+ check_output(["java", *native_access, "-version"], stderr=STDOUT)
331
+ except CalledProcessError:
332
+ native_access = []
327
333
  check_output(
328
334
  [
329
335
  "java",
330
336
  "-Xms1g", # what do these do?
331
337
  "-Xmx8g", # what do these do?
332
338
  "-XX:+UseG1GC", # what do these do?
339
+ *native_access,
333
340
  "-cp",
334
341
  jarfile,
335
342
  compiletree,
@@ -339,13 +346,14 @@ def create_mdsplus_model(cache_dir_path: Path) -> None:
339
346
  env={
340
347
  "PATH": os.environ.get("PATH", ""),
341
348
  "LD_LIBRARY_PATH": os.environ.get("LD_LIBRARY_PATH", ""),
342
- get_mdsplus_model_var(): str(cache_dir_path),
349
+ # MDSplus locates models through '<tree>_path' (tree='ids')
350
+ "ids_path": str(cache_dir_path),
343
351
  },
344
352
  )
345
353
  # Touch a file to show that we have finished the model
346
354
  (cache_dir_path / "done.txt").touch()
347
355
  except CalledProcessError as e:
348
- logger.error("Error making MDSPlus model in {path}", cache_dir_path)
356
+ logger.error("Error making MDSPlus model in %s", cache_dir_path)
349
357
  raise e
350
358
 
351
359
 
imas/ids_coordinates.py CHANGED
@@ -81,7 +81,7 @@ class IDSCoordinate:
81
81
  logger.debug(
82
82
  f"Ignoring invalid coordinate specifier {spec}", exc_info=True
83
83
  )
84
- self.references: "tuple[IDSPath]" = tuple(refs)
84
+ self.references: "tuple[IDSPath, ...]" = tuple(refs)
85
85
  """A tuple paths that this coordinate refers to.
86
86
  """
87
87
 
@@ -357,7 +357,6 @@ class IDSCoordinates:
357
357
  IDSPath.goto().
358
358
  """
359
359
  did_capture = []
360
- path = self._node._path
361
360
  try:
362
361
  yield did_capture
363
362
  except CoordinateLookupError as exc:
@@ -365,6 +364,7 @@ class IDSCoordinates:
365
364
  except IndexError as exc:
366
365
  # Can happen in IDSPath.goto when an invalid index is encountered.
367
366
  coordinate_refs = coordinate.format_refs(self._node)
367
+ path = self._node._path
368
368
  raise ValidationError(
369
369
  f"Error while validating element `{path}`: dimension {dim + 1} has an "
370
370
  f"invalid index for coordinate(s) {coordinate_refs}."
@@ -372,13 +372,14 @@ class IDSCoordinates:
372
372
  except Exception as exc:
373
373
  # Ignore all other exceptions and log them
374
374
  if "Unexpected index" in str(exc):
375
- logger.debug(
376
- "Ignored AoS coordinate outside our tree (see IMAS-4675) of "
377
- "element `%s`, dimension %s, coordinate `%s`",
378
- path,
379
- dim,
380
- coordinate.references,
381
- )
375
+ if logger.isEnabledFor(logging.DEBUG):
376
+ logger.debug(
377
+ "Ignored AoS coordinate outside our tree (see IMAS-4675) "
378
+ "of element `%s`, dimension %s, coordinate `%s`",
379
+ self._node._path,
380
+ dim,
381
+ coordinate.references,
382
+ )
382
383
  else:
383
384
  if self._node._version <= "3.38.1":
384
385
  version_error = (
@@ -395,7 +396,7 @@ class IDSCoordinates:
395
396
  coordinate.references,
396
397
  dim,
397
398
  version_error,
398
- exc_info=1,
399
+ exc_info=True,
399
400
  )
400
401
  # Flag to the caller that an error was suppressed
401
402
  did_capture.append(1)
imas/ids_structure.py CHANGED
@@ -57,7 +57,7 @@ class IDSStructure(IDSBase):
57
57
  def __getattr__(self, name):
58
58
  if name not in self._children:
59
59
  raise AttributeError(
60
- f"IDS structure '{self._path}' has no attribute '{name}'"
60
+ f"IDS structure '{self.metadata.path_string}' has no attribute '{name}'"
61
61
  )
62
62
  # Create child node
63
63
  child_meta = self._children[name]
imas/test/test_hash.py CHANGED
@@ -27,7 +27,7 @@ def test_hash_str1d(minimal):
27
27
  "multiple entries to test!",
28
28
  ]
29
29
  minimal.str_1d = string_list
30
- hashes = list(map(xxh3_64_digest, string_list))
30
+ hashes = [xxh3_64_digest(s.encode("utf-8")) for s in string_list]
31
31
  expected = xxh3_64_digest(struct.pack("<Q", len(string_list)) + b"".join(hashes))
32
32
  assert expected == b"\x98\x011\x9dx+\x0e\xc0"
33
33
  assert imas.util.calc_hash(minimal.str_1d) == expected
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: imas-python
3
- Version: 2.3.0
3
+ Version: 2.3.1
4
4
  Summary: Pythonic wrappers for the IMAS Access Layer
5
5
  Author: ITER Organization
6
6
  Author-email: Karel Lucas van de Plassche <karelvandeplassche@gmail.com>, Daan van Vugt <dvanvugt@ignitioncomputing.com>, Maarten Sebregts <msebregts@ignitioncomputing.com>, imas-support@iter.org
@@ -2,14 +2,14 @@ imas/__init__.py,sha256=VTV46C_bCi6ODs6LMee0WeGrUElNIAmDZ_oKM3_rJmo,1630
2
2
  imas/__main__.py,sha256=nei61YSa3KE4V601qcApNQYgv9hKMenoMJyZLWmsHRQ,418
3
3
  imas/_to_xarray.py,sha256=zxHNmKEk_7NRcWHwhWgBMTyy312DrsSC69RxuGs3itk,3060
4
4
  imas/_util.py,sha256=3CwP5yoyXNipyaUdMb-IwzVDlqV35VjTFxfaronO1AI,9484
5
- imas/_version.py,sha256=MrWYRYfolpd3nMW8K6V8c2KLgTXCmV5o8cpGKFOPmaM,520
5
+ imas/_version.py,sha256=Mmte4PyEwEwp7yPmOH-H0YLZXIrr0ShJ4zHbarTXHEg,528
6
6
  imas/convert_core_edge_plasma.py,sha256=WcBOrYcepw-sixZWrFKFqvG1SdBDO0MGaQoN1xtj4Fg,4967
7
7
  imas/db_entry.py,sha256=0REHHrC_u56TJoBvWsyf6ih0ug2YNJIMCV6x8_PrYpI,34503
8
8
  imas/dd_zip.py,sha256=Fiu81NjIyQ-4tdmpaUNJtgKohiNYWIzYcNz96S9zrZ4,3988
9
9
  imas/exception.py,sha256=IuANFtLz1jRHgbS9SERcK9bSFiGFcBSmNkWbQwNPVuo,3293
10
10
  imas/ids_base.py,sha256=tgBUoV0Mf-3xdzs2qnD9EnmCXqzbX-pm06Ha7Xq9X04,5489
11
11
  imas/ids_convert.py,sha256=qaGiogQq1tW2RMfYQhMWqqdusyKxGFXT2LDcpuA1KVM,57412
12
- imas/ids_coordinates.py,sha256=kDph5YTrlGsEMa8ZvOWDHIl1dYzIx7NIIvidyMr09sI,16993
12
+ imas/ids_coordinates.py,sha256=wXFwrGNOl4PQ6YKaX5t4OVLNAodkuYkLHphd9PSqt4I,17100
13
13
  imas/ids_data_type.py,sha256=N3nQXmIht0q8BbqE99sPsTmZ62CTUHv10Pfj_rtYi54,3302
14
14
  imas/ids_defs.py,sha256=sOZpuAnJT9VJPJoTWwATUOirmPsWhcK38B7K222xbik,3779
15
15
  imas/ids_factory.py,sha256=dMNy0-B7IbfhZ13QE0G2S0nVonmbqUmhprCbFYtKltw,4670
@@ -18,7 +18,7 @@ imas/ids_metadata.py,sha256=LkZ7-BQ9EB1X4w4Ocp0frk4eSJImmWWsfL0mp9m79Xg,12283
18
18
  imas/ids_path.py,sha256=jJzp7jmIMQr6ZeQJvLEEIIf0cF9NKIcv2DkCP-HNrt4,10446
19
19
  imas/ids_primitive.py,sha256=nve5n1p43nQTYLL0BvaFfgGpTI-Glu1kKMnSVVePuu4,16862
20
20
  imas/ids_struct_array.py,sha256=o9xgl_K0SDlqIapmhAT7dQ997RGW2cPAYQFI4P_h59w,8292
21
- imas/ids_structure.py,sha256=7E-sLhfQx8SCGmVHRVswZku8IZRAHuhcpRlKSyaEQns,13185
21
+ imas/ids_structure.py,sha256=m886jxpBP9guN3HU-juFLFdwaZisq7jY83ZwInpNch8,13200
22
22
  imas/ids_toplevel.py,sha256=2UiA06C6amyRxTePzpMIUakTYvzeq1Xt1t_09sj4oYg,14572
23
23
  imas/setup_logging.py,sha256=0v4_haGLsUJr8fHkl46UmTEgMImBzvfL2xU5kudB9ac,1872
24
24
  imas/training.py,sha256=J3Zpx_86V1USz-_1KvCsCe7MEwBrf5LAo_8-aM5Stu8,1067
@@ -41,7 +41,7 @@ imas/backends/imas_core/al_context.py,sha256=uDAe3boSKvOQBhtUo4dSUJeduXZ2MSEmKd_
41
41
  imas/backends/imas_core/db_entry_al.py,sha256=lhuIllXs32qy73QF3bIzLwZKm6pBnQ_hR7ScprJ3U6I,16233
42
42
  imas/backends/imas_core/db_entry_helpers.py,sha256=fjvb3gEBiAzexDCyIsoGTwEcWuvPwhjZ0epXa-p_9hA,7883
43
43
  imas/backends/imas_core/imas_interface.py,sha256=so2DlmRdUHdgwfU-euoB7dLeeWwiyiOhfal_aoL1lWQ,6470
44
- imas/backends/imas_core/mdsplus_model.py,sha256=RDycMYOAKWevutDR75964GKBAcQM4Rzdu-zB5gv_f1U,14590
44
+ imas/backends/imas_core/mdsplus_model.py,sha256=UthFelK9-R3JoS0jQzGjh6mFHzAYWz3ScXb7l2AVQ1g,14978
45
45
  imas/backends/imas_core/uda_support.py,sha256=m2IJSvVFnaOLjz3ZIftX_eBNa7BY48V-G3kW6rrZ42g,1790
46
46
  imas/backends/netcdf/__init__.py,sha256=T1xOq4F7fJtFKYtzQQwVOV_9r9plNH6kgpUsDx6vDN0,191
47
47
  imas/backends/netcdf/db_entry_nc.py,sha256=qmYGraRXlo8YeEQ1VQ8LI4sQo5-cUh5Ow64txhJH-hw,8010
@@ -64,7 +64,7 @@ imas/test/test_dd_zip.py,sha256=SgKPufIvk3tK_Q4JpHKq57g0lKthEj1IgcdZ2c-IzwI,820
64
64
  imas/test/test_deepcopy.py,sha256=vYTwpEqRpi-G-xVSRWVIwLL_jBY7f6v31QPOU0e_FKs,606
65
65
  imas/test/test_exception.py,sha256=AMFlZGy0-gG9MlYTs8WeAuO3m0holk4kG3HicrqP4HQ,395
66
66
  imas/test/test_get_sample.py,sha256=BMoVJS4PgtV3S-AUnH6MJO2F8og1TZQk3KzOxGVa0as,16031
67
- imas/test/test_hash.py,sha256=l4yoTBOm4QFsOTYxbhC3v5Ll7ytfEcbL4aVsu3wBEfc,6122
67
+ imas/test/test_hash.py,sha256=JubQXiIwvqF0YErn5KMcuWu9OGqjK2J4vBHjVOW2GMM,6140
68
68
  imas/test/test_helpers.py,sha256=M6rTG9C-0lV4P7h7uxQ_DAszn-iqUHir-wy97I4nySM,14919
69
69
  imas/test/test_identifiers.py,sha256=abdg8JdcDbuctL5teZwyMf5zR3N99y63XMq1f0_0xI8,11344
70
70
  imas/test/test_ids2nc.py,sha256=zLp0F6GW04gU6HYp63bWivFS3Let_dwMohYy6Rgbis0,6040
@@ -106,9 +106,9 @@ imas/test/test_time_slicing.py,sha256=gq9L4VolKpTdleqQpTahZDYPn0VHkKEwOFQjlkGxR9
106
106
  imas/test/test_to_xarray.py,sha256=yuqqP_VEdftJyFiC1BEeKpcXaKszOATU5QE94q2NZX4,3853
107
107
  imas/test/test_uda_support.py,sha256=AmakuexebZfJ2-vk_DHfNRPwHmNM2RnwzXqT0eWwWJ0,338
108
108
  imas/test/test_util.py,sha256=BW5EbL-QDIrJNH7tjBgqOacJY0TXvMidXVKpIVZlv1I,6775
109
- imas_python-2.3.0.dist-info/licenses/LICENSE.txt,sha256=RzxtV7MG0zbF6dDvQsaZ1OKsHZ7CRyeILenjUIol5rs,7651
110
- imas_python-2.3.0.dist-info/METADATA,sha256=W7ySJZRL3ZlIAaC8IS1jjbhDj47AMesrtrObDmqwhUc,14193
111
- imas_python-2.3.0.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
112
- imas_python-2.3.0.dist-info/entry_points.txt,sha256=PI0yiL4MmzUS-sIQjt4gSEnBCdL-rB_XHGASKNsTf6g,46
113
- imas_python-2.3.0.dist-info/top_level.txt,sha256=_WFOlA1rmpYm0T73sNo5Ntvs7S3x4cR7UE8Oy5I5eJA,5
114
- imas_python-2.3.0.dist-info/RECORD,,
109
+ imas_python-2.3.1.dist-info/licenses/LICENSE.txt,sha256=RzxtV7MG0zbF6dDvQsaZ1OKsHZ7CRyeILenjUIol5rs,7651
110
+ imas_python-2.3.1.dist-info/METADATA,sha256=3_iOWzC_ukMROb9v2S1I69mGilYTL52taNDJSB0JA1k,14193
111
+ imas_python-2.3.1.dist-info/WHEEL,sha256=mOdXR9C3wMVov7cSY8PY-XCzo3SmmWCHvGQr5csJoao,91
112
+ imas_python-2.3.1.dist-info/entry_points.txt,sha256=PI0yiL4MmzUS-sIQjt4gSEnBCdL-rB_XHGASKNsTf6g,46
113
+ imas_python-2.3.1.dist-info/top_level.txt,sha256=_WFOlA1rmpYm0T73sNo5Ntvs7S3x4cR7UE8Oy5I5eJA,5
114
+ imas_python-2.3.1.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (82.0.1)
2
+ Generator: setuptools (84.2.1)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5