Repository navigation
Use the NPZ serialization of Sigima instead of a copy - #6
Draft
PierreRaybaut wants to merge 1 commit into
Draft
PierreRaybaut wants to merge 1 commit into
PierreRaybaut wants to merge 1 commit into
Conversation
serialization_npz.py was a copy of the NPZ serialization of the DataLab Web API, which diverged from it: non-uniform image coordinates had to be added twice, and object metadata holding NumPy arrays nested in lists (e.g. the regions of interest of an image) raised a TypeError when an object was sent to DataLab. Sigima 1.4 provides the implementation shared with DataLab (sigima.io.serialize_object_to_npz and deserialize_object_from_npz): datalab_kernel.serialization_npz now re-exports it, and sigima>=1.4.0 is required. A test checks that an image with regions of interest round-trips. Closes #5 Assisted-by: Claude Opus 5.5
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.
Closes #5 — depends on DataLab-Platform/Sigima#91.
Important
Draft: do not merge before Sigima 1.4.0 and DataLab 1.4.0 are published on PyPI. The CI of pull requests to
maininstalls DataLab and Sigima from PyPI, wheresigima.io.serialize_object_to_npzdoes not exist yet, so the CI of this PR fails until then.Summary
datalab_kernel/serialization_npz.pybecomes a thin re-export ofsigima.io.serialize_object_to_npz/deserialize_object_from_npz(−300 lines): one implementation of the Web API NPZ format, shared with DataLab.sigima>=1.4.0inpyproject.toml,requirements.txtand the README.TypeError: Object of type ndarray is not JSON serializable): newtest_image_rich_metadata_round_trip(fails onmain).Tests
With Sigima
feature/shared-npz-serialization:test_webapi_backend.pyandunit/test_persistence.pypass (all existing NPZ tests, including non-uniform coordinates and archives of earlier versions, now exercise the Sigima implementation).