message_ix
message_ix copied to clipboard
Test & improve perfomance in .tools.add_year
Most (137 of 187) untested lines in message_ix are in .tools.add_year: https://codecov.io/gh/iiasa/message_ix/tree/master/message_ix/tools/add_year
This PR adds tests for this code, but also reimplements some internal methods for better performance.
Partially addresses #433.
How to review
To be added.
PR checklist
- [ ] Complete code
- [x] Remove usage of pandas.DataFrame.append(), which was removed in pandas 2.0.0.
- [ ] Continuous integration checks all ✅
- [ ] Add or expand tests; coverage checks both ✅
- [ ] Add, expand, or update documentation.
- [ ] Update release notes.
Codecov Report
Merging #494 (7a3d2ba) into main (a824be9) will increase coverage by
0.6%. The diff coverage is92.0%.
@@ Coverage Diff @@
## main #494 +/- ##
=======================================
+ Coverage 94.4% 95.0% +0.6%
=======================================
Files 43 43
Lines 3432 3482 +50
=======================================
+ Hits 3241 3310 +69
+ Misses 191 172 -19
| Impacted Files | Coverage Δ | |
|---|---|---|
| message_ix/tools/add_year/__init__.py | 72.8% <88.8%> (+6.6%) |
:arrow_up: |
| message_ix/tests/tools/test_add_year.py | 96.9% <100.0%> (+1.1%) |
:arrow_up: |
Filtering out commits that were included in #703 already.