Skip to content

Simplify __init__.py#352

Merged
aaTman merged 10 commits into
developfrom
chore/simplify-init
May 5, 2026
Merged

Simplify __init__.py#352
aaTman merged 10 commits into
developfrom
chore/simplify-init

Conversation

@aaTman
Copy link
Copy Markdown
Collaborator

@aaTman aaTman commented Apr 7, 2026

EWB Pull Request

Description

__init__.py for EWB's src tree worked well prior but was both complicated and caused slow imports. This PR cleans up the file and swaps to a hierarchical import style.

Type of change

  • Refactor
  • Bug fix
  • New feature
  • Chore

If this PR is a breaking change, please explain:

What functionality is now broken?

Importing is changed slightly to improve import time, submodule calls (e.g. .forecasts.ZarrForecast, .targets.ERA5) no longer work.

What is the new approach?

The approaches are changed to explicitly import modules (e.g. .inputs.ZarrForecast) instead. This avoids ambiguity in how to call a method or variable.

Did you fix the documentation and up + downstream code accordingly?

Yes.

How Has This Been Tested?

All tests have been run to ensure everything imports successfully. test_init has been modified to handle the simplified version of the file.

@aaTman aaTman changed the title Simplify __init__.py and recover function Simplify __init__.py Apr 8, 2026
@aaTman aaTman merged commit d7d1809 into develop May 5, 2026
8 checks passed
@aaTman aaTman deleted the chore/simplify-init branch May 5, 2026 17:12
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.

1 participant