Skip to content

fix issue with metalog jax and updates packages - #696

Merged
tomjemmett merged 2 commits into
mainfrom
fix_metalog_issue
Oct 13, 2026
Merged

tomjemmett merged 2 commits into
mainfrom
fix_metalog_issue

Conversation

@tomjemmett

Copy link
Copy Markdown
Member

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

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
@tomjemmett
tomjemmett requested a review from a team as a code owner October 13, 2026 13:54
Copilot AI balanced review requested due to automatic review settings October 13, 2026 13:54
@tomjemmett tomjemmett self-assigned this Oct 13, 2026
@github-actions

Copy link
Copy Markdown

✅ 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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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"] in np.array(...) when constructing each Metalog to match the updated metalog-jax API.
  • Add the import numpy as np import 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

codecov Bot commented Oct 13, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (e0bb367) to head (e9a0bed).

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@yiwen-h yiwen-h left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well done for spotting!

@tomjemmett
tomjemmett merged commit 6409eed into main Oct 13, 2026
8 checks passed
@tomjemmett
tomjemmett deleted the fix_metalog_issue branch October 13, 2026 14:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants