diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 300ac347..a20fda26 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,20 +1,15 @@ -ci: - autoupdate_schedule: quarterly - -default_stages: [pre-commit] - default_install_hook_types: [pre-commit, commit-msg] repos: - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.11.13 + rev: v0.14.4 hooks: - id: ruff-check args: [--fix] - id: ruff-format - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v5.0.0 + rev: v6.0.0 hooks: - id: check-case-conflict - id: check-symlinks @@ -40,3 +35,11 @@ repos: # MD041: first line in a file should be a top-level heading # MD034: bare URL used args: [--disable, MD013, MD033, MD041, MD034, '--'] + + - repo: local + hooks: + - id: ty + name: ty check + entry: ty check + language: python + additional_dependencies: [ty, torch, ase, mace-torch] diff --git a/examples/scripts/7_Others/7.4_Velocity_AutoCorrelation.py b/examples/scripts/7_Others/7.4_Velocity_AutoCorrelation.py index cdd91264..9b8b4462 100644 --- a/examples/scripts/7_Others/7.4_Velocity_AutoCorrelation.py +++ b/examples/scripts/7_Others/7.4_Velocity_AutoCorrelation.py @@ -93,7 +93,7 @@ def main() -> None: num_steps = 15000 # NOTE: short run for step in range(num_steps): - state = ts.nve_step(state=state, model=lj_model, dt=dt) # type: ignore[call-arg] + state = ts.nve_step(state=state, model=lj_model, dt=dt) reporter.report(state, step) reporter.close() diff --git a/examples/tutorials/low_level_tutorial.py b/examples/tutorials/low_level_tutorial.py index eb8d63ed..944696e4 100644 --- a/examples/tutorials/low_level_tutorial.py +++ b/examples/tutorials/low_level_tutorial.py @@ -67,12 +67,12 @@ model=MaceUrls.mace_mpa_medium, return_raw_model=True, default_dtype=str(dtype).removeprefix("torch."), - device=device, + device=str(device), ) # wrap the mace_mp model in the MaceModel class model = MaceModel( - model=loaded_model, + model=loaded_model, # type: ignore[arg-type] device=device, compute_forces=True, compute_stress=True, diff --git a/pyproject.toml b/pyproject.toml index 850f35b6..c4785295 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -57,11 +57,11 @@ fairchem = ["fairchem-core>=2.7"] docs = [ "autodoc_pydantic==2.2.0", "furo==2024.8.6", - "ipython==8.34.0", "ipykernel==6.30.1", + "ipython==8.34.0", "jsonschema[format]", - "jupyterlab==4.3.4", "jupyter-core==5.8.1", + "jupyterlab==4.3.4", "jupytext==1.16.7", "myst_parser==4.0.0", "nbsphinx>=0.9.7", @@ -145,27 +145,27 @@ conflicts = [ ], [ { extra = "fairchem" }, - { extra = "mace" }, + { extra = "graphpes" }, ], [ - { extra = "graphpes" }, - { extra = "mattersim" }, + { extra = "fairchem" }, + { extra = "mace" }, ], [ - { extra = "graphpes" }, - { extra = "sevenn" }, + { extra = "fairchem" }, + { extra = "mace" }, ], [ { extra = "graphpes" }, - { extra = "fairchem" }, + { extra = "mattersim" }, ], [ { extra = "graphpes" }, { extra = "nequip" }, ], [ - { extra = "fairchem" }, - { extra = "mace" }, + { extra = "graphpes" }, + { extra = "sevenn" }, ], [ { extra = "mace" }, @@ -182,15 +182,13 @@ conflicts = [ ] [dependency-groups] -dev = ["prek>=0.2.0", "ty>=0.0.1a20"] +dev = ["prek>=0.2.13", "ty>=0.0.1a25"] [tool.ty.rules] -# TODO: Unable to work with **kwargs: https://github.com/astral-sh/ty/issues/247 -missing-argument = "ignore" +unused-ignore-comment = "warn" [[tool.ty.overrides]] include = ["tests/models/**/*.py", "torch_sim/models/**/*.py"] -# TODO would be nice to only ignore unresolved model imports but fail on all other packages [tool.ty.overrides.rules] unresolved-import = "ignore"