Skip to content
Closed
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
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: "test-unix"
name: "test-linux"
on:
push:
branches:
Expand All @@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-24.04
strategy:
matrix:
python_version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
python_version: ["3.10", "3.11", "3.12", "3.13", "3.14", "3.15"]
defaults:
run:
shell: bash
Expand Down
39 changes: 39 additions & 0 deletions .github/workflows/test-macos.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: "test-macos"
on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
pytest:
runs-on: macos-26
strategy:
matrix:
python_version: ["3.10", "3.11", "3.12", "3.13", "3.14", "3.15"]
defaults:
run:
shell: bash
steps:
# check-out repo and install python
- name: Check out repository
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python_version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python_version }}
cache: "pip"
- name: Install dependencies
run: pip install ".[dev,all]"
- name: Make GNU Fortran available as gfortran
run: |
gfortran_path=$(command -v gfortran-15)
mkdir -p "$RUNNER_TEMP/fortran-bin"
ln -s "$gfortran_path" "$RUNNER_TEMP/fortran-bin/gfortran"
echo "$RUNNER_TEMP/fortran-bin" >> "$GITHUB_PATH"
- name: Run pytests
env:
GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: python -m pytest --verbose tests
2 changes: 1 addition & 1 deletion .github/workflows/test-windows.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: windows-2022
strategy:
matrix:
python_version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
python_version: ["3.10", "3.11", "3.12", "3.13", "3.14", "3.15"]
defaults:
run:
shell: bash
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ old-docs
.python-version
*pytest*test.lock
*pytest*test.lock-journal
*bsp.download

# Created by https://www.toptal.com/developers/gitignore/api/linux,macos,python,windows,jetbrains,fortran
# Edit at https://www.toptal.com/developers/gitignore?templates=linux,macos,python,windows,jetbrains,fortran
Expand Down
4 changes: 2 additions & 2 deletions CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ doi: 10.5281/zenodo.14284949
license:
- gpl-3.0-or-later
type: software
version: 2.12.2
date-released: "2026-06-29"
version: 2.13.0
date-released: "2026-11-30"
6 changes: 3 additions & 3 deletions docs/agentic/example-usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -189,11 +189,11 @@ with open(rel_to_abs_path("somedir", "some_file.txt"), "r") as f:

## Set alarms to catch infinite loops

The following code will raise a `TimeoutError` if the function `my_function`
takes longer than 10 seconds to execute:
On POSIX systems, the following code raises a `TimeoutError` if `my_function`
takes longer than 10 seconds to execute.

```python
from tum_esm_utils.context import set_alarm, clear_alarm
from tum_esm_utils.timing import set_alarm, clear_alarm

set_alarm(10, "some section name")
my_function()
Expand Down
8 changes: 4 additions & 4 deletions docs/agentic/modules/code.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Implements: `request_github_file`, `request_gitlab_file`
```python
def request_github_file(repository: str,
filepath: str,
access_token: Optional[str] = None,
access_token: str | None = None,
branch_name: str = "main",
timeout: int = 10) -> str
```
Expand Down Expand Up @@ -39,8 +39,8 @@ Raises an HTTPError if the response status code is not 200.
def download_github_release_asset(repository: str,
asset_name: str,
dst_dir: str,
final_name: Optional[str] = None,
access_token: Optional[str] = None,
final_name: str | None = None,
access_token: str | None = None,
force: bool = False) -> None
```

Expand All @@ -63,7 +63,7 @@ Not supported on windows!
```python
def request_gitlab_file(repository: str,
filepath: str,
access_token: Optional[str] = None,
access_token: str | None = None,
branch_name: str = "main",
hostname: str = "gitlab.com",
timeout: int = 10) -> str
Expand Down
2 changes: 1 addition & 1 deletion docs/agentic/modules/column.averaging_kernel.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ A class to store, load and apply a column averaging kernel.
```python
def __init__(szas: np.ndarray[Any, Any],
pressures: np.ndarray[Any, Any],
aks: Optional[np.ndarray[Any, Any]] = None) -> None
aks: np.ndarray[Any, Any] | None = None) -> None
```

Initialize the ColumnAveragingKernel.
Expand Down
4 changes: 2 additions & 2 deletions docs/agentic/modules/em27.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def detect_corrupt_opus_files(
```

Returns dict[filename, list[error_messages]] for all
corrupt opus files in the given directory.
corrupt opus files in the given directory. Available on POSIX systems only.

It will compile the fortran code using a given compiler
to perform this task. The fortran code is derived from
Expand Down Expand Up @@ -61,7 +61,7 @@ def detect_corrupt_ifgs(ifg_directory: str,
```

Returns dict[filename, list[error_messages]] for all
corrupt opus files in the given directory.
corrupt opus files in the given directory. Available on POSIX systems only.

It will compile the fortran code using a given compiler
to perform this task. The fortran code is derived from
Expand Down
14 changes: 7 additions & 7 deletions docs/agentic/modules/files.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ Load the content of a JSON file.
##### `dump_json_file`

```python
def dump_json_file(path: str, content: Any, indent: Optional[int] = 4) -> None
def dump_json_file(path: str, content: Any, indent: int | None = 4) -> None
```

Dump content to a JSON file.
Expand Down Expand Up @@ -180,10 +180,10 @@ blocks, and/or none of the forbidden content blocks.
```python
def render_directory_tree(root: str,
ignore: list[str] = [],
max_depth: Optional[int] = None,
root_alias: Optional[str] = None,
directory_prefix: Optional[str] = "📁 ",
file_prefix: Optional[str] = "📄 ") -> Optional[str]
max_depth: int | None = None,
root_alias: str | None = None,
directory_prefix: str | None = "📁 ",
file_prefix: str | None = "📄 ") -> str | None
```

Render a file tree as a string.
Expand Down Expand Up @@ -230,8 +230,8 @@ Render a file tree as a string.

```python
def list_directory(path: str,
regex: Optional[str] = None,
ignore: Optional[list[str]] = None,
regex: str | None = None,
ignore: list[str] | None = None,
include_directories: bool = True,
include_files: bool = True,
include_links: bool = True) -> list[str]
Expand Down
17 changes: 9 additions & 8 deletions docs/agentic/modules/netcdf.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,13 @@ Create a new dimension in the NetCDF file.
def create_variable(name: str,
dimensions: tuple[nc.Dimension | str, ...],
units: str,
long_name: Optional[str] = None,
description: Optional[str] = None,
fill_value: Optional[float | int] = None,
long_name: str | None = None,
description: str | None = None,
fill_value: float | None = None,
chunk_dimensions: list[str] = [],
datatype: Literal["f4", "f8", "i4", "i8"] = "f4",
zlib: bool = True,
compression: Optional[Literal[
compression: Literal[
"zlib",
"szip",
"zstd",
Expand All @@ -75,8 +75,9 @@ def create_variable(name: str,
"blosc_lz4hc",
"blosc_zlib",
"blosc_zstd",
]] = None,
compression_level: Optional[int] = 2) -> None
]
| None = None,
compression_level: int | None = 2) -> None
```

Create a new variable in the NetCDF file.
Expand All @@ -97,7 +98,7 @@ is set. To disable compression, set `zlib` to `False` and leave

```python
def import_dimension(dimension: nc.Dimension,
new_name: Optional[str] = None) -> None
new_name: str | None = None) -> None
```

Import a dimension from another NetCDF file.
Expand All @@ -112,7 +113,7 @@ Import a dimension from another NetCDF file.

```python
def import_variable(variable: "nc.Variable[Any]",
new_name: Optional[str] = None,
new_name: str | None = None,
zlib: bool = True,
compression_level: int = 2) -> None
```
Expand Down
4 changes: 2 additions & 2 deletions docs/agentic/modules/opus.http_interface.md
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ Read the value of a parameter.

```python
@staticmethod
def write_parameter(parameter: str, value: str | int | float) -> None
def write_parameter(parameter: str, value: str | float) -> None
```

Update the value of a parameter.
Expand Down Expand Up @@ -286,7 +286,7 @@ Set the processing mode to `COMMAND_MODE`, `EXECUTE_MODE`, or `REQUEST_MODE`.

```python
@staticmethod
def command_line(command: str) -> Optional[str]
def command_line(command: str) -> str | None
```

Execute a command line command, i.e. `COMMAND_LINE <command>`.
Expand Down
19 changes: 8 additions & 11 deletions docs/agentic/modules/plotting.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ uv add "tum_esm_utils[plotting]"
##### `apply_better_defaults`

```python
def apply_better_defaults(font_family: Optional[str] = "Roboto",
def apply_better_defaults(font_family: str | None = "Roboto",
load_system_fonts: bool = False) -> None
```

Expand All @@ -36,7 +36,7 @@ Apply better defaults to matplotlib plots.
```python
@contextlib.contextmanager
def create_figure(path: str,
title: Optional[str] = None,
title: str | None = None,
width: float = 10,
height: float = 10,
suptitle_y: float = 0.97,
Expand Down Expand Up @@ -70,9 +70,9 @@ with create_figure("path/to/figure.png", title="Title") as fig:
def add_subplot(fig: plt.Figure,
position: tuple[int, int, int]
| matplotlib.gridspec.SubplotSpec,
title: Optional[str] = None,
xlabel: Optional[str] = None,
ylabel: Optional[str] = None,
title: str | None = None,
xlabel: str | None = None,
ylabel: str | None = None,
**kwargs: Any) -> plt.Axes
```

Expand Down Expand Up @@ -114,13 +114,10 @@ add_subplot(fig, gs[0], ...)
def add_colorpatch_legend(fig: plt.Figure | matplotlib.axes.Axes,
handles: list[tuple[
str,
Union[
str,
tuple[float, float, float],
tuple[float, float, float, float],
],
str | tuple[float, float, float]
| tuple[float, float, float, float],
]],
ncols: Optional[int] = None,
ncols: int | None = None,
location: str = "upper left",
**kwargs: Any) -> None
```
Expand Down
2 changes: 1 addition & 1 deletion docs/agentic/modules/processes.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ will be used as the working directory for the process.

```python
def terminate_process(script_path: str,
termination_timeout: Optional[int] = None) -> list[int]
termination_timeout: int | None = None) -> list[int]
```

Terminate all processes that have the given script as their
Expand Down
11 changes: 5 additions & 6 deletions docs/agentic/modules/shell.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ Exception raised for errors in the command line.
```python
def run_shell_command(
command: str,
working_directory: Optional[str] = None,
executable: Optional[str] = "/bin/bash",
environment_variables: Optional[dict[str, str]] = None) -> str
working_directory: str | None = None,
executable: str | None = "/bin/bash",
environment_variables: dict[str, str] | None = None) -> str
```

runs a shell command and raises a `CommandLineException`
Expand Down Expand Up @@ -59,8 +59,7 @@ when the hostname doesn't contain a dot.
##### `get_commit_sha`

```python
def get_commit_sha(
variant: Literal["short", "long"] = "short") -> Optional[str]
def get_commit_sha(variant: Literal["short", "long"] = "short") -> str | None
```

Get the current commit sha of the repository. Returns
Expand All @@ -83,7 +82,7 @@ Get the current commit sha of the repository. Returns
def change_file_permissions(file_path: str, permission_string: str) -> None
```

Change a file's system permissions.
Change a file's Unix permissions. Available on POSIX systems only.

Example permission_strings: `--x------`, `rwxr-xr-x`, `rw-r--r--`.

Expand Down
2 changes: 1 addition & 1 deletion docs/agentic/modules/sqlitelock.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ Initialize the SqliteFileLock.
##### `acquire`

```python
def acquire(timeout: Optional[float] = None) -> None
def acquire(timeout: float | None = None) -> None
```

Acquire the lock.
Expand Down
2 changes: 1 addition & 1 deletion docs/agentic/modules/system.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ Checks the disk space of a given path.
##### `get_system_battery`

```python
def get_system_battery() -> Optional[int]
def get_system_battery() -> int | None
```

Checks the system battery.
Expand Down
Loading
Loading