Conversation
|
Didn't know this tool, nice to have. But there is a large amount of work to make ty happy with the current code |
|
I support adding |
|
MACE finally released v0.3.15 so I'd say this is ready to move forward on |
244a1d5 to
5f03350
Compare
|
@orionarcher set a bunch of agents to work on this and coarsely reviewed their changes. looks good for a start but can definitely be polished. short on time for that. if anyone wants to have a go at that feel free to push to this branch! this will get blocked by merge conflicts quickly |
across core, models, neighbors, tests, ...
5f03350 to
6331f79
Compare
- Consolidate repeated model kwargs construction in model tests - Simplify example/tutorial guard code while keeping runtime checks - Reuse calculate_momenta and SimState coercion patterns in NVE/NVT/NPT init paths
|
This looks broadly good! I am (CC is) gonna take a swing at this from scratch and see if I can get it to touch fewer LOC. It looks like its changing a decent amount of logic in addition to type signatures and I am curious if that is avoidable. |
|
bit more context: started out with 670 type errors. agents bringing that down to 0 even with some hacks like ignoring a few important rules and files is a win. we can always reduce bad config in subsequent PRs as time permits. but would good to have type checking on the rest of code base if claude can bring the type error count to 0 with fewer changes, i'm all for it! |
- consolidate repeated state coercion and system index checks into shared helpers - simplify integrator and optimizer initialization/update paths without behavior changes - de-duplicate noisy test/tutorial patterns while preserving coverage and tolerances fix tests
- fix docs tutorial plotting by detaching tensor data before matplotlib conversion - restore deterministic no-seed rattle behavior used by optimizer regression fixtures - keep FIRE behavior aligned while preserving ty-safe typing adjustments - correct mixed-PBC density scaling path in autobatching and add regression coverage
- fix mixed-PBC memory scaler handling and tighten variable naming in autobatching - restore public NPT C-rescale float-or-tensor signatures with explicit tensor coercion at step call sites - add focused tests for degree-of-freedom counting, initialize_state invalid inputs, and neighbor-list empty-output behavior - simplify neighbor coverage by folding standard_nl into shared ASE-equivalence/edge-case parametrized tests - align neighbor backend docstring fallback order with actual runtime selection
@orionarcher how did it go? meantime, i applied some manual polish to the agent edits, mostly aiming to cut any bloat and AI slop (see e8a4cfa, e16893a, ff3bc7b). that worked in the sense that the diff line count in actual code files went down quite a bit. sadly i kept coming across what i think are bugs. i fixed them and added new tests to prevent future regressions. the tests in particular increased the net line count, despite my attempts to cut bloat but useful enough to warrant the lines imo:
|
- guard AtomConstraint/SystemConstraint.merge against empty or mismatched inputs with clear ValueError instead of torch.cat runtime failures - add regression tests for constraint merge edge cases and empty bin-packing inputs - accept float inputs in NPT Nose-Hoover step with explicit tensor coercion - refactor NPT C-rescale step parameter coercion into a shared helper to reduce duplication - harden autobatching binning for empty iterables and tuple-list key reconstruction
- coerce anisotropic NPT c-rescale step inputs via the shared helper for float/tensor consistency - restore ASE LBFGS test logfile to None to avoid noisy stdout in CI - clarify empty dict coverage in autobatching test as intentional API behavior
pyproject.toml
Outdated
| io = ["ase>=3.26", "phonopy>=2.37.0", "pymatgen>=2025.6.14"] | ||
| symmetry = ["moyopy>=0.3", "spglib>=2.6"] | ||
| symmetry = ["moyopy>=0.3"] | ||
| mace = ["mace-torch>=0.3.14"] |
There was a problem hiding this comment.
We should probably pin mace to 0.3.15, I suspect ty will fail with earlier versions. It occurs to me that while we are running the tests with lowest and highest deps, I don't think we are doing the same for linting.
torch-sim/.pre-commit-config.yaml Line 46 in d81bbf1 |
- add shared state.pbc_to_tensor helper and use it across model backends - align NVT/NPT integrator calls with velocity_verlet_step and simplify dt handling - improve safety in trajectory append node typing and expose ParticleLife beta parameter
| ) | ||
| self.epsilon = torch.tensor(epsilon, dtype=self.dtype, device=self.device) | ||
| self.beta = torch.tensor(0.3, dtype=self.dtype, device=self.device) | ||
| self.beta = torch.tensor(beta, dtype=self.dtype, device=self.device) |
There was a problem hiding this comment.
was beta hard-coded for a reason? maybe @abhijeetgangan?
- add duecredit citations and scalar-or-tensor coercion across NVT/NPT/NVE integrator steps - centralize PBC normalization via state.pbc_to_tensor and apply it across model adapters - remove neighbors __all__ export list and improve SimState/coerce_prng doc safety
|
@CompRhys just noticed agents had removed the NVT integrators (
NPT integrators (
thanks for adding those! 👍 |
- derive VESIN_AVAILABLE from VesinNeighborList is not None instead of separate bool flag set in try/except - remove __all__ from vesin.py and graphpes.py per project rules - bump prek and ty dev dependency versions
- remove deprecated, invalid-assignment, not-subscriptable, possibly-missing-attribute, unsupported-operator from tests override (0 errors each or fixed inline) - add ty: ignore[deprecated] to pbc_wrap_general test call sites - add system_idx None guards in test_constraints and test_monte_carlo - remove stale ty: ignore comments in hybrid_swap_tutorial - rename ft -> tst import alias in test_transforms
- delete pbc_wrap_general (deprecated in favor of wrap_positions) and its 5 test functions - remove unused typing_extensions.deprecated import - add ty: ignore[invalid-return-type] for pymatgen AseAtomsAdaptor return type mismatch in test_fix_symmetry
Removes pymatgen imports from test_fix_symmetry by using ASE's ase.spacegroup.crystal to build the P-6 structure directly.
a0291a3 to
df002fc
Compare
- switch ty hook from language: python to language: system so it uses the project venv instead of an isolated env missing most deps - remove additional_dependencies (no longer needed with system hook) - remove 15-file blanket source override for unsupported-operator (fixed 3 errors inline) and unresolved-import (narrowed to only files that actually import optional deps) - fix unsupported-operator in autobatching.py, runners.py, state.py
df002fc to
adfe576
Compare
with number of PRs, contributors and users increasing, it's more important to guard against easy-to-catch type errors. lessens burden on reviewers and allows to merge green PRs with more confidence