NCAR / geocat-examples

GeoCAT-examples provides a gallery of visualization examples demonstrating how to reproduce plots from NCL Applications scripts with packages in Python. It also includes some longer form examples demonstrating how to use functionality from various GeoCAT packages.
https://geocat-examples.readthedocs.io
Apache License 2.0
66 stars 42 forks source link

Remove deprecated SciPy functionality #607

Open kafitzgerald opened 4 months ago

kafitzgerald commented 4 months ago

It looks like we need to update NCL_vector_5.py.

See here: https://github.com/NCAR/geocat-examples/actions/runs/9239185399/job/25418034302

kafitzgerald commented 3 months ago

This failure is because interp2d was recently removed from SciPy in v1.14.0. There's a transition guide available from SciPy to help adapt codes.

Adapting the code shouldn't be too much of a lift, but is more involved than swapping out a function or two.

Also, in looking into the impacted example NCL_vector_5.py more deeply, it seems we're really using this interpolation function as a proxy for more sophisticated regridding in order to get the data on a grid that can be used by matplotlib's streamplot. There are two interrelated issues here as well.

  1. I think ideally we wouldn't need to provide data on a regular grid. There's a related issue open over on matplotlib, but it's gone stale. In the geosciences in particular this is a feature of interest. A brief skim of that issue also leads me to think that there may not be checks for this in the matplotlib code so there might be some incorrect visualizations out there because of this. This is beyond the scope of this issue to address, but might be something worth considering. I'm also curious if it's come up with UXarray at all.
  2. We should probably do something a little different for the regridding rather than using interp2d or a replacement. I'll explore this a bit more and see what the original example does, if anything.