Repository navigation
Use stdlib JSON for NaN-tolerant report exports - #580
Merged
Merged
Conversation
iskandr
added a commit
to openvax/serializable
that referenced
this pull request
Oct 6, 2026
simplejson was a Python 2 era backport of json (see #10). The stdlib encoder is faster and produces byte-identical output for everything serializable emits (checked against golden payloads, including numpy float64 / IntEnum / float-Enum values, -0.0, denormals, huge ints and non-ASCII strings). NaN handling is now explicit instead of depending on the installed simplejson version (>=3.19 rejects NaN by default, older versions accept it): - to_json raises ValueError for NaN/inf (allow_nan=False), matching simplejson>=3.19, so existing output and content hashes don't change. - from_json accepts NaN/Infinity, so files written with older simplejson versions can be read again. Drops the simplejson dependency. vaxrank imports simplejson without declaring it, so openvax/vaxrank#580 should be released first. Supersedes PR #10. Part of #15 (the typechecks and coveralls dependencies are left for a separate change). Claude-Session: https://claude.ai/code/session_01JRDMg3F5kNKmnjv5jvQBgr
iskandr
force-pushed
the
declare-simplejson-dependency
branch
from
October 6, 2026 18:10
ff5ba2a to
ed2a83e
Compare
iskandr
added a commit
to openvax/serializable
that referenced
this pull request
Oct 6, 2026
simplejson was a Python 2 era backport of json (see #10). The stdlib encoder is faster and produces byte-identical output for everything serializable emits (checked against golden payloads, including numpy float64 / IntEnum / float-Enum values, -0.0, denormals, huge ints and non-ASCII strings). NaN handling is now explicit instead of depending on the installed simplejson version (>=3.19 rejects NaN by default, older versions accept it): - to_json raises ValueError for NaN/inf (allow_nan=False), matching simplejson>=3.19, so existing output and content hashes don't change. - from_json accepts NaN/Infinity, so files written with older simplejson versions can be read again. Drops the simplejson dependency. vaxrank imports simplejson without declaring it, so openvax/vaxrank#580 should be released first. Supersedes PR #10. Part of #15 (the typechecks and coveralls dependencies are left for a separate change). Claude-Session: https://claude.ai/code/session_01JRDMg3F5kNKmnjv5jvQBgr
iskandr
added a commit
to openvax/serializable
that referenced
this pull request
Oct 6, 2026
simplejson was a Python 2 era backport of json (see #10). The stdlib encoder is faster and produces byte-identical output for everything serializable emits (checked against golden payloads, including numpy float64 / IntEnum / float-Enum values, -0.0, denormals, huge ints and non-ASCII strings). NaN handling is now explicit instead of depending on the installed simplejson version (>=3.19 rejects NaN by default, older versions accept it): - to_json raises ValueError for NaN/inf (allow_nan=False), matching simplejson>=3.19, so existing output and content hashes don't change. - from_json accepts NaN/Infinity, so files written with older simplejson versions can be read again. Drops the simplejson dependency. vaxrank imports simplejson without declaring it, so openvax/vaxrank#580 should be released first. Supersedes PR #10. Part of #15 (the typechecks and coveralls dependencies are left for a separate change). Claude-Session: https://claude.ai/code/session_01JRDMg3F5kNKmnjv5jvQBgr
iskandr
added a commit
to openvax/serializable
that referenced
this pull request
Oct 6, 2026
simplejson was a Python 2 era backport of json (see #10). The stdlib encoder is faster and produces byte-identical output for everything serializable emits (checked against golden payloads, including numpy float64 / IntEnum / float-Enum values, -0.0, denormals, huge ints and non-ASCII strings). NaN handling is now explicit instead of depending on the installed simplejson version (>=3.19 rejects NaN by default, older versions accept it): - to_json raises ValueError for NaN/inf (allow_nan=False), matching simplejson>=3.19, so existing output and content hashes don't change. - from_json accepts NaN/Infinity, so files written with older simplejson versions can be read again. Drops the simplejson dependency. vaxrank imports simplejson without declaring it, so openvax/vaxrank#580 should be released first. Supersedes PR #10. Part of #15 (the typechecks and coveralls dependencies are left for a separate change). Claude-Session: https://claude.ai/code/session_01JRDMg3F5kNKmnjv5jvQBgr
iskandr
added a commit
to openvax/serializable
that referenced
this pull request
Oct 6, 2026
simplejson was a Python 2 era backport of json (see #10). The stdlib encoder is faster and produces byte-identical output for everything serializable emits (checked against golden payloads, including numpy float64 / IntEnum / float-Enum values, -0.0, denormals, huge ints and non-ASCII strings). NaN handling is now explicit instead of depending on the installed simplejson version (>=3.19 rejects NaN by default, older versions accept it): - to_json raises ValueError for NaN/inf (allow_nan=False), matching simplejson>=3.19, so existing output and content hashes don't change. - from_json accepts NaN/Infinity, so files written with older simplejson versions can be read again. Drops the simplejson dependency. vaxrank imports simplejson without declaring it, so openvax/vaxrank#580 should be released first. Supersedes PR #10. Part of #15 (the typechecks and coveralls dependencies are left for a separate change). Claude-Session: https://claude.ai/code/session_01JRDMg3F5kNKmnjv5jvQBgr
iskandr
added a commit
to openvax/serializable
that referenced
this pull request
Oct 6, 2026
simplejson was a Python 2 era backport of json (see #10). The stdlib encoder is faster and produces byte-identical output for everything serializable emits (checked against golden payloads, including numpy float64 / IntEnum / float-Enum values, -0.0, denormals, huge ints and non-ASCII strings). NaN handling is now explicit instead of depending on the installed simplejson version (>=3.19 rejects NaN by default, older versions accept it): - to_json raises ValueError for NaN/inf (allow_nan=False), matching simplejson>=3.19, so existing output and content hashes don't change. - from_json accepts NaN/Infinity, so files written with older simplejson versions can be read again. Drops the simplejson dependency. vaxrank imports simplejson without declaring it, so openvax/vaxrank#580 should be released first. Supersedes PR #10. Part of #15 (the typechecks and coveralls dependencies are left for a separate change). Claude-Session: https://claude.ai/code/session_01JRDMg3F5kNKmnjv5jvQBgr
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.
The CLI JSON writer currently imports SimpleJSON for its
ignore_nan=Trueoption, which turns NaN and infinities into JSON null. Replace that call with stdlibjson.dumpsafter recursively normalizing non-finite floats into_serializable_repr's dict/list representation. Keepallow_nan=Falseso output remains strict JSON, and retain the report protection from #289.Remove the proposed direct SimpleJSON dependency. Regression checks cover nested NumPy float64 values, preserved tuple/set/object metadata, unchanged input values, exact output bytes for finite edge cases and non-ASCII text, and successful writing when SimpleJSON cannot be imported. Existing scalar/list NaN tests remain. Version: 3.38.2, rebased onto 3.38.1.
Validation: lint and all 2,160 tests pass. B16 VCF/BAM CLI export produces a strict JSON report and its peptide/mRNA reports; re-encoding the prior 60,571-byte B16 report is byte-identical. The built wheel and sdist pass strict Twine checks and metadata verification, including absence of a direct SimpleJSON dependency and preservation of the coordinated Osteosarc/Isovar/Topiary floors. All refreshed GitHub CI must pass before merge, followed immediately by clean-main deployment and public PyPI verification.
Related upstream context: openvax/serializable#10 and openvax/serializable#15.