Skip to content
Draft
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
32 changes: 32 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Lint

on:
push:
branches: [public]
pull_request:
branches:
- public
- '*'
workflow_dispatch:

jobs:
ruff:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
cache: "pip"
cache-dependency-path: pyproject.toml

- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install .[dev]

- name: Ruff check
run: make lint
32 changes: 32 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Tests

on:
push:
branches: [public]
pull_request:
branches:
- public
- '*'
workflow_dispatch:

jobs:
pytest:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
cache: "pip"
cache-dependency-path: pyproject.toml

- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install .[dev]

- name: Run pytest
run: pytest --ignore cd_dynamax/dynamax
11 changes: 11 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
.PHONY: lint test

clean:
ruff format --exclude cd_dynamax/dynamax --exclude "**/*.ipynb" .
ruff check --exclude cd_dynamax/dynamax --exclude "**/*.ipynb" . --fix

lint:
ruff check . --exclude cd_dynamax/dynamax --exclude "**/*.ipynb"

test:
pytest --ignore cd_dynamax/dynamax
8 changes: 2 additions & 6 deletions cd_dynamax/src/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,31 +28,27 @@
### SSM classes ###
"ContDiscreteNonlinearGaussianSSM",
"ContDiscreteLinearGaussianSSM",

"SSM",
"Prior",
### Param classes ###
"ParamsCDNLGSSM",
"ParamsCDLGSSM",

### Non-linear filters/smoothers/forecasters ###
"cdnlgssm_filter",
"cdnlgssm_smoother",
"cdnlgssm_forecast",
"cdnlgssm_emissions",

# Non-linear filtering Hyperparams
"EKFHyperParams",
"UKFHyperParams",
"EnKFHyperParams",

### Linear filters/smoothers/forecasters/samplers ###
"cdlgssm_filter",
"cdlgssm_smoother",
"cdlgssm_forecast",
"cdlgssm_emissions",
"cdlgssm_posterior_sample",
"cdlgssm_joint_sample",

# Linear filtering Hyperparams (typically don't need to use these directly, can rely on default KFHyperParams)
"KFHyperParams",

]
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,17 @@
from .inference import cdlgssm_emissions
from .inference import cdlgssm_posterior_sample
from .inference import cdlgssm_joint_sample
from .inference import KFHyperParams
from .inference import KFHyperParams

__all__ = [
"ParamsCDLGSSM",
"ParamsCDLGSSMDynamics",
"ContDiscreteLinearGaussianSSM",
"cdlgssm_filter",
"cdlgssm_smoother",
"cdlgssm_forecast",
"cdlgssm_emissions",
"cdlgssm_posterior_sample",
"cdlgssm_joint_sample",
"KFHyperParams",
]
Loading