Skip to content

Use explicit imports - #978

Merged
visr merged 4 commits into
masterfrom
explicit-imports
Jul 13, 2026
Merged

Use explicit imports#978
visr merged 4 commits into
masterfrom
explicit-imports

Conversation

@visr

@visr visr commented Jul 7, 2026

Copy link
Copy Markdown
Member

Issue addressed

Fixes #375
Also removes Roots.jl from the manifest. Not sure why it was there since it wasn't used. I noticed TeamCity failing on this false dependency.

Explanation

I ran ExplicitImports. Not all findings from that package are addressed here. For instance use of non-public names and importing from non-owner modules are not fixed here.

Copilot AI left a comment

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.

Pull request overview

This PR addresses issue #375 by making imports in Wflow.jl more explicit (reducing reliance on broad using ... statements and unnecessary module qualification), and cleans up the dependency set by removing an unused Roots.jl entry from the manifest to prevent CI failures.

Changes:

  • Replace broad imports / module-qualified references with explicit imports and unqualified in-module references where appropriate.
  • Update internal references to STANDARD_NAME_MAPS, STANDARD_UNITS, pow, and InputSection to rely on in-module bindings.
  • Remove unused Roots.jl (and its now-unneeded CommonSolve) from Manifest.toml.

Reviewed changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
Wflow/src/Wflow.jl Refines imports and internal references; defines STANDARD_NAME_MAPS; adjusts run! cleanup callsite.
Wflow/src/standard_name/standard_name_utils.jl Uses in-module STANDARD_NAME_MAPS for metadata lookup.
Wflow/src/routing/surface/surface_process.jl Uses in-module pow helper without Wflow. qualification.
Wflow/src/io.jl Uses in-module STANDARD_UNITS in warning message.
Wflow/src/config_structure.jl Uses in-module InputSection for fieldnames constant initialization.
Manifest.toml Removes unused Roots (and CommonSolve) from the manifest.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread Wflow/src/Wflow.jl
Copilot finished work on behalf of visr July 7, 2026 14:41

@vers-w vers-w left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM, just one small comment.

Comment thread Wflow/src/Wflow.jl

# option to support running function twice without re-initializing
# and thus opening the netCDF files
if close_files

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Maybe cleaner to rename the keyword argument close_files?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Agree it would be cleaner, but it would break API for minimal gain, so I don't think it is worth it?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Ah yes, good point, I agree that renaming is then not worth it.

@visr
visr merged commit 77dfba0 into master Jul 13, 2026
13 checks passed
@visr
visr deleted the explicit-imports branch July 13, 2026 12:44
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.

Change from using to import, or specify which functions we are importing from external libraries

4 participants