Python
Python copied to clipboard
Fix coordinate compression bug
This pull request resolves issue #13226 by ensuring consistent behavior when handling missing values in coordinate_compression.py.
Changes made:
-
compress(value)now raises aValueErrorif the value is not found in the coordinate map. -
decompress(index)raises aValueErrorfor out-of-bounds indices. - Added docstrings and doctests to clarify expected behavior.
- Verified changes using
pytestanddoctest.
Pull Request Checklist:
- I have read CONTRIBUTING.md.
- I have followed the formatting guidelines in the code style guide.
- I have added relevant tests.
- I have added documentation to all new and modified functions.
- I have commented my code, particularly in hard-to-understand areas.
- I have used Python's typing annotations.