Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
71e9d59
Refactor model configuration to use frozen dataclasses instead of dicts
hmgaudecker Jan 8, 2026
7766672
Use frozendict for immutable dict fields in dataclasses
hmgaudecker Jan 8, 2026
562cfaa
Ignore ty false positive.
hmgaudecker Jan 8, 2026
4d2c271
Return ProcessedModel dataclass from process_model() instead of dict
hmgaudecker Jan 8, 2026
264016c
Rename FactorEndogenousInfo to FactorInfo
hmgaudecker Jan 9, 2026
3bb334b
Ensure complete typing in src/skillmodels.
hmgaudecker Jan 9, 2026
e2d687a
Require Python 3.14 before fixing type annotations.
hmgaudecker Jan 9, 2026
921c612
Move TESTS_DIR -> TEST_DATA_DIR, which points to a subdirectory of sr…
hmgaudecker Jan 9, 2026
dce66ad
Fix more linting issues.
hmgaudecker Jan 9, 2026
e0f59d0
Make ruff rules much stricter.
hmgaudecker Jan 9, 2026
b15372a
Further tighten type annotations. Fix a missing run-time annotation o…
hmgaudecker Jan 11, 2026
74b2f18
Move unsafe_fixes = false from .pre-commit config to pyproject.
hmgaudecker Jan 11, 2026
04aaa10
Fix query in data simulation.
hmgaudecker Jan 12, 2026
493ead0
More fixes to imports, add test.
hmgaudecker Jan 12, 2026
51209ad
Use more tuples in place of lists to prevent errors.
hmgaudecker Jan 12, 2026
21da176
Fix typing.
hmgaudecker Jan 12, 2026
5925303
Dataclasses for user input.
hmgaudecker Jan 19, 2026
9590c46
Simplify.
hmgaudecker Jan 21, 2026
69f6eab
Use modern rng everywhere.
hmgaudecker Jan 28, 2026
f8dac75
Update CLAUDE.md
hmgaudecker Jan 28, 2026
846534b
Get rid of if TYPE_CHECKING blocks
hmgaudecker Jan 28, 2026
97d84b8
Update hooks and clean up
hmgaudecker Jan 28, 2026
b8a9fbc
Call by name throughout.
hmgaudecker Jan 29, 2026
5012a8b
Autogenerated docs, harmonised hooks / project configuration.
hmgaudecker Jan 29, 2026
7e7784e
Get rid of model_dict.
hmgaudecker Jan 29, 2026
6934f79
Replace yaml model specifications by ModelSpec-s.
hmgaudecker Jan 30, 2026
7cf471a
Next shot at fixing pickling.
hmgaudecker Feb 1, 2026
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
144 changes: 36 additions & 108 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,124 +1,52 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
*.egg
*.egg-info/
*.manifest
*.spec
.eggs/
.installed.cfg
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
MANIFEST
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST
*build/

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec
*.sublime-workspace
*.sublime-project

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
.hypothesis/
.pytest_cache/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
# Documentation
docs/_build/
_build/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# pyenv
.python-version

# celery beat schedule file
celerybeat-schedule

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site
# IDE
.idea/
.vscode/

# mypy
.mypy_cache/
# Jupyter
.ipynb_checkpoints/

*notes/
# macOS
.DS_Store

.idea/
# pixi
.pixi/

*.bak
# Python
__pycache__/
*.py[cod]
*.so
*$py.class

# Ruff
.ruff_cache/

*.db
# Testing
.cache/
.coverage
.coverage.*
.hypothesis/
.pytest_cache/
coverage.xml
htmlcov/

# Version file (generated by hatch-vcs)
src/*/_version.py

mixed_documents/
src/skillmodels/_version.py
.pixi
.vscode
*.py.*.bin
*.py.*.html
.claude
41 changes: 22 additions & 19 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ repos:
hooks:
- id: check-hooks-apply
- id: check-useless-excludes
# - id: identity # Prints all files passed to pre-commits. Debugging.
- repo: https://github.com/tox-dev/tox-toml-fmt
rev: v1.2.2
hooks:
- id: tox-toml-fmt
- repo: https://github.com/lyz-code/yamlfix
rev: 1.19.1
hooks:
Expand All @@ -15,53 +18,51 @@ repos:
- id: check-added-large-files
args:
- --maxkb=50000
- id: check-ast
- id: check-case-conflict
- id: check-docstring-first
- id: check-merge-conflict
- id: check-toml
- id: check-vcs-permalinks
- id: check-yaml
- id: check-toml
- id: debug-statements
- id: end-of-file-fixer
- id: fix-byte-order-marker
types:
- text
- id: forbid-submodules
- id: mixed-line-ending
args:
- --fix=lf
description: Forces to replace line ending by the UNIX 'lf' character.
- id: name-tests-test
args:
- --pytest-test-first
- id: no-commit-to-branch
args:
- --branch
- main
- id: name-tests-test
args:
- --pytest-test-first
- id: trailing-whitespace
- id: check-ast
- id: check-docstring-first
- repo: https://github.com/adrienverge/yamllint.git
rev: v1.37.1
rev: v1.38.0
hooks:
- id: yamllint
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.14.10
rev: v0.14.14
hooks:
- id: ruff-check
types_or:
- python
- pyi
- jupyter
args:
- --fix
# - --unsafe-fixes
- id: ruff-format
types_or:
- python
- jupyter
- pyi
- python
- id: ruff-format
types_or:
- jupyter
- pyi
- python
- repo: https://github.com/kynan/nbstripout
rev: 0.8.2
rev: 0.9.0
hooks:
- id: nbstripout
args:
Expand All @@ -72,10 +73,12 @@ repos:
hooks:
- id: mdformat
additional_dependencies:
- mdformat-myst
- mdformat-gfm
- mdformat-gfm-alerts
- mdformat-ruff
args:
- --wrap
- '88'
files: (CLAUDE\.md|README\.md)
ci:
autoupdate_schedule: monthly
20 changes: 20 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
version: 2
build:
os: ubuntu-24.04
tools:
python: '3.14'
nodejs: '22'
jobs:
create_environment:
- asdf plugin add pixi
- asdf install pixi latest
- asdf global pixi latest
install:
- pixi install -e docs
post_build:
# Jupyter Book 2.0 builds site content to _build/html.
# For ReadTheDocs, we build and then copy to the expected output location.
- mkdir --parents $READTHEDOCS_OUTPUT/html/
- BASE_URL="/$READTHEDOCS_LANGUAGE/$READTHEDOCS_VERSION" pixi run -e docs docs
- cp -a docs/_build/html/. "$READTHEDOCS_OUTPUT/html" && rm -r docs/_build
15 changes: 9 additions & 6 deletions .yamllint.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
---
yaml-files:
- '*.yaml'
- '*.yml'
- .yamllint
rules:
braces: enable
brackets: enable
Expand All @@ -23,14 +19,21 @@ rules:
key-duplicates: enable
key-ordering: disable
line-length:
max: 88
allow-non-breakable-inline-mappings: true
allow-non-breakable-words: true
allow-non-breakable-inline-mappings: false
max: 88
new-line-at-end-of-file: enable
new-lines:
type: unix
octal-values: disable
quoted-strings: disable
trailing-spaces: enable
truthy:
check-keys: false
level: warning
yaml-files:
- '*.yaml'
- '*.yml'
- .yamllint
ignore:
- src/skillmodels/test_data/simplest_augmented_model.yaml
29 changes: 25 additions & 4 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,29 @@ pixi run -e test-cpu pytest tests/test_kalman_filters.py::test_function_name
# Type checking
pixi run ty

# Install pre-commit hooks (required before committing)
pre-commit install
# Quality checks (linting, formatting)
prek run --all-files

# Build documentation (from docs/ directory)
make html
```

## Command Rules

Always use these command mappings:

- **Python**: Use `pixi run python` instead of `python` or `python3`
- **Type checker**: Use `pixi run ty` instead of running ty/mypy/pyright directly
- **Tests**: Use `pixi run tests` instead of `pytest` directly
- **Linting/formatting**: Use `prek run --all-files` instead of `ruff` directly
- **All quality checks**: Use `prek run --all-files`

Before finishing any task that modifies code, always run:

1. `pixi run ty` (type checker)
1. `pixi run tests` (tests)
1. `prek run --all-files` (quality checks)

## Architecture

### Core Pipeline Flow
Expand Down Expand Up @@ -82,14 +98,19 @@ The main package exports three functions:

- `get_maximization_inputs()`: Prepare optimization problem for parameter estimation
- `get_filtered_states()`: Extract filtered latent factor estimates
- `simulate_dataset()`: Generate synthetic data from model specification
- `simulate_dataset()`: Generate synthetic data from model specification (accepts
optional `seed` parameter for reproducibility)

## Code Style

- Uses Ruff for linting (target: Python 3.13, line length: 88)
- Require Python 3.14
- Uses Ruff for linting (target: Python 3.14, line length: 88)
- Google-style docstrings
- Pre-commit hooks enforce formatting and linting
- Type checking via `ty` with strict rules
- Do not use `from __future__ import annotations`
- Use modern numpy random API: `rng = np.random.default_rng(seed)` instead of
`np.random.seed()` or legacy functions like `np.random.randn()`

## Testing

Expand Down
Loading