Skip to content

Commit 5f6bb38

Browse files
Merge pull request #21 from ludgerpaehler/claude/plotting
Merge in miscellaneous improvements
2 parents 7a0dd3b + c6ecacd commit 5f6bb38

115 files changed

Lines changed: 3507 additions & 1559 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.claude/CLAUDE.md

Whitespace-only changes.

.github/workflows/lint.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Lint
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches: [master]
7+
8+
jobs:
9+
pre-commit:
10+
name: pre-commit hooks
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
15+
- uses: astral-sh/setup-uv@v5
16+
with:
17+
python-version: "3.10"
18+
19+
- name: Install dev dependencies
20+
run: uv sync --group dev
21+
22+
- uses: actions/cache@v4
23+
with:
24+
path: ~/.cache/pre-commit
25+
key: pre-commit-${{ hashFiles('.pre-commit-config.yaml') }}
26+
27+
- name: Run pre-commit
28+
run: uv run pre-commit run --all-files

.gitignore

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
# Ignore PyCaches
2-
src/koopmanrl/__pycache__/
3-
src/koopmanrl/environments/__pycache__/
2+
koopmanrl/__pycache__/
3+
koopmanrl/environments/__pycache__/
44
tests/__pycache__/
5+
koopmanrl_utils/movies/__pycache__/
56

67
# Ignore simulation results
78
runs/
89
saved_models/
10+
11+
# Ignore visualization outputs
12+
figures/
13+
video_frames/

.pre-commit-config.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,19 @@ repos:
1111
- id: debug-statements
1212

1313
- repo: https://github.com/astral-sh/ruff-pre-commit
14-
rev: v0.14.13
14+
rev: v0.15.7
1515
hooks:
1616
- id: ruff
1717
args: [--fix]
1818
- id: ruff-format
1919

2020
- repo: https://github.com/jendrikseipp/vulture
21-
rev: v2.14
21+
rev: v2.15
2222
hooks:
2323
- id: vulture
24-
args: [--min-confidence, "80", src/koopmanrl]
24+
args: [--min-confidence, "80", koopmanrl]
2525
- repo: https://github.com/pycqa/isort
26-
rev: 7.0.0
26+
rev: 8.0.1
2727
hooks:
2828
- id: isort
2929
name: isort (python)

AGENTS.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# KoopmanRL Agent Guide
2+
3+
Use this note as the entry point before touching the repository. It points to the canonical module guides and highlights the conventions that apply everywhere.
4+
5+
## Read First
6+
- `configurations/AGENTS.md` -
7+
- `scripts/AGENTS.md` -
8+
- `src/koopmanrl/AGENTS.md` -
9+
- `tests/AGENTS.md` -
10+
11+
## Global Conventions
12+
- Reinforcement learning core logic has to stay script-addressable through `python -m ..`.
13+
- When operations are to be parallelized, strict priority should be given to [Ray](https://github.com/ray-project/ray) for parallelization.
14+
- Outside of hyperparameter optimization, prefer a CleanRL single file-style syntax
15+
16+
## Repository Layout
17+
```
18+
configurations/ best hyperparameter configurations for the algorithms as JSON files
19+
scripts/ utility scripts which reproduce the results from the paper
20+
src/koopmanrl/ core library including the two subfolders environments/, and koopman_tensor/
21+
tests/ regression tests and unit tests for the library's core functionality
22+
```
23+
24+
## Working Checklist
25+
1. Review the relevant AGENTS guide(s) and existing tests/examples for the feature you touch.
26+
2. Prototype changes in modules or helper scripts—avoid interactive REPL work.
27+
3. Add or update targeted tests (`tests/test_*.py`) alongside code changes.
28+
4. Run the scoped pytest command (`uv run test -m ...`) before submitting.
29+
5. Keep documentation edits minimal and aligned with the per-module format.

CITATION.cff

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
cff-version: 1.2.0
2+
message: "If you use this software, please cite it as below."
3+
type: software
4+
title: "KoopmanRL: Koopman-Assisted Reinforcement Learning"
5+
version: 1.0.0
6+
date-released: 2026-04-20
7+
authors:
8+
- family-names: Paehler
9+
given-names: Ludger
10+
email: ludger.paehler@tum.de
11+
affiliation: Technical University of Munich
12+
orcid: "https://orcid.org/0000-0002-7200-7637"
13+
- family-names: Rozwood
14+
given-names: Preston
15+
email: pwr@cornell.edu
16+
affiliation: Cornell University
17+
orcid: "https://orcid.org/0009-0007-3589-3514"
18+
- family-names: Mehrez
19+
given-names: Edward J.
20+
email: ejm322@cornell.edu
21+
affiliation: Cornell University
22+
- family-names: Wen
23+
given-names: Sun
24+
email: ws455@cornell.edu
25+
affiliation: Cornell University
26+
- family-names: Brunton
27+
given-names: Steven L.
28+
email: sbrunton@uw.edu
29+
affiliation: University of Washington
30+
orcid: "https://orcid.org/0000-0002-6565-5118"
31+
repository-code: "https://github.com/dynamicslab/koopmanrl"
32+
url: "https://github.com/dynamicslabs/koopmanrl"
33+
abstract: >
34+
KoopmanRL is a reinforcement learning framework which utilizes the
35+
Koopman operator to enhance maximum entropy-based reinforcement
36+
learning algorithms at the example of the discrete value iteration,
37+
and the Soft actor-critic algorithm. This package accompanies the
38+
paper "Koopman-Assisted Reinforcement Learning" providing the
39+
CleanRL-style implementations of the algorithms, and the hyperparameter
40+
tuning harnesses to tune the algorithms on new environments.
41+
keywords:
42+
- reinforcement learning
43+
- Koopman operator
44+
- PyTorch
45+
- machine learning
46+
license: MIT
47+
references:
48+
- type: journal-paper
49+
title: "Koopman-Assisted Reinforcement Learning"
50+
journal:
51+
name: "tbd"
52+
year: 2026
53+
authors:
54+
- family-names: Rozwood
55+
given-names: Preston
56+
orcid: "https://orcid.org/0009-0007-3589-3514"
57+
- family-names: Mehrez
58+
given-names: Edward J.
59+
- family-names: Paehler
60+
given-names: Ludger
61+
orcid: "https://orcid.org/0000-0002-7200-7637"
62+
- family-names: Wen
63+
given-names: Sun
64+
- family-names: Brunton
65+
given-names: Steven L.
66+
orcid: "https://orcid.org/0000-0002-6565-5118"

0 commit comments

Comments
 (0)