-
Notifications
You must be signed in to change notification settings - Fork 195
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
Python: Warn old warpx.multifab
Signature
#5326
Merged
Merged
Conversation
This file contains 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
Warn users that use the old `warpx.multifab("internal_name")` overload to use the new one that only requests a prefix, with dir and level as extra arguments.
ax3l
added
changes input scripts / defaults
Changes the syntax or meaning of input scripts and/or defaults
component: Python
Python layer
labels
Sep 25, 2024
dpgrote
approved these changes
Nov 4, 2024
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.
This looks good, thanks!
EZoni
approved these changes
Nov 4, 2024
RemiLehe
added a commit
to RemiLehe/WarpX
that referenced
this pull request
Nov 12, 2024
This reverts commit 78cf034.
RemiLehe
added a commit
that referenced
this pull request
Nov 13, 2024
It seems that the changes of #5326 is causing confusion among some users. With #5326, users typically receive a message saying that the "signature is deprecated" (which is actually incorrect ; this should say "will soon be deprecated"). As a consequence, users think that their simulation result is invalid (which is again incorrect ; using this signature is still fine for now), and try to change it according the printed instuctions, i.e.: ``` Please use: - multifab('prefix', level=...) for scalar fields - multifab('prefix', dir=..., level=...) for vector field components ``` But because there is no link to a concrete example or test, users typically try: ``` multifab("Efield_fp", dir=0, level=0) ``` and then get ``` TypeError: multifab(): incompatible function arguments. The following argument types are supported: 1. (self: pywarpx.warpx_pybind_3d.WarpX, internal_name: str) -> amrex.space3d.amrex_3d_pybind.MultiFab 2. (self: pywarpx.warpx_pybind_3d.WarpX, scalar_name: str, level: int) -> amrex.space3d.amrex_3d_pybind.MultiFab 3. (self: pywarpx.warpx_pybind_3d.WarpX, vector_name: str, dir: pywarpx.warpx_pybind_3d.Direction, level: int) -> amrex.space3d.amrex_3d_pybind.MultiFab ``` I am guessing that most users will get stuck at this point. The error message does suggest that the user has to create a `Direction` object, but since there is no example on how to create this, it is unlikely that most users will be able to overcome this issue. I would suggest to temporarily revert #5326, and then re-introduce it with: - updated instructions on how to create a `Direction` objects - updated warning that says "will be deprecated" instead of "is deprecated".
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
changes input scripts / defaults
Changes the syntax or meaning of input scripts and/or defaults
component: Python
Python layer
warning
A compiler or tool warning
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.
Warn users that use the old
warpx.multifab("internal_name")
overload to use the new one that only requests a prefix, with dir and level as extra arguments.Follow-up to #5321