Skip to content

Conversation

@phackstock
Copy link
Collaborator

This PR silences the errors that mypy has been throwing recently (https://github.com/IAMconsortium/units/actions/runs/19125791339).

@phackstock phackstock requested a review from khaeru November 6, 2025 10:54
@phackstock phackstock self-assigned this Nov 6, 2025
@codecov-commenter
Copy link

codecov-commenter commented Nov 6, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.01%. Comparing base (486ad97) to head (6b09f0c).

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #58      +/-   ##
==========================================
+ Coverage   95.74%   96.01%   +0.27%     
==========================================
  Files           5        5              
  Lines         188      201      +13     
==========================================
+ Hits          180      193      +13     
  Misses          8        8              

☔ View full report in Codecov by Sentry.
📢 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.

phackstock and others added 4 commits November 6, 2025 12:22
- Configure pre-commit/mypy to
  - Always type check all files.
  - Ignore missing hints from globalwarmingpotentials.
  - Warn on unused ignores.
- Use pint's Scalar type directly instead of redefining it.
- Remove unused ignores.
- Allow as direct argument to configure_currency(); validate str values
  against the enumeration.
- Remove Literal type and "type: ignore" required to accommodate it.
- Expand tests.
Copy link
Contributor

@khaeru khaeru left a comment

Choose a reason for hiding this comment

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

Sorry for the delay in reviewing here.

Inspired by iiasa/ixmp#581, I'd prefer to go the route of addressing the things that necessitate # type: ignore comments, rather than ignoring them. I've pushed a couple of commits to the branch that hopefully achieve that.

For a few of the added ignores on the branch, I couldn't reproduce a mypy error or warning on my system using pre-commit, plain mypy, or the language server in my editor. If they still give issues on your system, perhaps we can discuss 1:1 about how to adjust config.

@khaeru khaeru merged commit c44a5f7 into IAMconsortium:main Nov 25, 2025
11 checks passed
@phackstock
Copy link
Collaborator Author

Sounds good, no worries, I'll update my fork of the repo and see if the errors disappear

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