-
Notifications
You must be signed in to change notification settings - Fork 47
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
Update plot_water_height.py #10
Conversation
Fixes deprecation warning for creating an ndarray from ragged nested sequences Fixes index out of range for h.shape tuple
Thanks for the PR. Hmm, this breaks it for me with matplotlib==3.3.4 and numpy==1.19.5 on Python 3.6.8.
It looks like when the the np.array is created this way that it's not supported as input to |
Interesting! I don't know what the difference is.. I am using Python 3.9.5, numpy 1.20.3, and matplotlib 3.4.2. I am wondering if somehow the data file my parallel 1D tsunami sim generates is different from the script's expected input structure. In the patch I suggested, I just went ahead and ran the chapter 7 tsunami sim from this repo and With data generated from this repo's executable, there is no deprecation warning during the script execution. And because this is now a running stream of consciousness debug log, I left a Reverting the python script to normal but forgetting to remove the I'm closing this pull request because I am a fool. Great learning experience though! |
I think the deprecation warning about ragged lists is because my sim had the first print statement executed by each image prior to entering the loop which made the first entry in the output file a different length than the rest and therefore screwed everything up. |
@NuclearEngideer thanks, that's funny and I'm happy you could trace it back. Please let me know if you spot anything else, I bet there are a ton of little issues like this. And thank you for reading! |
Fixes deprecation warning for creating an ndarray from ragged nested sequences
Fixes index out of range for h.shape tuple
Python 3.8.2 on macOS 10.15.7.
Appears to generate expected results when compared to the plotter from the chapter 4 code.