Skip to content

Remove StateDict from torchsim integration#589

Merged
cw-tan merged 1 commit intomir-group:developfrom
orionarcher:remove-state-dict
Mar 2, 2026
Merged

Remove StateDict from torchsim integration#589
cw-tan merged 1 commit intomir-group:developfrom
orionarcher:remove-state-dict

Conversation

@orionarcher
Copy link
Copy Markdown
Contributor

Summary

torch_sim.typing.StateDict has been removed in TorchSim/torch-sim#487. This causes an ImportError when loading the NequIP torchsim integration:

ImportError: cannot import name 'StateDict' from 'torch_sim.typing'

This PR updates nequip/integrations/torchsim.py to:

  • Remove the from torch_sim.typing import StateDict import
  • Change forward(self, state: ts.SimState | StateDict)forward(self, state: ts.SimState)
  • Replace the isinstance ternary that fell back to dict→SimState conversion with a direct sim_state = state assignment

Test plan

🤖 Generated with Claude Code

@cw-tan cw-tan changed the base branch from main to develop March 2, 2026 20:51
torch_sim.typing.StateDict has been removed from torch-sim. Update the
torchsim integration to accept only ts.SimState, dropping the isinstance
check and the dict-to-SimState fallback.
@cw-tan cw-tan force-pushed the remove-state-dict branch from 8240ff7 to ee6e2c1 Compare March 2, 2026 20:51
@cw-tan
Copy link
Copy Markdown
Collaborator

cw-tan commented Mar 2, 2026

Thanks, I changed it to merge to develop branch. In general, PRs to nequip should be to the develop branch. Will merge when tests pass.

@cw-tan cw-tan merged commit 2b8cee3 into mir-group:develop Mar 2, 2026
3 checks passed
@orionarcher
Copy link
Copy Markdown
Contributor Author

Thanks @cw-tan!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants