Skip to content
Open
5 changes: 5 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
- "*"

4 changes: 2 additions & 2 deletions .github/workflows/linting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test_with_pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 4 additions & 2 deletions imas/backends/imas_core/mdsplus_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will break for everyone using a JVM older than 17. E.g. the native Java on our nodes....

"-cp",
jarfile,
compiletree,
Expand All @@ -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 '<tree>_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


Expand Down
21 changes: 11 additions & 10 deletions imas/ids_coordinates.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
"""

Expand Down Expand Up @@ -357,28 +357,29 @@ def _capture_goto_errors(self, dim, coordinate):
IDSPath.goto().
"""
did_capture = []
path = self._node._path
try:
yield did_capture
except CoordinateLookupError as exc:
raise ValidationError(exc.args[0])
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}."
) from exc
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 = (
Expand All @@ -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)
2 changes: 1 addition & 1 deletion imas/ids_structure.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
2 changes: 1 addition & 1 deletion imas/test/test_hash.py
Original file line number Diff line number Diff line change
Expand Up @@ -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("<Q", len(string_list)) + b"".join(hashes))
assert expected == b"\x98\x011\x9dx+\x0e\xc0"
assert imas.util.calc_hash(minimal.str_1d) == expected
Expand Down
Loading