Skip to content

Adjust for strict type hinting in ixmp #963

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
Jul 21, 2025
Merged

Adjust for strict type hinting in ixmp #963

merged 12 commits into from
Jul 21, 2025

Conversation

khaeru
Copy link
Member

@khaeru khaeru commented Jul 18, 2025

iiasa/ixmp#581 by @glatterf42 expanded type hints to the entire code base.

This PR makes adjusts message_ix to address mypy errors arising from those changes, and take advantages of typing-related utilities added.

This PR does not apply the same mypy settings for message_ix as in ixmp; that may be done in a later PR.

How to review

Note that the CI checks all pass.

PR checklist

  • Continuous integration checks all ✅
  • Add or expand tests; coverage checks both ✅
  • Add, expand, or update documentation. N/A
  • Update release notes.

@khaeru khaeru self-assigned this Jul 18, 2025
@khaeru khaeru added the ci Continuous integration label Jul 18, 2025
khaeru added 5 commits July 18, 2025 13:56
Drop message_ix.util.ixmp4.on_ixmp4backend().
- Adjust hints in .core and .models.
- Ignore missing type hints for pooch.
- Remove outdated ignores for jpype, memory_profiler.
@khaeru khaeru force-pushed the enh/ixmp-strict-mypy branch from ca66b56 to 143c0dc Compare July 18, 2025 12:09
@khaeru khaeru mentioned this pull request Jul 18, 2025
4 tasks
Copy link

codecov bot commented Jul 19, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.1%. Comparing base (9fce44b) to head (ae9f89d).
Report is 13 commits behind head on main.

Additional details and impacted files
@@          Coverage Diff          @@
##            main    #963   +/-   ##
=====================================
  Coverage   96.0%   96.1%           
=====================================
  Files         53      53           
  Lines       5026    5030    +4     
=====================================
+ Hits        4829    4834    +5     
+ Misses       197     196    -1     
Files with missing lines Coverage Δ
message_ix/cli.py 96.9% <ø> (+1.2%) ⬆️
message_ix/core.py 97.4% <100.0%> (-0.1%) ⬇️
message_ix/models.py 99.2% <100.0%> (+<0.1%) ⬆️
message_ix/tests/test_report.py 100.0% <100.0%> (ø)
message_ix/util/__init__.py 98.6% <100.0%> (-0.1%) ⬇️
message_ix/util/ixmp4.py 100.0% <100.0%> (ø)
message_ix/util/scenario_setup.py 95.4% <100.0%> (ø)

khaeru added 6 commits July 19, 2025 20:40
Remove all uses of deprecated ixmp.TimeSeries._backend("method", ...)
shorthand.
- mypy v1.14.1 → v0.17
- ruff v0.9.1 → v0.12.4
  - Replace legacy "ruff" hook with "ruff-check".
Distinguish current expected contents for ixmp.IXMP4Backend vs.
JDBCBackend.
Temporary addition between the merge of iiasa/ixmp#581 and the next
release.
@khaeru khaeru force-pushed the enh/ixmp-strict-mypy branch from 86297f9 to d093709 Compare July 20, 2025 22:07
@khaeru khaeru requested a review from glatterf42 July 21, 2025 07:03
@khaeru khaeru merged commit 9fb0b97 into main Jul 21, 2025
66 of 68 checks passed
@khaeru khaeru deleted the enh/ixmp-strict-mypy branch July 21, 2025 13:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci Continuous integration
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant