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: + - "*" diff --git a/.github/workflows/linting.yml b/.github/workflows/linting.yml index b4a47fd..05c0789 100644 --- a/.github/workflows/linting.yml +++ b/.github/workflows/linting.yml @@ -12,10 +12,10 @@ jobs: steps: - name: Checkout IMAS-Python sources - uses: actions/checkout@v6 + 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 7dc3821..a34f7a5 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -10,11 +10,11 @@ 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 - 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 e68d08b..3a1def7 100644 --- a/.github/workflows/test_with_pytest.yml +++ b/.github/workflows/test_with_pytest.yml @@ -14,11 +14,11 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v6 + uses: actions/checkout@v7 - 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 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_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) 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] 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("