Repository navigation
fix issue with metalog jax and updates packages - #696
Conversation
was not handling the creation of metalog's correctly, should of been passing in a numpy array, not a python list. this seems to have been changed behaviour between metalog-jax 2.0.0 and 2.0.1
✅ A new build is available.You can use the following to use pull the image into your local environment: docker pull ghcr.io/the-strategy-unit/nhp_model:pr-696 |
There was a problem hiding this comment.
🟡 Changes recommended
The change makes the existing unit test test_hsa_metalog_parameters fail because its assertion compares the mock call argument against a plain list, which raises a ValueError against the new NumPy array.
1 open finding
What changed in this PR
This PR fixes a runtime incompatibility with the metalog_jax library when constructing Metalog objects for the Health Status Adjustment reference data. The second positional argument (v["a"]) was being passed as a Python list, but metalog-jax 2.0.1 expects a NumPy array, so the value is now wrapped with np.array(...). This affects the hsa_metalog_parameters loader, which is consumed by health_status_adjustment.py.
Changes:
- Wrap
v["a"]innp.array(...)when constructing eachMetalogto match the updatedmetalog-jaxAPI. - Add the
import numpy as npimport required for the above.
| File | Description |
|---|---|
| src/nhp/model/data/reference/__init__.py | Adds numpy import and passes np.array(v["a"]) instead of a raw list into the Metalog constructor. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #696 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 20 20
Lines 1215 1216 +1
Branches 61 61
=========================================
+ Hits 1215 1216 +1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|

was not handling the creation of metalog's correctly, should of been passing in a numpy array, not a python list.
this seems to have been changed behaviour between metalog-jax 2.0.0 and 2.0.1