-
Notifications
You must be signed in to change notification settings - Fork 33
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
oceanspy using background_patch
(and other) deprecated cartopy properties
#310
Comments
There is a small chance that only the documentation notebook needs to change. I'm looking into this.. |
Ok. just making the change in the notebook (replace which does not have ticks nor labels on the axes. You can compare it against the snapshot above (first comment), which uses an older version of cartopy (it does have the ticks and labels). There is no import error, because oceanspy only tries to use the deprecated axes properties from cartopy. The relevant code is on try:
gl = ax.gridlines(crs=transform, draw_labels=True)
gl.xlabels_top = False
gl.ylabels_right = False This is the only place these deprecated properties are used. SolutionI will make the change to the notebook and the above snippet of code, and get a PR going in a minute. |
Turns out that the issue of ticks and labels not appearing, is because by default add_labels=False when plotting with I guess it used to be that So now, in the example above,. we have to set it manually true as follows fig = plt.figure(figsize=(10, 5))
ax = od_eul.plot.horizontal_section(varName="masked_Depth", cmap="bone_r", add_labels=True)
land_col = (253 / 255, 180 / 255, 108 / 255)
ax.patch.set_facecolor(land_col)
ax.set_extent([-40, -19, 63, 68]) which produces the following plot It is still true about the need to address the deprecation errors (specially in the notebooks!). But these do not need to happen before updating the Oceanography image in SciServer. I will continue to work on the PR. But there is no need to make a new release inmediately after the PR. |
Thanks @Mikejmnez ! All looks good. |
I wasn't finished... but it is OK I guess. This turned out not to be critical. |
0.2 and 0.3.2
Description
I ran the notebooks within the docs folders (as well as those in binder) with the new environment. All run fine except
Particles.ipynb
. The problem is that the newer versions of cartopy (version > 0.20.2) have deprecated properties thatoceanspy
still currently uses. Particularly:Running
Particles.ipynb
in Sciserver with current compute imageOceanography (Integrated Viewer)
, you can see get a deprecated warning. See the snapshot below:Starting with Cartopy version 0.21 (and matplotlib 3.5.2),
Particles.ipynb
already fails to complete.Solution
As you can see in the snapshot above, we need to replace, the above properties by
I will work on this in the next couple of days. Then make a new (patch) release with these changes so that we can properly update the image in Sciserver.
The text was updated successfully, but these errors were encountered: