• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

openvax / vaxrank / 25807635104
96%
master: 88%

Build:
Build:
LAST BUILD BRANCH: v3.1.8
DEFAULT BRANCH: master
Ran 13 May 2026 03:10PM UTC
Jobs 0
Files 0
Run time –
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

pending completion
25807635104

push

github

web-flow
Fix #289: NaN-tolerant Prediction construction + JSON writer (#290)

Two layered fixes for the issue where JSON output crashed on real
HCC1395 data with ``ValueError: Out of range float values are not
JSON compliant``:

**Root cause.** The topiary frame returned by ``mhctools.MHCflurry``
+ ``TopiaryPredictor`` carries NaN in the ``value`` column for
``pMHC_presentation`` rows by design — presentation is a probability
that lives in the ``score`` column, not an IC50. The previous
``predict_epitopes`` row loop fell back from ``affinity`` (NaN) to
``value`` (also NaN) and wrote NaN straight into
``Prediction.value``, poisoning every downstream consumer including
``simplejson`` (strict-mode rejects NaN / Inf).

**Producer fix.** New ``_finite_or_none`` helper in
``vaxrank.epitope_logic`` coerces NaN / Inf / None to None at the
point where ``Prediction.value`` and ``percentile_rank`` get
populated. ``Prediction.value`` now honestly carries either an IC50
(finite) or ``None`` (no IC50 for this kind) — never NaN. Same fix
applied to the WT comparator construction below.

**Writer hardening.** New ``_to_json_nan_tolerant`` wrapper around
``serializable.to_json`` calls ``simplejson.dumps(..., ignore_nan=True)``
so any NaN that slips past the producer guards renders as JSON
``null`` instead of crashing the whole report. Defense in depth for
future predictor adapters or custom score expressions.

**Tests.** ``tests/test_nan_robustness.py`` (9 tests) pins:
- ``_finite_or_none`` semantics (NaN/Inf/None → None; finite passes through)
- ``predict_epitopes`` on a topiary frame with NaN-valued presentation
  rows produces ``Prediction.value=None`` for presentation, never NaN
- ``_to_json_nan_tolerant`` round-trips NaN/Inf as ``null`` in dicts,
  nested dicts, and lists
- Sanity baseline that ``simplejson`` *default* rejects NaN
  (documents why the wrapper exists)

Verified on real data: HCC1395 smoke run (25 PASS somatic variants,
6 HLA-I alleles, mhcflurry default pr... (continued)
Source Files on build 25807635104
Detailed source file information is not available for this build.
  • Back to Repo
  • Github Actions Build #25807635104
  • 41393e2f on github
  • Prev Build on v3.0.1 (#25772811569)
  • Next Build on main (#25808023239)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc