Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions .github/workflows/linting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,14 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v7
with:
# until saxonche is available in 3.13
# https://saxonica.plan.io/issues/6561
python-version: "<3.13"
# choose lowest python version supported to reject syntax it cannot handle yet
python-version: "3.9"

- name: Display Python version
run: python -c "import sys; print(sys.version)"

- name: Install the code linting and formatting tools
run: pip install --upgrade 'black >=24,<25' flake8
run: pip install --upgrade 'black >=25,<26' flake8

- name: Check formatting of code with black
run: black --check imas
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v7
with:
# until saxonche is available in 3.13
# https://saxonica.plan.io/issues/6561
python-version: "<3.13"
python-version: "3.15"
- name: Install pypa/build
run: >-
python3 -m pip install pip setuptools wheel build
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/test_with_pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,13 @@ on:

jobs:
test:
runs-on: ubuntu-latest
# setup-python has no 3.9 build for ubuntu-26.04 (which ubuntu-latest now resolves to);
# 24.04 has builds for every version in the matrix
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13"] # Test on multiple Python versions
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14", "3.15"] # Test on multiple Python versions

steps:
- name: Checkout repository
Expand Down
3 changes: 1 addition & 2 deletions imas/backends/imas_core/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# This file is part of IMAS-Python.
# You should have received the IMAS-Python LICENSE file with this project.
"""Subpackage implementing data access through the IMAS Access Layer Core.
"""
"""Subpackage implementing data access through the IMAS Access Layer Core."""
3 changes: 1 addition & 2 deletions imas/backends/imas_core/db_entry_helpers.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# This file is part of IMAS-Python.
# You should have received the IMAS-Python LICENSE file with this project.
"""Helper methods for loading data from and storing data to Data Entries.
"""
"""Helper methods for loading data from and storing data to Data Entries."""

from typing import Optional

Expand Down
3 changes: 1 addition & 2 deletions imas/backends/netcdf/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# This file is part of IMAS-Python.
# You should have received the IMAS-Python LICENSE file with this project.
"""NetCDF IO support for IMAS-Python. Requires [netcdf] extra dependencies.
"""
"""NetCDF IO support for IMAS-Python. Requires [netcdf] extra dependencies."""
2 changes: 1 addition & 1 deletion imas/ids_convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -1344,7 +1344,7 @@ def _magnetics_method_to_ip(method: IDSBase, ip: IDSBase) -> None:
if not len(method):
return
ip.resize(len(method))
for old_item, new_item in zip(method, ip, strict=True):
for old_item, new_item in zip(method, ip):
new_item.method_name.value = old_item.name.value
new_item.data.value = old_item.ip.data.value
new_item.time.value = old_item.ip.time.value
3 changes: 1 addition & 2 deletions imas/ids_data_type.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# This file is part of IMAS-Python.
# You should have received the IMAS-Python LICENSE file with this project.
"""Data Dictionary type handling functionality.
"""
"""Data Dictionary type handling functionality."""

from enum import Enum
from functools import lru_cache
Expand Down
2 changes: 1 addition & 1 deletion imas/ids_defs.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This file is part of IMAS-Python.
# You should have received the IMAS-Python LICENSE file with this project.
""" Load IMAS-Python libs to provide constants
"""Load IMAS-Python libs to provide constants

.. _`Backend identifiers`:

Expand Down
3 changes: 1 addition & 2 deletions imas/ids_path.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# This file is part of IMAS-Python.
# You should have received the IMAS-Python LICENSE file with this project.
"""Logic for interpreting paths to elements in an IDS
"""
"""Logic for interpreting paths to elements in an IDS"""

import logging
import re
Expand Down
3 changes: 1 addition & 2 deletions imas/ids_primitive.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# This file is part of IMAS-Python.
# You should have received the IMAS-Python LICENSE file with this project.
"""Provides the classes for IDS data nodes
"""
"""Provides the classes for IDS data nodes"""
import logging
import math
import operator
Expand Down
3 changes: 1 addition & 2 deletions imas/ids_struct_array.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# This file is part of IMAS-Python.
# You should have received the IMAS-Python LICENSE file with this project.
"""IDS StructArray represents an Array of Structures in the IDS tree.
"""
"""IDS StructArray represents an Array of Structures in the IDS tree."""

import logging
from copy import deepcopy
Expand Down
3 changes: 1 addition & 2 deletions imas/setup_logging.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# This file is part of IMAS-Python.
# You should have received the IMAS-Python LICENSE file with this project.
"""Create a default log handler when IMAS-Python is imported.
"""
"""Create a default log handler when IMAS-Python is imported."""

import logging
import os
Expand Down
3 changes: 1 addition & 2 deletions imas/test/test_latest_dd_resample.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"""A testcase checking if resampling works for the latest data dictionary version.
"""
"""A testcase checking if resampling works for the latest data dictionary version."""

import numpy as np

Expand Down
3 changes: 1 addition & 2 deletions imas/test/test_minimal_types_io_automatic.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"""A minimal testcase loading an IDS file and checking that the structure built is ok
"""
"""A minimal testcase loading an IDS file and checking that the structure built is ok"""

import numpy as np

Expand Down
7 changes: 2 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[build-system]
# Minimum requirements for the build system to execute.
# Keep this on a single line for the grep magic of build scripts to work
requires = ["setuptools>=61", "wheel", "numpy", "packaging", "tomli;python_version<'3.11'", "setuptools_scm>8"]
requires = ["setuptools>=61", "wheel", "packaging", "tomli;python_version<'3.11'", "setuptools_scm>8"]

build-backend = "setuptools.build_meta"

Expand All @@ -16,7 +16,7 @@ authors = [
]
description = "Pythonic wrappers for the IMAS Access Layer"
readme = {file = "README.md", content-type = "text/markdown"}
requires-python = ">=3.7"
requires-python = ">=3.9"
license = {file = "LICENSE.txt"}
classifiers = [
"Development Status :: 5 - Production/Stable",
Expand All @@ -40,8 +40,6 @@ classifiers = [
"Operating System :: POSIX :: Linux",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Unix Shell",
"Topic :: Database",
"Topic :: Database :: Front-Ends",
Expand All @@ -60,7 +58,6 @@ dependencies = [
"rich",
"scipy",
"click",
"importlib_resources;python_version<'3.9'",

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.

Also remove the try/except structures in the code base? For example:

try:
from importlib.resources import files
except ImportError: # Python 3.8 support
from importlib_resources import files

"packaging",
"xxhash >= 2",
"imas_data_dictionaries>=4.1.0",
Expand Down
Loading