simularium / simulariumio

Python package that converts simulation outputs to the format consumed by the Simularium viewer website
Apache License 2.0
5 stars 3 forks source link

Center position data for smoldyn and medyan #152

Closed ascibisz closed 1 year ago

ascibisz commented 1 year ago

Problem

It's annoying that for smoldyn and medyan data, centering the data is a separate translation filter step after converting the trajectory to simularium file format. We want to be able to center spatial data as a part of the conversion process instead of requiring an extra step. Link to ticket

This change adds an optional boolean parameter center to SmoldynData and MedyanData which defaults to true, and if true then the spatial data will be translated to be centered around the origin (0, 0, 0) during conversion. If false, the spatial data will not be translated.

Type of change

codecov-commenter commented 1 year ago

Codecov Report

Attention: 4 lines in your changes are missing coverage. Please review.

Comparison is base (983c99b) 92.56% compared to head (b783341) 92.90%. Report is 41 commits behind head on main.

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #152 +/- ## ========================================== + Coverage 92.56% 92.90% +0.33% ========================================== Files 101 101 Lines 4546 4735 +189 ========================================== + Hits 4208 4399 +191 + Misses 338 336 -2 ``` | [Files](https://app.codecov.io/gh/simularium/simulariumio/pull/152?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None) | Coverage Δ | | |---|---|---| | [simulariumio/constants.py](https://app.codecov.io/gh/simularium/simulariumio/pull/152?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-c2ltdWxhcml1bWlvL2NvbnN0YW50cy5weQ==) | `100.00% <100.00%> (ø)` | | | [simulariumio/cytosim/cytosim\_converter.py](https://app.codecov.io/gh/simularium/simulariumio/pull/152?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-c2ltdWxhcml1bWlvL2N5dG9zaW0vY3l0b3NpbV9jb252ZXJ0ZXIucHk=) | `97.12% <100.00%> (+0.04%)` | :arrow_up: | | [simulariumio/data\_objects/meta\_data.py](https://app.codecov.io/gh/simularium/simulariumio/pull/152?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-c2ltdWxhcml1bWlvL2RhdGFfb2JqZWN0cy9tZXRhX2RhdGEucHk=) | `97.43% <100.00%> (ø)` | | | [simulariumio/mcell/mcell\_converter.py](https://app.codecov.io/gh/simularium/simulariumio/pull/152?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-c2ltdWxhcml1bWlvL21jZWxsL21jZWxsX2NvbnZlcnRlci5weQ==) | `99.45% <100.00%> (+<0.01%)` | :arrow_up: | | [simulariumio/md/md\_converter.py](https://app.codecov.io/gh/simularium/simulariumio/pull/152?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-c2ltdWxhcml1bWlvL21kL21kX2NvbnZlcnRlci5weQ==) | `96.11% <100.00%> (+0.03%)` | :arrow_up: | | [simulariumio/medyan/medyan\_converter.py](https://app.codecov.io/gh/simularium/simulariumio/pull/152?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-c2ltdWxhcml1bWlvL21lZHlhbi9tZWR5YW5fY29udmVydGVyLnB5) | `98.05% <100.00%> (+0.03%)` | :arrow_up: | | [simulariumio/medyan/medyan\_data.py](https://app.codecov.io/gh/simularium/simulariumio/pull/152?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-c2ltdWxhcml1bWlvL21lZHlhbi9tZWR5YW5fZGF0YS5weQ==) | `100.00% <100.00%> (ø)` | | | [simulariumio/physicell/physicell\_converter.py](https://app.codecov.io/gh/simularium/simulariumio/pull/152?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-c2ltdWxhcml1bWlvL3BoeXNpY2VsbC9waHlzaWNlbGxfY29udmVydGVyLnB5) | `97.81% <100.00%> (+0.09%)` | :arrow_up: | | [simulariumio/readdy/readdy\_converter.py](https://app.codecov.io/gh/simularium/simulariumio/pull/152?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-c2ltdWxhcml1bWlvL3JlYWRkeS9yZWFkZHlfY29udmVydGVyLnB5) | `100.00% <100.00%> (ø)` | | | [simulariumio/smoldyn/smoldyn\_converter.py](https://app.codecov.io/gh/simularium/simulariumio/pull/152?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-c2ltdWxhcml1bWlvL3Ntb2xkeW4vc21vbGR5bl9jb252ZXJ0ZXIucHk=) | `100.00% <100.00%> (ø)` | | | ... and [12 more](https://app.codecov.io/gh/simularium/simulariumio/pull/152?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None) | | ... and [1 file with indirect coverage changes](https://app.codecov.io/gh/simularium/simulariumio/pull/152/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None)

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.