Skip to content

Conversation

@the-mr-dave
Copy link

Description

This PR adds mypy type checking to libEnsemble using an intentionally permissive initial configuration.
It establishes a baseline that can be tightened incrementally without impacting CI stability.

Related issue: #1633

Changes

  • Add an initial mypy configuration to pyproject.toml
  • Add mypy as a CI check
  • Restrict type checking scope to libensemble/utils
  • Exclude utility modules that are not yet mypy-compliant
  • Refactor libensemble/utils/misc.py to satisfy mypy

CI Impact

  • mypy is executed with a restricted scope and permissive settings
  • No existing CI checks are modified, relaxed, or made less strict

the-mr-dave and others added 4 commits January 14, 2026 22:16
Introduce mypy with a permissive, incremental configuration.
Type checking is limited to libensemble/utils and excludes files not yet migrated.
Make libensemble/utils/misc.py compliant with mypy.
Introduce mypy with a permissive, incremental configuration.
Type checking is limited to libensemble/utils and excludes files not yet migrated.
Make libensemble/utils/misc.py compliant with mypy.
… testing/mypy-initial-setup

# Conflicts:
#	pyproject.toml
@codecov
Copy link

codecov bot commented Jan 14, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 78.30%. Comparing base (0f2ee07) to head (b4d2bca).

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #1655   +/-   ##
========================================
  Coverage    78.29%   78.30%           
========================================
  Files           76       76           
  Lines         7580     7581    +1     
  Branches      1119     1119           
========================================
+ Hits          5935     5936    +1     
  Misses        1460     1460           
  Partials       185      185           

☔ 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.

@the-mr-dave
Copy link
Author

Hi maintainers,

when you have time, I’d appreciate any feedback on this PR.
Thanks.

@jlnav
Copy link
Member

jlnav commented Jan 30, 2026

Hello,

Thank you for the mypy implementation and fixes. The configuration and CI implementation look good.

However, I'm surprised changes to output_directory.py were included even though it's excluded by mypy's checks. Did you find a bug? If so, how did you come across it?

@the-mr-dave
Copy link
Author

the-mr-dave commented Jan 30, 2026

Hello,

Thank you for the mypy implementation and fixes. The configuration and CI implementation look good.

However, I'm surprised changes to output_directory.py were included even though it's excluded by mypy's checks. Did you find a bug? If so, how did you come across it?

Thanks a lot for the quick review.
I accidentally pushed the changes for output_directory.py. The changes are only for mypy, but the file was not fully refactored. I would remove the changes out of this PR. And tackle it in the next PR.

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.

2 participants