boutproject / xBOUT

Collects BOUT++ data from parallelized simulations into xarray.
https://xbout.readthedocs.io/en/latest/
Apache License 2.0
22 stars 10 forks source link

Fix warnings #144

Closed johnomotani closed 4 years ago

johnomotani commented 4 years ago

Fix as many warnings as possible. In the tests, where we expect a warning use pytest.warns(UserWarning): to get rid of uncaught warnings. Note one of the matplotlib changes is a change (an upgrade!) to the previous behaviour.

Fixes #96

codecov-commenter commented 4 years ago

Codecov Report

Merging #144 into master will decrease coverage by 0.45%. The diff coverage is 45.45%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #144      +/-   ##
==========================================
- Coverage   78.02%   77.57%   -0.46%     
==========================================
  Files          14       14              
  Lines        2207     2225      +18     
  Branches      504      508       +4     
==========================================
+ Hits         1722     1726       +4     
- Misses        309      321      +12     
- Partials      176      178       +2     
Impacted Files Coverage Δ
xbout/plotting/utils.py 70.83% <ø> (ø)
xbout/plotting/animate.py 39.18% <25.00%> (-2.84%) :arrow_down:
xbout/load.py 79.34% <50.00%> (ø)
xbout/plotting/plotfuncs.py 49.12% <61.53%> (-0.41%) :arrow_down:
xbout/boutdataarray.py 85.92% <100.00%> (ø)
xbout/boutdataset.py 76.34% <100.00%> (+0.07%) :arrow_up:
xbout/utils.py 81.73% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 1f2090e...5c1c964. Read the comment docs.

johnomotani commented 4 years ago

I've fixed several more warnings now, and added with pytest.warns(UserWarning): around the expected warnings in the tests. The test suite now runs with no warnings for me!

I'm updating the title/description of the PR...

pep8speaks commented 4 years ago

Hello @johnomotani! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

There are currently no PEP 8 issues detected in this Pull Request. Cheers! :beers:

Comment last updated at 2020-09-25 21:35:00 UTC
johnomotani commented 4 years ago

Fixed some deprecation warnings from matplotlib-3.3. One of the changes changes existing behaviour. See edited PR description...

johnomotani commented 4 years ago

Actually pcolor.shading = "nearest" does not work with our poloidal_plot=True animations. I think this might be because animatplot unravels the 2d arrays to 1d when animating https://github.com/t-makaro/animatplot/blob/632d988687fca7e7415e9fa49fe7eebc3f0991c6/animatplot/blocks/image_like.py#L57-L60. I suspect this is also why shading="gouraud" never worked with animations. Anyway, I'll revert changing the default for now, until animatplot gets fixed...