Fix init imports - #5413
Open
nwng04 wants to merge 28 commits into
Open
Conversation
added 8 commits
August 24, 2026 17:39
connorjward
requested changes
Sep 1, 2026
connorjward
marked this pull request as ready for review
September 1, 2026 16:03
pbrubeck
reviewed
Sep 2, 2026
| from firedrake.petsc import PETSc # noqa: F401 | ||
| __all__ += ["PETSc"] | ||
|
|
||
| from firedrake.assemble import assemble # noqa: F401 |
Contributor
There was a problem hiding this comment.
I think # noqa: F401 is no longer needed
Contributor
There was a problem hiding this comment.
Because it's in __all__? I would be surprised if that counts as a used import.
leo-collins
reviewed
Sep 2, 2026
Comment on lines
+294
to
+297
| __all__ += ["set_level", "set_log_handlers", "set_log_level", "DEBUG", "INFO", | ||
| "WARNING", "ERROR", "CRITICAL", "log", "debug", "info", "warning", "error", | ||
| "critical", "info_red", "info_green", "info_blue", "RED", "GREEN", "BLUE"] | ||
|
|
Contributor
There was a problem hiding this comment.
Do we want these in the public API?
Contributor
There was a problem hiding this comment.
I would say no, but I also think that that is out of scope of this PR as it introduces a whole new set of breaking changes.
connorjward
requested changes
Sep 2, 2026
Comment on lines
+294
to
+297
| __all__ += ["set_level", "set_log_handlers", "set_log_level", "DEBUG", "INFO", | ||
| "WARNING", "ERROR", "CRITICAL", "log", "debug", "info", "warning", "error", | ||
| "critical", "info_red", "info_green", "info_blue", "RED", "GREEN", "BLUE"] | ||
|
|
Contributor
There was a problem hiding this comment.
I would say no, but I also think that that is out of scope of this PR as it introduces a whole new set of breaking changes.
| del _plot | ||
|
|
||
|
|
||
| class SpikedModule: |
Contributor
There was a problem hiding this comment.
Can this get a docstring and be moved in _deprecation.py?
Co-authored-by: Connor Ward <c.ward20@imperial.ac.uk>
* Put Firedrake modules on separate pages * Use full arg names in sphinx-apidoc so its less magic * Add :orphan: tag to modules.rst via sed
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.
Description
Fixes #4736.
This PR adds
__all__to the Firedrake__init__.pyfile, refining the imported objects whenfrom firedrake import *is used.Removed Objects:
['slope_limiter', 'eigensolver', 'parloops', 'function', 'matrix_free', 'configuration', 'hdivcurl', 'mixedelement', 'PETSC_SUPPORTED_VERSIONS', 'ensemble', 'linear_solver', 'elementlist', 'setup_cache_dirs', 'checkpointing', 'utility_meshes', 'enrichedelement', 'functionspaceimpl', 'output', 'finiteelement', 'progress_bar', 'halo', 'slate', 'dmhooks', 'tsfc_interface', 'logging', 'ufl_expr', 'randomfunctiongen', 'projection', 'solving_utils', 'pointeval_utils', 'solving', 'cython', 'mg', 'functionspace', 'brokenelement', 'pyplot', 'functionspacedata', 'init_petsc', 'adjoint_utils', 'deflation', 'pointquery_utils', 'restrictedelement', 'constant', 'external_operators', 'tensorproductelement', 'matrix', 'norms', 'finiteelementbase', 'extrusion_utils', 'mesh', 'cofunction', 'exceptions', 'embedding', 'variational_solver', 'firedrake', 'interpolation', 'nullspace', 'bcs', 'formmanipulation', 'preconditioners']
Added Object: 'utils'
This object is added because 9 Firedrake tests use it when testing.