-
Notifications
You must be signed in to change notification settings - Fork 280
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
Include [-+] in regular expression to allow negative box indices #2936
Include [-+] in regular expression to allow negative box indices #2936
Conversation
Hi! Welcome, and thanks for opening this pull request. We have some guidelines for new pull requests, and soon you'll hear back about the results of our tests and continuous integration checks. Thank you for your contribution! |
Hi @RevathiJambunathan, thank you for this bugfix ! I'm curious to see what you get with ds = yt.load(yourfile)
print(type(ds)) while #2806 isn't dealt with, you can force the from yt.frontends.boxlib.api import AMReXDataset
ds = AMReXDataset(yourfile) Now for the present PR itself, I acknowledge this is a bugfix, however I'm wondering if the showcased sliceplot is indeed correct. Namely, I'm surprised that it turns out more that half "empty". Is this what you expect, and if so, why is the data so flat in most of the plot ? Thanks ! |
Another point is that flake8 and black are complaining about the lines exceeding 88 chars. edit: I meant appending, not prepending |
Ok one last thing for now, likely the most important one: |
Hi @neutrinoceros , Thank you for taking a look at the PR! Here is the output of
Yes, I tried
I understand it is surprising :) However, this is expected for the simulation that I was running.
Sure! 👍
Yes! will fix it. Thank you for reviewing the PR! |
Awesome, thanks for your detailed comment ! I was not expecting this explanation at all and I'm glad the output isn't buggy. :) |
Good job on fixing the side-effects of this change ! |
Congrats on the fix! I am however confused as to why there is no need to escape de |
@neutrinoceros I tried to make the regex compact and in the process fixed a style error with spaces before and after + operator. |
black is complaining because you're not using it to auto format your code and it can tell :) You can make it happy with pip install black
black yt/ But we can also solve this here directly edit: well this didn't work |
/black |
Oh my, this bot is all over the place, it changed so much more files than it was supposed to (44 !). |
d8091c5
to
dd9d110
Compare
Ok I manually applied black myself to the branch. Should be good now.
I'm not an expert in regexs, but sn't |
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.
I left some comments to reduce the degree of wizardry behind the regular expressions! Other than that, thanks you so much for getting your hands in these regexps!
Co-authored-by: Corentin Cadiou <contact@cphyc.me>
Co-authored-by: Corentin Cadiou <contact@cphyc.me>
eb72cbb
to
cff51d2
Compare
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.
I took the liberty of replacing the last commit ("make black happy") because it was touching unrelated docstrings and I prefer we avoid making the history of those confusing.
Otherwise congratz, the PR is now not only a bugfix but it improves the quality and readability of this code, well played !
I'll let @cphyc merge this if he's happy too :)
Hooray! Congratulations on your first merged pull request! We hope we keep seeing you around! 🎆 |
PR Summary
The boxlib data output from a WarpX simulation had negative box indices which was leading to the following error
This PR fixes this bug by adding
[-+]?\d
to the python regular expression to account for negative indices as well.Thank you to @atmyers for the suggestion!
With the addition in this PR, we are now able to visualize plotfile data that has negative box indices.
PR Checklist
black --check yt/
isort . --check --diff
flake8 yt/
flynt yt/ --fail-on-change --dry-run -e yt/extern