Skip to content
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

fix pcolormesh grid deprecation warning with matplotlib 3.5 #181

Merged
merged 1 commit into from
Dec 13, 2021

Conversation

sbailey
Copy link
Contributor

@sbailey sbailey commented Dec 11, 2021

This PR avoids a deprecation warning when using matplotlib 3.5:

pytest py/desutil/test
...
test/test_plots.py::TestPlots::test_plot_sky_binned
  /global/common/software/desi/users/sjbailey/desiutil/py/desiutil/plots.py:718: MatplotlibDeprecationWarning: Auto-removal of grids by pcolor() and pcolormesh() is deprecated since 3.5 and will be removed two minor releases later; please call grid(False) first.
    mesh = ax.pcolormesh(grid_ra, grid_dec,

However, I haven't looked into what is actually happening with turning the grid off and on, so I'd appreciate a check by someone who knows what a real-world output plot is supposed to look like with this code. @weaverba137 @dkirkby ?

This is housecleaning for a 21.12 software release for Fuji, but is low priority in the big picture.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.01%) to 69.156% when pulling f04985c on pcolormesh_grid into db67f80 on master.

@weaverba137
Copy link
Member

@sbailey, there is an example notebook that shows what these plots are supposed to look like. You may want to run through that, but I can do that too if you don't have time.

@sbailey
Copy link
Contributor Author

sbailey commented Dec 13, 2021

@weaverba137 yes, it would be helpful if you could run the notebook and do the checks. Please also check with a custom kernel that tests with matplotlib 3.5; from the command line one version of that is:

base=/global/common/software/desi/users/sjbailey
module use $base/desiconda2/modulefiles

module load desiconda/2.0 
module load desiutil/master
module load desitree/0.5.0
module load QuasarNP/0.1.2
module load specex/0.8.3
module load specter/master
module load desimodel/master
module load desitarget/master
module load specsim/master
module load desispec/master
module load desisim/master
module load fiberassign/master
module load desisurvey/master
module load surveysim/master
module load redrock/master
module load redrock-templates/master
module load prospect/master
module load desimeter/master
module load simqso/master
module load speclite/master

(you probably don't need more of those modules past desiutil, but I'm listing what modules are available in that test installation just in case...) If you have a different setup for testing with alternate package versions, that is fine too.

@weaverba137
Copy link
Member

I've run through the entire notebook using your matplotlib install. All the plots looked identical.

@sbailey
Copy link
Contributor Author

sbailey commented Dec 13, 2021

Thanks for the cross check; I'll merge now and update changes.rst.

@sbailey sbailey merged commit ababea6 into master Dec 13, 2021
@sbailey sbailey deleted the pcolormesh_grid branch December 13, 2021 18:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants