Skip to content

Fix prettysummary import in CloudMicrophysics extension#195

Merged
giordano merged 1 commit intomainfrom
mg/qa-fix-import
Nov 24, 2025
Merged

Fix prettysummary import in CloudMicrophysics extension#195
giordano merged 1 commit intomainfrom
mg/qa-fix-import

Conversation

@giordano
Copy link
Member

I'm a bit confused by why this doesn't trigger an error systematically (@ericphanson ideas?), but this has been failing in some jobs on main (e.g. https://github.com/NumericalEarth/Breeze.jl/actions/runs/19600740942/job/56131898424#step:6:756) and also locally for me (but I'm using julia v1.12 on macOS, same combination as the job linked above).

Honestly, I'm tempted by fixing this upstream in Oceananigans, it feels like prettysummary should really have been defined in Utils, not Grids.

@giordano giordano requested review from glwagner and navidcy November 24, 2025 00:23
@codecov
Copy link

codecov bot commented Nov 24, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

#####

import Oceananigans.Utils: prettysummary
import Oceananigans.Grids: prettysummary
Copy link
Member

Choose a reason for hiding this comment

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

I think prettysummary is originally defined in Utils but then probably is extended in Grids

Copy link
Member

Choose a reason for hiding this comment

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

Does it matter where we import it?

Copy link
Member Author

Choose a reason for hiding this comment

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

I think prettysummary is originally defined in Utils but then probably is extended in Grids

No, that's the thing, Utils imports it from Grids: https://github.com/CliMA/Oceananigans.jl/blob/81dc6c5db02ba111ffc750999e3ca83402dfebe3/src/Utils/prettysummary.jl#L1

Does it matter where we import it?

Yes, ExplicitImports checks that, and tests are failing locally for me because of this.

Copy link
Member

Choose a reason for hiding this comment

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

It might be a messiness / entanglement issue wherein Grids precedes Utils in Oceananigans

Copy link
Member Author

Choose a reason for hiding this comment

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

Do you think it's worth inverting the imports in Oceananigans?

Copy link
Member

Choose a reason for hiding this comment

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

I don't think it's wrong, I was just amazed that it mattered... (but I had forgotten about ExplicitImports)

Copy link
Member

Choose a reason for hiding this comment

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

Do you think it's worth inverting the imports in Oceananigans?

We should look at it. I do think we should be continuously pushing to resolve Oceananigans technical debt.

Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

Thinking harder about this, the methods in Utils using types in Grids could just be moved to Grids.

@ericphanson
Copy link

I'm a bit confused by why this doesn't trigger an error systematically (@ericphanson ideas?)

No, that's very weird... smells like a Julia bug to me but not sure. File an ExplicitImports issue? I might be able to investigate later

@giordano giordano merged commit 5ffe5fd into main Nov 24, 2025
8 checks passed
@giordano giordano deleted the mg/qa-fix-import branch November 24, 2025 12:09
giordano added a commit that referenced this pull request Nov 24, 2025
giordano added a commit that referenced this pull request Nov 24, 2025
giordano added a commit that referenced this pull request Nov 24, 2025
#201)

* Always load `CloudMicrophysics` when running the quality assurance tests

This enables `ExplicitImports` to consistently analyse the code of the extension.

* DROP ME: Revert "Fix `prettysummary` import in CloudMicrophysics extension (#195)"

This reverts commit 5ffe5fd.

* Revert "DROP ME: Revert "Fix `prettysummary` import in CloudMicrophysics extension (#195)""

This reverts commit 14167b0.
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.

4 participants