Skip to content

Commit 9efd51a

Browse files
committed
Update boilerplate, ty not fixed yet.
1 parent 968d8a5 commit 9efd51a

File tree

8 files changed

+35
-20179
lines changed

8 files changed

+35
-20179
lines changed

.ai-instructions

Submodule .ai-instructions added at 413e9ba

.github/workflows/main.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ jobs:
2323
cache: true
2424
cache-write: ${{ github.event_name == 'push' && github.ref_name == 'main' }}
2525
frozen: true
26-
environments: py314
26+
environments: type-checking
2727
- name: Run ty
28-
run: pixi run -e py314 ty
28+
run: pixi run -e type-checking ty
2929
shell: bash -el {0}
3030
run-tests:
3131
name: Run tests for ${{ matrix.os }} on ${{ matrix.environment }}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ docs/_build/
2929

3030
# pixi
3131
.pixi/
32+
node_modules/
3233

3334
# Python
3435
__pycache__/

.gitmodules

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[submodule ".ai-instructions"]
2+
path = .ai-instructions
3+
url = git@github.com:OpenSourceEconomics/ai-instructions.git
4+
branch = make-submodule

.pre-commit-config.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ repos:
2929
- id: fix-byte-order-marker
3030
types:
3131
- text
32-
- id: forbid-submodules
3332
- id: mixed-line-ending
3433
args:
3534
- --fix=lf
@@ -78,7 +77,7 @@ repos:
7877
args:
7978
- --wrap
8079
- '88'
81-
files: (CLAUDE\.md|README\.md)
80+
files: (AGENTS\.md|CLAUDE\.md|README\.md|modules/.*\.md|profiles/.*\.md)
8281
- repo: https://github.com/executablebooks/mdformat
8382
rev: 1.0.0
8483
hooks:

CLAUDE.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
@.ai-instructions/profiles/tier-a.md @.ai-instructions/modules/jax.md
2+
13
# CLAUDE.md
24

35
This file provides guidance to Claude Code (claude.ai/code) when working with code in
@@ -27,7 +29,7 @@ pixi run -e py314-jax tests src/gettsim/tests_germany/test_policy_cases.py
2729
pixi run -e py314-jax tests -k "kindergeld"
2830

2931
# Type checking
30-
pixi run -e py314-jax ty
32+
pixi run -e type-checking ty
3133

3234
# Quality checks (linting, formatting)
3335
pixi run prek run --all-files
@@ -39,7 +41,7 @@ pixi run docs
3941
Before finishing any task that modifies code, always run these three verification steps
4042
in order:
4143

42-
1. `pixi run -e py314-jax ty` (type checker)
44+
1. `pixi run -e type-checking ty` (type checker)
4345
1. `pixi run prek run --all-files` (quality checks: linting, formatting, yaml, etc.)
4446
1. `pixi run -e py314-jax tests -n 7` (full test suite)
4547

pixi.lock

Lines changed: 0 additions & 20158 deletions
This file was deleted.

pyproject.toml

Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,10 @@ metadata.allow-direct-references = true
6363
version.source = "vcs"
6464

6565
[tool.ruff]
66-
target-version = "py311" # Replace by [project] requires-python = ">=3.11" above
6766
fix = true
6867
unsafe-fixes = false
6968
[tool.ruff.lint]
7069
select = [ "ALL" ]
71-
exclude = []
7270
extend-ignore = [
7371
"COM812", # Avoid conflicts with ruff-format
7472
# Ignored during transition phase
@@ -82,6 +80,9 @@ extend-ignore = [
8280
"FIX002", # Line contains TODO -- Use stuff from TD area.
8381
"ICN001", # numpy should be np, but different convention here.
8482
"ISC001", # Avoid conflicts with ruff-format
83+
"TC001", # Move application import into a type-checking block
84+
"TC002", # Move third-party import into a type-checking block
85+
"TC003", # Move standard library import into a type-checking block
8586
"N999", # Allow non-ASCII characters in file names.
8687
"PLC2401", # Allow non-ASCII characters in variable names.
8788
"PLC2403", # Allow non-ASCII function names for imports.
@@ -149,7 +150,8 @@ expand_tables = [
149150
"tool.pixi.feature.tests.target.osx-64.tasks",
150151
"tool.pixi.feature.tests.target.osx-arm64.tasks",
151152
"tool.pixi.feature.tests.target.win-64.tasks",
152-
"tool.pixi.feature.tests.tasks",
153+
"tool.pixi.feature.type-checking.pypi-dependencies",
154+
"tool.pixi.feature.type-checking.tasks",
153155
"tool.pixi.pypi-dependencies",
154156
"tool.pixi.tasks",
155157
"tool.pixi.workspace",
@@ -178,7 +180,9 @@ ini_options.norecursedirs = [ "docs" ]
178180
ini_options.testpaths = [ "src/gettsim/tests_germany" ]
179181

180182
[tool.ty]
181-
overrides = [ { include = [ "docs/**" ], rules.unresolved-attribute = "ignore" } ]
183+
overrides = [
184+
{ include = [ "docs/**" ], rules.unresolved-attribute = "ignore" },
185+
]
182186
rules.invalid-return-type = "ignore"
183187
rules.ambiguous-protocol-member = "error"
184188
rules.deprecated = "error"
@@ -213,12 +217,13 @@ snakeviz = ">=2.2.2"
213217
tabulate = "*"
214218
toml = "*"
215219
[tool.pixi.environments]
216-
py311 = [ "tests", "py311" ]
217-
py312 = [ "tests", "py312" ]
218-
py313 = [ "tests", "py313" ]
219-
py314 = [ "tests", "py314" ]
220-
py314-jax = [ "py314", "tests", "jax" ]
220+
py311 = [ "py311", "tests" ]
221+
py312 = [ "py312", "tests" ]
222+
py313 = [ "py313", "tests" ]
223+
py314 = [ "py314", "tests" ]
221224
py314-cuda = [ "py314", "tests", "cuda" ]
225+
py314-jax = [ "py314", "tests", "jax" ]
226+
type-checking = [ "py314", "type-checking" ]
222227
py314-metal = [ "py314", "tests", "metal" ]
223228
docs = [ "docs", "py313" ]
224229
[tool.pixi.feature.cuda]
@@ -227,7 +232,7 @@ system-requirements = { cuda = "13" }
227232
[tool.pixi.feature.cuda.target.linux-64.pypi-dependencies]
228233
jax = { version = ">=0.8", extras = [ "cuda13" ] }
229234
[tool.pixi.feature.cuda.tasks]
230-
tests-jax = "pytest --backend=jax"
235+
tests-cuda = "pytest --backend=jax"
231236
[tool.pixi.feature.docs.dependencies]
232237
myst-parser = "*"
233238
nbsphinx = "*"
@@ -238,7 +243,6 @@ sphinx-copybutton = "*"
238243
[tool.pixi.feature.docs.pypi-dependencies]
239244
gettsim = { path = ".", editable = true }
240245
gettsim-personas = { git = "https://github.com/ttsim-dev/gettsim-personas.git", branch = "boilerplate" }
241-
ttsim-backend = { git = "https://github.com/ttsim-dev/ttsim.git", branch = "refactor-piecewise-polynomial" }
242246
[tool.pixi.feature.docs.target.linux-64.tasks]
243247
docs = "sphinx-build -T -b html docs docs/_build/html"
244248
[tool.pixi.feature.docs.target.osx-64.tasks]
@@ -276,9 +280,6 @@ pytest-cov = "*"
276280
pytest-profiling = "*"
277281
pytest-xdist = "*"
278282
gettsim-personas = { git = "https://github.com/ttsim-dev/gettsim-personas.git", branch = "main" }
279-
ty = "*"
280-
types-PyYAML = "*"
281-
types-pytz = "*"
282283
[tool.pixi.feature.tests.target.linux-64.tasks]
283284
tests = "pytest"
284285
[tool.pixi.feature.tests.target.osx-64.tasks]
@@ -288,13 +289,19 @@ tests = "dot -c && pytest" # dot -c needed for pygraphviz on macOS
288289
[tool.pixi.feature.tests.target.win-64.tasks]
289290
tests = "pytest"
290291
[tool.pixi.feature.tests.tasks]
292+
[tool.pixi.feature.type-checking.pypi-dependencies]
293+
ty = "*"
294+
types-PyYAML = "*"
295+
types-pytz = "*"
296+
[tool.pixi.feature.type-checking.tasks]
291297
ty = "ty check"
292298
[tool.pixi.pypi-dependencies]
293299
gettsim = { path = ".", editable = true }
294-
ttsim-backend = { git = "https://github.com/ttsim-dev/ttsim.git", branch = "refactor-piecewise-polynomial" }
295300
jaxtyping = ">=0.3.2"
296301
kaleido = ">=1.0.0"
297302
pdbp = ">=1.7.1"
303+
dags = ">=0.5"
304+
ttsim-backend = { git = "https://github.com/ttsim-dev/ttsim.git", branch = "refactor-piecewise-polynomial" }
298305
[tool.pixi.workspace]
299306
channels = [ "conda-forge" ]
300307
platforms = [ "linux-64", "osx-64", "osx-arm64", "win-64" ]

0 commit comments

Comments
 (0)