Skip to content

Fix squeezed single-particle trajectories in ZnVis - #61

Open
jdrotleff wants to merge 5 commits into
zincware:mainfrom
jdrotleff:fix/single_particle_trajectories
Open

Fix squeezed single-particle trajectories in ZnVis#61
jdrotleff wants to merge 5 commits into
zincware:mainfrom
jdrotleff:fix/single_particle_trajectories

Conversation

@jdrotleff

@jdrotleff jdrotleff commented Jul 10, 2026

Copy link
Copy Markdown
Collaborator

This PR fixes a crash that occurs when ZnVis receives a non-static single particle or vector field without an explicit entity dimension, e.g. (n_times, 3) instead of (n_times, 1, 3). ZnVis already handled one-entity trajectories correctly when the entity axis was preserved. The bug only showed up when that axis was squeezed away.

Normalize squeezed dynamic particle and vector-field frames by restoring the entity axis. Add regression coverage in the existing CI integration tests for single-particle trajectories and single-vector-field trajectories.

This PR fixes a crash that occurs when ZnVis receives a single particle or vector field without an explicit entity dimension, e.g. `(n_times, 3)` instead of `(n_times, 1, 3)`.
ZnVis already handled one-entity trajectories correctly when the particle dimension was preserved. The bug only showed up when that dimension was squeezed away.

Normalize squeezed particle/vector-field frames with `np.atleast_2d`.
Add regression coverage in the existing CI integration tests for:
- single-particle trajectories
- single-vector-field trajectories
@jdrotleff
jdrotleff force-pushed the fix/single_particle_trajectories branch from facf8be to abfbf61 Compare July 10, 2026 12:54
@jdrotleff
jdrotleff marked this pull request as draft July 10, 2026 12:56
@jdrotleff
jdrotleff marked this pull request as ready for review July 10, 2026 13:03
@jdrotleff
jdrotleff requested a review from SamTov July 10, 2026 13:04
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.

1 participant