8000 Update lock files with associated fixes by trexfeathers · Pull Request #5953 · SciTools/iris · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Update lock files with associated fixes #5953

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

Merged
merged 10 commits into from
May 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 23 additions & 5 deletions docs/src/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,14 @@

import datetime
from importlib.metadata import version as get_version
from inspect import getsource
import ntpath
import os
from pathlib import Path
import re
from subprocess import run
import sys
from tempfile import gettempdir
from urllib.parse import quote
import warnings

Expand Down Expand Up @@ -409,6 +411,26 @@ def _dotv(version):
# -- sphinx-gallery config ----------------------------------------------------
# See https://sphinx-gallery.github.io/stable/configuration.html


def reset_modules(gallery_conf, fname):
"""Force re-registering of nc-time-axis with matplotlib for each example.

Required for sphinx-gallery>=0.11.0.
"""
from sys import modules

_ = modules.pop("nc_time_axis", None)


# https://sphinx-gallery.github.io/dev/configuration.html#importing-callables
reset_modules_dir = Path(gettempdir()) / reset_modules.__name__
reset_modules_dir.mkdir(exist_ok=True)
(reset_modules_dir / f"{reset_modules.__name__}.py").write_text(
getsource(reset_modules)
)
sys.path.insert(0, str(reset_modules_dir))


sphinx_gallery_conf = {
# path to your example scripts
"examples_dirs": ["../gallery_code"],
Expand All @@ -420,11 +442,7 @@ def _dotv(version):
"ignore_pattern": r"__init__\.py",
# force gallery building, unless overridden (see src/Makefile)
"plot_gallery": "'True'",
# force re-registering of nc-time-axis with matplotlib for each example,
# required for sphinx-gallery>=0.11.0
"reset_modules": (
lambda gallery_conf, fname: sys.modules.pop("nc_time_axis", None),
),
"reset_modules": f"{reset_modules.__name__}.{reset_modules.__name__}",
}

# -----------------------------------------------------------------------------
Expand Down
17 changes: 17 additions & 0 deletions lib/iris/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,23 @@
PlotDefn = collections.namedtuple("PlotDefn", ("coords", "transpose"))


class _GeoAxesPatched(cartopy.mpl.geoaxes.GeoAxes):
# TODO: see cartopy#2390
# Remove this once the bug is addressed in a Cartopy release.
def _draw_preprocess(self, renderer):
super()._draw_preprocess(renderer)

for artist in self.artists:
if hasattr(artist, "_draw_gridliner"):
# Note this is only necessary since Cartopy v0.23, but is not
# wasteful for earlier versions as _draw_gridliner() includes
# a check for whether a draw is necessary.
artist._draw_gridliner(renderer=renderer)


cartopy.mpl.geoaxes.GeoAxes = _GeoAxesPatched


def _get_plot_defn_custom_coords_picked(cube, coords, mode, ndims=2):
def names(coords):
result = []
Expand Down
Loading
Loading
0