Skip to content

Enable mypy checking for the previously excluded microphysics directory#1196

Draft
Copilot wants to merge 13 commits intomainfrom
copilot/improve-type-checking-coverage
Draft

Enable mypy checking for the previously excluded microphysics directory#1196
Copilot wants to merge 13 commits intomainfrom
copilot/improve-type-checking-coverage

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 15, 2026

No description provided.

@jenkins-apn
Copy link
Copy Markdown

Hi there, this is jenkins continuous integration...
Do you want me to verify this patch?

1 similar comment
@jenkins-apn
Copy link
Copy Markdown

Hi there, this is jenkins continuous integration...
Do you want me to verify this patch?

Copilot AI linked an issue Apr 15, 2026 that may be closed by this pull request
Agent-Logs-Url: https://github.com/C2SM/icon4py/sessions/319d6d9c-529a-4426-88da-181a1539b4d6

Co-authored-by: msimberg <42977+msimberg@users.noreply.github.com>
Copilot AI changed the title [WIP] Add type checking for one disabled mypy file Enable mypy checking for one previously excluded microphysics library file Apr 15, 2026
Copilot AI requested a review from msimberg April 15, 2026 09:50
Comment thread pyproject.toml Outdated
# '$MYPY_CONFIG_FILE_DIR/model/atmosphere/dycore/src',
'$MYPY_CONFIG_FILE_DIR/model/atmosphere/dycore/tests/',
# '$MYPY_CONFIG_FILE_DIR/model/atmosphere/subgrid_scale_physics/microphysics/src',
'$MYPY_CONFIG_FILE_DIR/model/atmosphere/subgrid_scale_physics/microphysics/src/icon4py/model/atmosphere/subgrid_scale_physics/microphysics/microphysics_options.py',
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@copilot try to enable the full '$MYPY_CONFIG_FILE_DIR/model/atmosphere/subgrid_scale_physics/microphysics/src' directory instead of just one file.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Updated in commit 0749a77: the mypy target now enables the full '$MYPY_CONFIG_FILE_DIR/model/atmosphere/subgrid_scale_physics/microphysics/src' directory instead of a single file.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@copilot Try to enable the microphysics/test directory as well (just do the parent microphysics directory in one go).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done in commit 95cea5b: switched the mypy target to the parent '$MYPY_CONFIG_FILE_DIR/model/atmosphere/subgrid_scale_physics/microphysics' so src and tests are enabled together. (No UI changes; config-only update.)

Agent-Logs-Url: https://github.com/C2SM/icon4py/sessions/4f9f8dab-e3a0-4da0-926d-0517bcd35203

Co-authored-by: msimberg <42977+msimberg@users.noreply.github.com>
Copilot AI changed the title Enable mypy checking for one previously excluded microphysics library file Enable mypy checking for the previously excluded microphysics source directory Apr 15, 2026
Copilot AI requested a review from msimberg April 15, 2026 10:17
Copilot AI and others added 2 commits April 15, 2026 10:23
Copilot AI changed the title Enable mypy checking for the previously excluded microphysics source directory Enable mypy checking for the previously excluded microphysics directory Apr 15, 2026
Copilot AI and others added 2 commits April 15, 2026 10:33
…checking-coverage

Co-authored-by: msimberg <42977+msimberg@users.noreply.github.com>
@github-actions
Copy link
Copy Markdown

Mandatory Tests

Please make sure you run these tests via comment before you merge!

  • cscs-ci run default
  • cscs-ci run distributed

Optional Tests

To run benchmarks you can use:

  • cscs-ci run benchmark-bencher

To run tests and benchmarks with the DaCe backend you can use:

  • cscs-ci run dace

To run test levels ignored by the default test suite (mostly simple datatest for static fields computations) you can use:

  • cscs-ci run extra

For more detailed information please look at CI in the EXCLAIM universe.

@msimberg msimberg requested a review from DropD April 20, 2026 15:05


@gtx.scan_operator(
@gtx.scan_operator( # type: ignore[call-overload] # gt4py stubs don't support tuple init
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@DropD does this ignore fit limitations on type checking of gt4py programs?

mphys_options.LiquidAutoConversionType.KESSLER
)
liquid_autoconversion_option: gtx.int32 = mphys_options.LiquidAutoConversionType.KESSLER
#: snow size distribution interception parameter. Originally defined as isnow_n0temp (PARAMETER) in gscp_data.f90 in ICON. I keep it because I think the choice depends on resolution.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

To do: check this change.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

These gtx.int32 may go away with #1202? Come back to this once a few of the frozen namespace PRs are merged.

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.

Improve type checking coverage

4 participants