Closed Mikejmnez closed 1 year ago
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 background_patch
with .patch
), gets you the following plot:
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 oceanspy.plot
, lines 758-762, and it reads like:
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.
I 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 od.plot.horizontal_section()
I guess it used to be that add_labels=True
by default, and so tick lines and labels appeared without the need to set this argument True ? (see here https://oceanspy.readthedocs.io/en/latest/Particles.html). Now, you have to specify them as an argument.
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.
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.