Repository navigation
Conversation
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved defects break simulation reconstruction, violate requested trajectory rounding accuracy, and allow infinite precision to produce NaN coordinates.
3 open issues
What changed in this PR
Introduces delta-encoded storage for polymer conformations, targeting 2–4× smaller trajectory files while preserving transparent loading.
Changes:
- Adds integer-grid position encoding with anchors and automatic HDF5 decoding.
- Introduces
save_precision, defaults to a 0.04 grid step, and retains legacysave_decimalshandling. - Adds encoding tests, raises the h5py minimum, and updates the CI Python matrix.
| File | Description |
|---|---|
tests/test_pos_encoding.py |
Tests encoding accuracy, validation, warnings, and reporter round trips. |
tests/test_io.py |
Updates integration assertions for the new default precision. |
requirements.txt |
Raises minimum h5py version to 2.10. |
pyproject.toml |
Aligns the packaged h5py dependency minimum. |
polychrom/simulation.py |
Adds precision-based snapping and storage metadata. |
polychrom/hdf5_format.py |
Implements delta encoding, transparent decoding, and HDF5 v1.10 writes. |
.github/workflows/pythonapp.yml |
Updates tested Python versions to 3.11–3.14. |
Review effort: Balanced
Comment on lines
+154
to
+155
| if not precision > 0: | ||
| raise ValueError(f"pos_precision must be a positive number, got {precision}") |
Comment on lines
+310
to
+313
| precision = dataDict.get("pos_precision", False) | ||
| if "pos" in dataDict and precision is not False and precision is not None: | ||
| dataDict = dict(dataDict) # do not modify the caller's dict | ||
| encoded = encode_positions(dataDict.pop("pos"), precision) |
Comment on lines
+269
to
+270
| if "save_precision" in kwargs: | ||
| raise ValueError("Pass either save_precision or save_decimals, not both") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Description
Introduces new storage format to save 2x to 4x of space.
Bump of test versions.
PR Checklist
black .)isort .)flake8and try to resolve all the issues (work in progress!)