imas-python 0.1.dev1651__py3-none-any.whl → 0.1.dev1652__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.

Potentially problematic release.


This version of imas-python might be problematic. Click here for more details.

imas/_version.py CHANGED
@@ -12,5 +12,5 @@ __version__: str
12
12
  __version_tuple__: VERSION_TUPLE
13
13
  version_tuple: VERSION_TUPLE
14
14
 
15
- __version__ = version = '0.1.dev1651'
16
- __version_tuple__ = version_tuple = (0, 1, 'dev1651')
15
+ __version__ = version = '0.1.dev1652'
16
+ __version_tuple__ = version_tuple = (0, 1, 'dev1652')
imas/assets/IDSDef.zip CHANGED
Binary file
@@ -22,7 +22,6 @@ try:
22
22
  except ImportError: # Python 3.8 support
23
23
  from importlib_resources import as_file, files
24
24
 
25
- import imas
26
25
  from imas.dd_zip import get_dd_xml, get_dd_xml_crc
27
26
  from imas.exception import MDSPlusModelError
28
27
  from imas.ids_factory import IDSFactory
@@ -86,12 +85,7 @@ def mdsplus_model_dir(factory: IDSFactory) -> str:
86
85
 
87
86
 
88
87
  Given a filename and xml contents create an xml
89
- document for the mdsplus model by running a command like the below:
90
-
91
- java net.sf.saxon.Transform -s:- -xsl: -o:${OUTPUT_FILE}
92
-
93
- with ENV:
94
- env={"CLASSPATH": saxon_jar_path, "PATH": os.environ.get("PATH", "")}
88
+ document for the mdsplus model by rusing saxonche
95
89
 
96
90
  Args:
97
91
  factory: IDSFactory indicating the DD version / XML to build models for.
@@ -241,62 +235,31 @@ def model_exists(path: Path) -> bool:
241
235
  )
242
236
 
243
237
 
244
- # def create_model_ids_xml(cache_dir_path, fname, version):
245
- # """Use saxon to compile an ids.xml suitable for creating an mdsplus model."""
246
-
247
- # try:
248
- # # we have to be careful to have the same version of this file as in the access
249
- # # layer:
250
- # with as_file(files(imas) / "assets" / "IDSDef2MDSpreTree.xsl") as xslfile:
251
- # check_output(
252
- # [
253
- # "java",
254
- # "net.sf.saxon.Transform",
255
- # "-s:" + str(fname),
256
- # "-o:" + str(Path(cache_dir_path) / "ids.xml"),
257
- # "DD_GIT_DESCRIBE=" + str(version or fname),
258
- # # if this is expected as git describe it might break
259
- # # if we just pass a filename
260
- # "AL_GIT_DESCRIBE=" + os.environ.get("AL_VERSION", "0.0.0"),
261
- # "-xsl:" + str(xslfile),
262
- # ],
263
- # input=get_dd_xml(version) if version else None,
264
- # env={"CLASSPATH": get_saxon(), "PATH": os.environ.get("PATH", "")},
265
- # )
266
- # except CalledProcessError as e:
267
- # if fname:
268
- # logger.error("Error making MDSPlus model IDS.xml for %s", fname)
269
- # else:
270
- # logger.error("Error making MDSplus model IDS.xml for %s", version)
271
- # raise e
272
-
273
-
274
238
  def create_model_ids_xml(cache_dir_path, fname, version):
275
239
  """Use Saxon/C to compile an ids.xml suitable for creating an MDSplus model."""
276
240
  try:
277
- # Locate the XSL file within the package
278
241
  with as_file(files("imas") / "assets" / "IDSDef2MDSpreTree.xsl") as xslfile:
279
242
  output_file = Path(cache_dir_path) / "ids.xml"
280
-
281
- # Initialize Saxon/C processor
243
+
282
244
  with PySaxonProcessor(license=False) as proc:
283
245
  xslt_processor = proc.new_xslt30_processor()
284
246
 
285
- # Set the XSLT stylesheet
286
247
  xslt_processor.compile_stylesheet(stylesheet_file=str(xslfile))
287
248
 
288
- # Prepare the input XML source
289
249
  input_xml = get_dd_xml(version) if version else None
290
250
  if fname:
291
251
  source_file = str(fname)
292
252
  elif input_xml:
293
- source_file = "-" # Use standard input for the XML string
253
+ source_file = input_xml # Use standard input for the XML string
294
254
  else:
295
- raise ValueError("Either 'fname' or 'version' must be provided to generate XML.")
255
+ raise ValueError(
256
+ "Either 'fname' or 'version' must be provided to generate XML."
257
+ )
296
258
 
297
259
  # xdm_ddgit = proc.make_string_value(str(version or fname))
298
260
  # xsltproc.set_parameter("DD_GIT_DESCRIBE", xdm_ddgit)
299
- # xdm_algit = proc.make_string_value(os.environ.get("AL_VERSION", "0.0.0"))
261
+ # xdm_algit = proc.make_string_value(os.environ.get
262
+ # ("AL_VERSION", "0.0.0"))
300
263
  # xsltproc.set_parameter("AL_GIT_DESCRIBE", xdm_algit)
301
264
  # Transform XML
302
265
  result = xslt_processor.transform_to_file(
@@ -309,7 +272,9 @@ def create_model_ids_xml(cache_dir_path, fname, version):
309
272
  )
310
273
 
311
274
  if result is False:
312
- logger.error("Transformation failed: Check Saxon/C logs for details.")
275
+ logger.error(
276
+ "Transformation failed: Check Saxon/C logs for details."
277
+ )
313
278
  raise RuntimeError("Saxon/C XSLT transformation failed.")
314
279
 
315
280
  except Exception as e:
@@ -318,7 +283,7 @@ def create_model_ids_xml(cache_dir_path, fname, version):
318
283
  else:
319
284
  logger.error("Error making MDSplus model IDS.xml for %s", version)
320
285
  raise e
321
-
286
+
322
287
 
323
288
  def create_mdsplus_model(cache_dir_path: Path) -> None:
324
289
  """Use jtraverser to compile a valid MDS model file."""
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: imas-python
3
- Version: 0.1.dev1651
3
+ Version: 0.1.dev1652
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
@@ -1,7 +1,7 @@
1
1
  imas/__init__.py,sha256=9OHpTf8gCl7BJVU7U2bf9kWatBNNAhFZdgoFPcHeNQU,878
2
2
  imas/__main__.py,sha256=2qXoC0HzV4xkPQAvdubHC4rnK3G6f_2PT9TkkCHYXk8,418
3
3
  imas/_util.py,sha256=FXX13glhmgSiw-0LtjH0xv3YlM3Pa9X4jl9yz9Uv7Vs,9484
4
- imas/_version.py,sha256=fSc98cUXRjUwffuOpTh7lfHV2cigveu6PnuuiBQ8mq8,425
4
+ imas/_version.py,sha256=dITDp1xbhCfXDOtRIqDXXnCgWJkG-EyKeCt7RywpAeQ,425
5
5
  imas/db_entry.py,sha256=OnAgz0c97gbEizrDcuO909VFUzOzeU1OIwWe50PCCxw,31755
6
6
  imas/dd_helpers.py,sha256=IFRmOWw0VyLuR9Xpe9VeVy1ANq5XpFF4m1rj9RtETKI,6275
7
7
  imas/dd_zip.py,sha256=6gQ91rlVsDaU1U6XXaEnaGyvI3ZgQ659GOgIYJLZH6M,10322
@@ -22,7 +22,7 @@ imas/ids_toplevel.py,sha256=YHWZewK8JYf34pYzF_oooMILZAHgnuWCFtr0_JFjmzI,14915
22
22
  imas/setup_logging.py,sha256=McfIYupRQDxtL-lasTjH5F8BxBvncuZhcpzSDEwKtJQ,1872
23
23
  imas/training.py,sha256=JGYjpCubUJDb_Rg0QaaDhNkBHc4Qc376U9fRq24NVXc,1576
24
24
  imas/util.py,sha256=dG282-l7m2U_VhjZ0VnQ-BpsWrzgKSxUZ1AZf-_wDOY,17822
25
- imas/assets/IDSDef.zip,sha256=9t6K2hD_cWqt_HIcEJ7YPBqf1DIjbPH3oh89e-CByf8,27383258
25
+ imas/assets/IDSDef.zip,sha256=NgSaahjoCzTxa5zE06eSLHgfk3jARuDf2n5EQXtjE5U,27383258
26
26
  imas/assets/IDSDef2MDSpreTree.xsl,sha256=V9eDmDnxe6oYhDP81gmdYip8cF2yST9dGxmZBaATLdA,7296
27
27
  imas/assets/IDS_fake_toplevel.xml,sha256=TJhukQuDHHVTW2U7fK_-KmTQiYOFZMY-ECZXBHQE2mk,18683
28
28
  imas/assets/IDS_minimal.xml,sha256=5B6c0J-WPzSChHWwpLPRkNawx9m6v8BM5nC0OQFnWcQ,1740
@@ -41,7 +41,7 @@ imas/backends/imas_core/al_context.py,sha256=D5PUg6o487kR9diRK9ZclkCpzbn-Brzhkf-
41
41
  imas/backends/imas_core/db_entry_al.py,sha256=7HeXVm2HCNh8f3Ob81GQIRyeWZ-qu6kORWI5OOtyOjQ,14893
42
42
  imas/backends/imas_core/db_entry_helpers.py,sha256=HwWTyY-IF5gEGBuL6BsPnHFL3EZtaLIxr-ctC-3u_A0,8047
43
43
  imas/backends/imas_core/imas_interface.py,sha256=c4OHvhw-aCO4O9sDSmYdcZcgeeBwu0-BcozYpVhsCuQ,7978
44
- imas/backends/imas_core/mdsplus_model.py,sha256=Y33BqScO3EiN1Rgj9ia6oLKe02tTSi-x-Nx7h23Hcdc,16405
44
+ imas/backends/imas_core/mdsplus_model.py,sha256=_l8z4vKI-o_27VOK778NOAGp6QWAV61dEnwNkuy8z5s,14795
45
45
  imas/backends/imas_core/uda_support.py,sha256=lxHzby6Fkkpn5j6yWpQrlqlwng-gA9O_hVK03Wf_Ij8,1770
46
46
  imas/backends/netcdf/__init__.py,sha256=pyETe19IpVVezOS7mNzF_Zbt_eGoK8IWnQfG8P7V4CA,191
47
47
  imas/backends/netcdf/db_entry_nc.py,sha256=xx3GDeRbTpbsi2GW2wyaUFmrUKXjFJ0q4sSbMI_-WrQ,6828
@@ -101,9 +101,9 @@ imas/test/test_str_1d.py,sha256=d6GrmV4OYG9f4ludjZBmuqyKOM9XIExTqMh8aQ1UJcQ,3453
101
101
  imas/test/test_time_slicing.py,sha256=FwbdggRJ75Suc268-89daCSaVXhzl8pZZm3Od13EiR4,6959
102
102
  imas/test/test_uda_support.py,sha256=AmakuexebZfJ2-vk_DHfNRPwHmNM2RnwzXqT0eWwWJ0,338
103
103
  imas/test/test_util.py,sha256=BW5EbL-QDIrJNH7tjBgqOacJY0TXvMidXVKpIVZlv1I,6775
104
- imas_python-0.1.dev1651.dist-info/LICENSE.txt,sha256=RzxtV7MG0zbF6dDvQsaZ1OKsHZ7CRyeILenjUIol5rs,7651
105
- imas_python-0.1.dev1651.dist-info/METADATA,sha256=hlboOUl0tPYJDpMpZG3espwHaQFQ7dFNJOsOhc6fRFE,13630
106
- imas_python-0.1.dev1651.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
107
- imas_python-0.1.dev1651.dist-info/entry_points.txt,sha256=e8oXj2SLwyFEiBeJRaAXRc9EYQ8eHWWn7NWdjixjeDM,99
108
- imas_python-0.1.dev1651.dist-info/top_level.txt,sha256=_WFOlA1rmpYm0T73sNo5Ntvs7S3x4cR7UE8Oy5I5eJA,5
109
- imas_python-0.1.dev1651.dist-info/RECORD,,
104
+ imas_python-0.1.dev1652.dist-info/LICENSE.txt,sha256=RzxtV7MG0zbF6dDvQsaZ1OKsHZ7CRyeILenjUIol5rs,7651
105
+ imas_python-0.1.dev1652.dist-info/METADATA,sha256=1JUG8vQnJFjF2W0Z-gPXE-K5gM9sGlKiYQHoeCRZ3Xk,13630
106
+ imas_python-0.1.dev1652.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
107
+ imas_python-0.1.dev1652.dist-info/entry_points.txt,sha256=e8oXj2SLwyFEiBeJRaAXRc9EYQ8eHWWn7NWdjixjeDM,99
108
+ imas_python-0.1.dev1652.dist-info/top_level.txt,sha256=_WFOlA1rmpYm0T73sNo5Ntvs7S3x4cR7UE8Oy5I5eJA,5
109
+ imas_python-0.1.dev1652.dist-info/RECORD,,