-
Notifications
You must be signed in to change notification settings - Fork 1
Do not import PETSc at the top-level #5
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
Conversation
This avoids us initialising PETSc before petsctools.init is called.
class OptionsManager
@classmethod
def _get_commandline_options(cls):
from petsc4py import PETSc
return frozenset(PETSc.Options().getAll())
@property # or @cachedproperty
def commandline_options(self):
return self._get_commandline_options() |
|
JHopeCollins
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems to DTRT again now for command line arguments. Happy for this to be merged once the linting is passing.
This avoids us initialising PETSc before petsctools.init is called.
Note that this does result in a small API change. We now have
OptionsManager.get_commandline_options()instead ofOptionsManager.commandline_options. I don't know a better way to do this.