Deprecate passing 'appctx' to solvers.#5265
Draft
connorjward wants to merge 2 commits into
Draft
Conversation
Everything can now go in via the options dictionary. For a seamless deprecation process preconditioners will display a warning if the old appctx is used, and custom preconditioners doing the wrong thing will display a warning too.
dham
approved these changes
Jul 21, 2026
| appctx = self.get_appctx(pc) | ||
| fcp = appctx.get("form_compiler_parameters") | ||
| prefix = pc.getOptionsPrefix() or "" | ||
| fcp = dmhooks.get_appctx(pc.getDM()).get_python_option(prefix, "form_compiler_parameters", None) |
Member
There was a problem hiding this comment.
We store a handle to these on both the snescontext and in the appctx. It's essentially global data so we should just get it from the snescontext.
Suggested change
| fcp = dmhooks.get_appctx(pc.getDM()).get_python_option(prefix, "form_compiler_parameters", None) | |
| fcp = dmhooks.get_appctx(pc.getDM()).fcp |
| entities = self.sort_entities(dm, axis, dir, divisions=divisions) | ||
| except KeyError: | ||
| raise KeyError("PlaneSmoother division key %s not provided" % sweep_split[2:]) | ||
| breakpoint() |
Member
There was a problem hiding this comment.
Suggested change
| breakpoint() |
Member
|
Thanks for starting this up again. See https://github.com/firedrakeproject/firedrake/pull/4526/changes for a bunch more places I found needed changes. |
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.
Everything can now go in via the options dictionary.
For a seamless deprecation process preconditioners will display a warning if the old appctx is used, and custom preconditioners doing the wrong thing will display a warning too.
Needs firedrakeproject/petsctools#43