Update jmodel: model cards, invalid value masking#48
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #48 +/- ##
==========================================
+ Coverage 94.46% 94.89% +0.42%
==========================================
Files 10 10
Lines 705 686 -19
Branches 78 73 -5
==========================================
- Hits 666 651 -15
+ Misses 24 22 -2
+ Partials 15 13 -2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This pull request updates the J-model implementation to improve handling of invalid temperature values and adds comprehensive model card documentation for the HeiPlanet modeling suite. The PR also modernizes the pre-commit hooks to use ruff instead of black and flake8.
Changes:
- Implemented distinct masking for NaN (water areas) vs. out-of-range temperatures in J-model R0 calculation
- Updated pre-commit hooks from black/flake8 to ruff for linting and formatting
- Added model cards (YAML and Markdown) for WNV-R0 and Aedes albopictus population models
Reviewed changes
Copilot reviewed 14 out of 15 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
.pre-commit-config.yaml |
Replaced black and flake8 with ruff for linting and formatting |
src/heiplanet_models/Jmodel.py |
Modified _interpolate_r0 to handle NaN and out-of-range temperatures differently; commented out geometry clipping |
src/heiplanet_models/utils.py |
Reformatted lambda function parameters across multiple lines |
test/test_JModel.py |
Updated tests to verify masking behavior and corrected coordinate assertions |
test/test_utils.py |
Reformatted lambda function parameters across multiple lines |
test/conftest.py |
Changed test data from random to deterministic with deliberate NaN insertion |
test/Pmodel/test_Pmodel_initial.py |
Added noqa comments to lambda functions |
docs/sources/model_jmodel_python.ipynb |
Minor formatting changes and kernel version update |
model_cards/WNV-R0_model_card.yaml |
New comprehensive model card for WNV-R0 model |
model_cards/WNV-R0_model_card.md |
New markdown version of WNV-R0 model card |
model_cards/Aedes_albopictus_population_model_card.md |
New model card for Aedes albopictus population model |
model_cards/README.md |
New overview README for the model card suite |
model_cards/HeiPlanet_model_comparison.yaml |
New file comparing the two models |
model_cards/HeiPlanet_harmonized_model_cards.yaml |
New harmonized model card schema |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@MaHaWo please review and make changes as you seem fit, I can also do the refactor of the geometry issues if needed. |
There was a problem hiding this comment.
looks good, thank you! the only comment I have is about the -10/ 0.0 values for the masking, which is an implemenation detail though and no game breaker. I can implement the changes mentioned, but pls add your comments to existing discussions first as you see fit.
So, there are two more changes for this PR:
I've added the comments above. Also Copilot was highlighting some more issues, which I did not check in detail. |
…bility of model backend
…mpute. adjust type hints
do you want to have another look @iulusoy ? |
|



This closes #32
This addresses #22 #20
ruffrun_modelfor J-modelR0Also: fix some Jmodel tests, plus we need to see if we do need the geometry cropping (see discussion on file).