Make all wrapped tools optional dependencies#51
Merged
mathieu7an merged 1 commit intoEUFLOW:mainfrom Mar 23, 2026
Merged
Conversation
c4d751e to
32035bf
Compare
Contributor
Author
|
@SchmJo @kilojoules @mathieu7an Can one of you take a look at this? It's staggered on top of #55, so it should be merged after. |
10ac88d to
1c3c1fa
Compare
Move py_wake, foxes, floris, and wayve from core dependencies to optional extras in pyproject.toml. Update README and installation docs to document the extras syntax (e.g. wifa[py_wake], wifa[all]). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1c3c1fa to
1880267
Compare
Contributor
Author
Any feedback on this? |
mathieu7an
approved these changes
Mar 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
pip install wifa[pywake],wifa[all], etc.)wifa/_optional.pywith arequire()helper that raises clearImportErrormessages with install instructions when a tool is missingpytest.importorskip()to each tool's test module so tests skip cleanly when the tool is not installedDetails
All API modules already used lazy imports (tool packages imported inside function bodies), so
import wifaworks without any tools installed. This PR formalizes that by:pyproject.toml: Tools moved to[project.optional-dependencies]groups.scipyandpyyamladded as core deps (used at module level by API modules).mpmathmoved to thewayveextra.wifa/_optional.py(new): Centralrequire(package, extra)utility usingimportlib.util.find_spec().run_*()function callsrequire()at its top, giving actionable error messages before any tool import runs.wifa/wayve_api.py:matplotlibandmpmathmoved to lazy imports inside the functions that use them.FoxesWakeModelimport moved into thefoxesbranch ofwake_model_setup().pytest.importorskip()added before tool imports so entire test modules skip when the tool is absent.wifa/__init__.py: Added missingrun_florisexport.Verified
pip install wifa):import wifasucceeds; calling anyrun_*gives a clear error with install instructionspip install wifa[pywake]): pywake tests pass, other tools' tests skippip install wifa[all]): all tests pass as beforeCloses #50
Test plan
pip install wifa(bare) — verifyimport wifaworks,run_pywake()etc. raise clearImportErrorpip install wifa[pywake]— verify pywake tests pass, other tests skippip install wifa[all]— verify all tests pass🤖 Generated with Claude Code