From d59c407bd0b030c74dc7a4b102aba7c7ea0c7780 Mon Sep 17 00:00:00 2001 From: Olivier Hoenen Date: Thu, 18 Jun 2026 10:15:36 +0200 Subject: [PATCH 1/7] group PRs from dependabot --- .github/dependabot.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index d52cfe9..001b22a 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -7,4 +7,9 @@ updates: # Check for updates once a week schedule: interval: "weekly" + # Group actions version bumps into a single PR + groups: + actions-deps: + patterns: + - "*" From e8afd639dcb2ba238b8871c3d737f1c91a74534c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 23 Jun 2026 02:05:05 +0000 Subject: [PATCH 2/7] Bump actions/checkout from 6 to 7 in the actions-deps group Bumps the actions-deps group with 1 update: [actions/checkout](https://github.com/actions/checkout). Updates `actions/checkout` from 6 to 7 - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v6...v7) --- updated-dependencies: - dependency-name: actions/checkout dependency-version: '7' dependency-type: direct:production update-type: version-update:semver-major dependency-group: actions-deps ... Signed-off-by: dependabot[bot] --- .github/workflows/linting.yml | 2 +- .github/workflows/publish.yml | 2 +- .github/workflows/test_with_pytest.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/linting.yml b/.github/workflows/linting.yml index b4a47fd..53da8b9 100644 --- a/.github/workflows/linting.yml +++ b/.github/workflows/linting.yml @@ -12,7 +12,7 @@ jobs: steps: - name: Checkout IMAS-Python sources - uses: actions/checkout@v6 + uses: actions/checkout@v7 - name: Set up Python uses: actions/setup-python@v6 diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 7dc3821..2fb380b 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -10,7 +10,7 @@ jobs: name: Build distribution runs-on: ubuntu-22.04 steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@v7 with: fetch-depth: 0 - name: Set up Python diff --git a/.github/workflows/test_with_pytest.yml b/.github/workflows/test_with_pytest.yml index e68d08b..660849a 100644 --- a/.github/workflows/test_with_pytest.yml +++ b/.github/workflows/test_with_pytest.yml @@ -14,7 +14,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v6 + uses: actions/checkout@v7 - name: Set up Python ${{ matrix.python-version }} From ce378a8a114e1c9e962c3056c83f4fc9b6858844 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 21 Jul 2026 02:05:47 +0000 Subject: [PATCH 3/7] Bump actions/setup-python from 6 to 7 in the actions-deps group Bumps the actions-deps group with 1 update: [actions/setup-python](https://github.com/actions/setup-python). Updates `actions/setup-python` from 6 to 7 - [Release notes](https://github.com/actions/setup-python/releases) - [Commits](https://github.com/actions/setup-python/compare/v6...v7) --- updated-dependencies: - dependency-name: actions/setup-python dependency-version: '7' dependency-type: direct:production update-type: version-update:semver-major dependency-group: actions-deps ... Signed-off-by: dependabot[bot] --- .github/workflows/linting.yml | 2 +- .github/workflows/publish.yml | 2 +- .github/workflows/test_with_pytest.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/linting.yml b/.github/workflows/linting.yml index 53da8b9..05c0789 100644 --- a/.github/workflows/linting.yml +++ b/.github/workflows/linting.yml @@ -15,7 +15,7 @@ jobs: uses: actions/checkout@v7 - name: Set up Python - uses: actions/setup-python@v6 + uses: actions/setup-python@v7 with: # until saxonche is available in 3.13 # https://saxonica.plan.io/issues/6561 diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 2fb380b..a34f7a5 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -14,7 +14,7 @@ jobs: with: fetch-depth: 0 - name: Set up Python - uses: actions/setup-python@v6 + uses: actions/setup-python@v7 with: # until saxonche is available in 3.13 # https://saxonica.plan.io/issues/6561 diff --git a/.github/workflows/test_with_pytest.yml b/.github/workflows/test_with_pytest.yml index 660849a..3a1def7 100644 --- a/.github/workflows/test_with_pytest.yml +++ b/.github/workflows/test_with_pytest.yml @@ -18,7 +18,7 @@ jobs: - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v6 + uses: actions/setup-python@v7 with: python-version: ${{ matrix.python-version }} - name: Display Python version From a4f5a4b0ba340c87dfe41528e233b9d3a22c4eba Mon Sep 17 00:00:00 2001 From: Maarten Sebregts Date: Thu, 23 Jul 2026 11:43:14 +0200 Subject: [PATCH 4/7] Improve performance for large arrays of structures Prevent an expensive `_path` calculation when it is not required. --- imas/ids_coordinates.py | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/imas/ids_coordinates.py b/imas/ids_coordinates.py index f8b4f59..5bc3c98 100644 --- a/imas/ids_coordinates.py +++ b/imas/ids_coordinates.py @@ -81,7 +81,7 @@ def __init__(self, coordinate_spec: str) -> None: logger.debug( f"Ignoring invalid coordinate specifier {spec}", exc_info=True ) - self.references: "tuple[IDSPath]" = tuple(refs) + self.references: "tuple[IDSPath, ...]" = tuple(refs) """A tuple paths that this coordinate refers to. """ @@ -357,7 +357,6 @@ def _capture_goto_errors(self, dim, coordinate): IDSPath.goto(). """ did_capture = [] - path = self._node._path try: yield did_capture except CoordinateLookupError as exc: @@ -365,6 +364,7 @@ def _capture_goto_errors(self, dim, coordinate): except IndexError as exc: # Can happen in IDSPath.goto when an invalid index is encountered. coordinate_refs = coordinate.format_refs(self._node) + path = self._node._path raise ValidationError( f"Error while validating element `{path}`: dimension {dim + 1} has an " f"invalid index for coordinate(s) {coordinate_refs}." @@ -372,13 +372,14 @@ def _capture_goto_errors(self, dim, coordinate): except Exception as exc: # Ignore all other exceptions and log them if "Unexpected index" in str(exc): - logger.debug( - "Ignored AoS coordinate outside our tree (see IMAS-4675) of " - "element `%s`, dimension %s, coordinate `%s`", - path, - dim, - coordinate.references, - ) + if logger.isEnabledFor(logging.DEBUG): + logger.debug( + "Ignored AoS coordinate outside our tree (see IMAS-4675) " + "of element `%s`, dimension %s, coordinate `%s`", + self._node._path, + dim, + coordinate.references, + ) else: if self._node._version <= "3.38.1": version_error = ( @@ -395,7 +396,7 @@ def _capture_goto_errors(self, dim, coordinate): coordinate.references, dim, version_error, - exc_info=1, + exc_info=True, ) # Flag to the caller that an error was suppressed did_capture.append(1) From 4390fae7ac512d6d8fd98457c547752e95404cce Mon Sep 17 00:00:00 2001 From: Maarten Sebregts Date: Wed, 5 Aug 2026 15:56:56 +0200 Subject: [PATCH 5/7] Improve speed of `hasattr` on IDS structures Replace `_path` (which constructs the path including AoS indices) with the static `metadata.path_string` when an attribute cannot be found. Speeds up the following sample from 110ms to 0.5ms (200x gain): ```python import timeit import imas cp = imas.IDSFactory().core_profiles() cp.profiles_1d.resize(1000) def totime(): hasattr(cp.profiles_1d[999], "xyz") print(timeit.repeat(totime, number=1000)) ``` **Changed behaviour:** Before: `AttributeError: IDS structure 'profiles_1d[999]' has no attribute 'xyz'` After: `AttributeError: IDS structure 'profiles_1d' has no attribute 'xyz'` Since the index of an AoS is not relevant for whether an attribute exists or not, I believe this is not a problem. --- imas/ids_structure.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/imas/ids_structure.py b/imas/ids_structure.py index fbc3042..4818ae0 100644 --- a/imas/ids_structure.py +++ b/imas/ids_structure.py @@ -57,7 +57,7 @@ def __init__(self, parent: IDSBase, metadata: IDSMetadata): def __getattr__(self, name): if name not in self._children: raise AttributeError( - f"IDS structure '{self._path}' has no attribute '{name}'" + f"IDS structure '{self.metadata.path_string}' has no attribute '{name}'" ) # Create child node child_meta = self._children[name] From af282ce18577040f9da4f04dc9c42e65579e4f9c Mon Sep 17 00:00:00 2001 From: Olivier Hoenen Date: Thu, 22 Oct 2026 14:22:14 +0200 Subject: [PATCH 6/7] Fix a regression (since 2.2 when used with IMAS-Core>=5.6) on mdsplus models generation --- imas/backends/imas_core/mdsplus_model.py | 6 ++++-- imas/ids_structure.py | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/imas/backends/imas_core/mdsplus_model.py b/imas/backends/imas_core/mdsplus_model.py index df813e8..6ef9773 100644 --- a/imas/backends/imas_core/mdsplus_model.py +++ b/imas/backends/imas_core/mdsplus_model.py @@ -330,6 +330,7 @@ def create_mdsplus_model(cache_dir_path: Path) -> None: "-Xms1g", # what do these do? "-Xmx8g", # what do these do? "-XX:+UseG1GC", # what do these do? + "--enable-native-access=ALL-UNNAMED", # Java-25 "-cp", jarfile, compiletree, @@ -339,13 +340,14 @@ def create_mdsplus_model(cache_dir_path: Path) -> None: env={ "PATH": os.environ.get("PATH", ""), "LD_LIBRARY_PATH": os.environ.get("LD_LIBRARY_PATH", ""), - get_mdsplus_model_var(): str(cache_dir_path), + # MDSplus locates models through '_path' (tree='ids') + "ids_path": str(cache_dir_path), }, ) # Touch a file to show that we have finished the model (cache_dir_path / "done.txt").touch() except CalledProcessError as e: - logger.error("Error making MDSPlus model in {path}", cache_dir_path) + logger.error("Error making MDSPlus model in %s", cache_dir_path) raise e diff --git a/imas/ids_structure.py b/imas/ids_structure.py index fbc3042..4818ae0 100644 --- a/imas/ids_structure.py +++ b/imas/ids_structure.py @@ -57,7 +57,7 @@ def __init__(self, parent: IDSBase, metadata: IDSMetadata): def __getattr__(self, name): if name not in self._children: raise AttributeError( - f"IDS structure '{self._path}' has no attribute '{name}'" + f"IDS structure '{self.metadata.path_string}' has no attribute '{name}'" ) # Create child node child_meta = self._children[name] From 42b3d56f34d1abccb2b5ade554c7915718f387c1 Mon Sep 17 00:00:00 2001 From: Olivier Hoenen Date: Thu, 22 Oct 2026 15:39:46 +0200 Subject: [PATCH 7/7] Fix broken test due to breaking change in xxhash>=4 (requires encoding strings before hashing) --- imas/test/test_hash.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/imas/test/test_hash.py b/imas/test/test_hash.py index f583788..6b23788 100644 --- a/imas/test/test_hash.py +++ b/imas/test/test_hash.py @@ -27,7 +27,7 @@ def test_hash_str1d(minimal): "multiple entries to test!", ] minimal.str_1d = string_list - hashes = list(map(xxh3_64_digest, string_list)) + hashes = [xxh3_64_digest(s.encode("utf-8")) for s in string_list] expected = xxh3_64_digest(struct.pack("