-
-
Notifications
You must be signed in to change notification settings - Fork 182
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Expose more optional feature booleans, remove Timer from top level dolfinx
#3335
Conversation
Co-authored-by: Jørgen Schartum Dokken <[email protected]>
… jhale/add-has-scotch
We previously missed the |
These flags are related to the optional features of the C++ library only. Python can perform runtime introspection.
The logic here is: OK, I found petsc4py, but did you build DOLFINx with PETSc? If not, then DOLFINx cannot build PETSc data structures anyway, and the demo cannot be run. |
Yes, but if I'm not overseeing something here, the cpp may be configured with petsc but the python module build without
common.has_petsc will be true, as set by the cpp build, but no nls submodule will be available. This is also independent of the python import of petsc4py working I guess, could have been made available after the python module install.
|
Right, thanks for explaining - I see your point. It's probably clearest to expose both and the tests in the demos should check if DOLFINx Python was built with petsc4py support (which in turn requires DOLFINx C++ to be built with PETSc support). |
support, then exit.
… jhale/add-has-scotch
@garth-wells This patch does make the top level namespace cleaner but is an API change. My view is that |
In support of keeping |
I don't particularly like this change. It adds clutter, but I don't see the benefit. Properties like |
I will modify this patch so that we have:
|
dolfinx
…olfinx` (FEniCS#3335) * Expose more optional feature booleans in public API. * Update python/test/unit/fem/test_petsc_nonlinear_assembler.py Co-authored-by: Jørgen Schartum Dokken <[email protected]> * Top level namespace very cluttered - propose all this to common. * Fix. * Fix demos. * Fix. * Add has_petsc4py. has_petsc now refers to the state of the C++ library. * Add has_petsc4py. * If we cannot find petsc4py module, or DOLFINx was built without petsc4py support, then exit. * Check that DOLFINx Python was built with petsc4py. * Fix logic. * Ruff format. * Revert moving feature to booleans to common. * Ruff format. --------- Co-authored-by: Jørgen Schartum Dokken <[email protected]>
This PR removes Timer functionality from the top-level
dolfinx
module and exposes all of the C++ compile definitions through to Python, including a newdolfinx.has_petsc4py
boolean.