Skip to content

Commit d5db1b5

Browse files
Merge pull request #1 from S-FM/feat/new-version
added new model and new error contract
2 parents 4f3a6ae + cdf6fd1 commit d5db1b5

30 files changed

+7689
-1070
lines changed

.github/workflows/lint.yml

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
name: Lint
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
ruff:
11+
name: Ruff (Linter & Formatter)
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout code
15+
uses: actions/checkout@v4
16+
17+
- name: Set up Python
18+
uses: actions/setup-python@v5
19+
with:
20+
python-version: "3.11"
21+
22+
- name: Install Ruff
23+
run: pip install ruff
24+
25+
- name: Run Ruff linter
26+
run: ruff check .
27+
28+
- name: Run Ruff formatter check
29+
run: ruff format --check .
30+
31+
type-check:
32+
name: Type Checking (mypy)
33+
runs-on: ubuntu-latest
34+
steps:
35+
- name: Checkout code
36+
uses: actions/checkout@v4
37+
38+
- name: Set up Python
39+
uses: actions/setup-python@v5
40+
with:
41+
python-version: "3.11"
42+
43+
- name: Install uv
44+
uses: astral-sh/setup-uv@v3
45+
with:
46+
version: "latest"
47+
48+
- name: Install dependencies
49+
run: |
50+
uv pip install --system -e .
51+
uv pip install --system mypy types-requests
52+
53+
- name: Run mypy
54+
run: mypy faim_sdk/ --ignore-missing-imports --no-strict-optional
55+
continue-on-error: true
56+
57+
package-check:
58+
name: Package Build Check
59+
runs-on: ubuntu-latest
60+
steps:
61+
- name: Checkout code
62+
uses: actions/checkout@v4
63+
64+
- name: Set up Python
65+
uses: actions/setup-python@v5
66+
with:
67+
python-version: "3.11"
68+
69+
- name: Install build dependencies
70+
run: pip install poetry build twine
71+
72+
- name: Build package
73+
run: poetry build
74+
75+
- name: Check package with twine
76+
run: twine check dist/*
77+
78+
- name: Verify package contents
79+
run: |
80+
tar -tzf dist/*.tar.gz | grep -E "faim_sdk|faim_client"
81+
unzip -l dist/*.whl | grep -E "faim_sdk|faim_client"

.github/workflows/test.yml

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
name: Test
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
test:
11+
name: Test Python ${{ matrix.python-version }}
12+
runs-on: ubuntu-latest
13+
if: false # Tests temporarily disabled
14+
strategy:
15+
fail-fast: false
16+
matrix:
17+
python-version: ["3.11", "3.12"]
18+
19+
steps:
20+
- name: Checkout code
21+
uses: actions/checkout@v4
22+
23+
- name: Set up Python ${{ matrix.python-version }}
24+
uses: actions/setup-python@v5
25+
with:
26+
python-version: ${{ matrix.python-version }}
27+
28+
- name: Install uv
29+
uses: astral-sh/setup-uv@v3
30+
with:
31+
version: "latest"
32+
33+
- name: Install dependencies
34+
run: |
35+
uv pip install --system -e .
36+
uv pip install --system pytest pytest-cov pytest-asyncio
37+
38+
- name: Run unit tests
39+
run: |
40+
pytest tests/unit/ -v --cov=faim_sdk --cov=faim_client --cov-report=xml --cov-report=term
41+
42+
- name: Upload coverage to Codecov
43+
uses: codecov/codecov-action@v4
44+
if: matrix.python-version == '3.11'
45+
with:
46+
file: ./coverage.xml
47+
fail_ci_if_error: false
48+
token: ${{ secrets.CODECOV_TOKEN }}
49+
50+
test-examples:
51+
name: Test Examples
52+
runs-on: ubuntu-latest
53+
if: false # Tests temporarily disabled
54+
steps:
55+
- name: Checkout code
56+
uses: actions/checkout@v4
57+
58+
- name: Set up Python 3.11
59+
uses: actions/setup-python@v5
60+
with:
61+
python-version: "3.11"
62+
63+
- name: Install uv
64+
uses: astral-sh/setup-uv@v3
65+
with:
66+
version: "latest"
67+
68+
- name: Install dependencies with viz extras
69+
run: |
70+
uv pip install --system -e ".[viz]"
71+
uv pip install --system jupyterlab pandas statsmodels
72+
73+
- name: Check example notebooks can be read
74+
run: |
75+
python -c "import nbformat; nbformat.read('examples/flowstate_simple_example.ipynb', as_version=4)"
76+
python -c "import nbformat; nbformat.read('examples/model_comparison_example.ipynb', as_version=4)"
77+
python -c "import nbformat; nbformat.read('examples/model_comparison_simple.ipynb', as_version=4)"
78+
79+
- name: Verify eval package imports
80+
run: |
81+
python -c "from faim_sdk.eval import mse, mase, crps_from_quantiles, plot_forecast; print('Eval imports successful')"

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,5 @@ dmypy.json
2424

2525
openapi.json
2626
pyproject.toml
27-
CLAUDE.md
27+
CLAUDE.md
28+
/poetry.lock

0 commit comments

Comments
 (0)