Skip to content

fixed offsets in merge_constraints#402

Merged
CompRhys merged 3 commits intoTorchSim:mainfrom
falletta:main
Jan 14, 2026
Merged

fixed offsets in merge_constraints#402
CompRhys merged 3 commits intoTorchSim:mainfrom
falletta:main

Conversation

@falletta
Copy link
Contributor

Summary

  • Fixed bug in calculating the offsets in merge_constraints
  • Updated the corresponding unit test to verify the correct behavior



def test_merge_constraints(ar_double_sim_state: ts.SimState) -> None:
def test_merge_constraints(mixed_double_sim_state: ts.SimState) -> None:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here the test failed to discriminate because n1=n0 for the double Ar state.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, the buggy merge_constraints works for ar_double_sim_state, but fails for mixed_double_sim_state. The fix makes merge_constraints work in both cases.

@CompRhys CompRhys requested a review from thomasloux January 14, 2026 19:22
@CompRhys CompRhys merged commit baab931 into TorchSim:main Jan 14, 2026
106 of 109 checks passed
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