|
7 | 7 |
|
8 | 8 | import sys |
9 | 9 | from pathlib import Path |
10 | | -from typing import Optional |
| 10 | +from typing import TYPE_CHECKING, Optional |
11 | 11 |
|
12 | 12 | from ._lazy import LazyLoader, install_module_proxy |
13 | 13 |
|
| 14 | +if TYPE_CHECKING: |
| 15 | + # These imports are never executed at runtime, so they have zero effect on |
| 16 | + # import performance. They exist solely so that type checkers (pyright, mypy) |
| 17 | + # can resolve names that are otherwise provided by the lazy loader at runtime. |
| 18 | + # |
| 19 | + # Keep this block in sync with _LAZY_LOADING_EXCEPTIONS and every submodule's |
| 20 | + # __all__ — that is the only maintenance burden. |
| 21 | + import matplotlib.pyplot as pyplot |
| 22 | + |
| 23 | + from .axes import Axes as Axes |
| 24 | + from .axes import CartesianAxes as CartesianAxes |
| 25 | + from .axes import ExternalAxesContainer as ExternalAxesContainer |
| 26 | + from .axes import GeoAxes as GeoAxes |
| 27 | + from .axes import PlotAxes as PlotAxes |
| 28 | + from .axes import PolarAxes as PolarAxes |
| 29 | + from .axes import ThreeAxes as ThreeAxes |
| 30 | + from .colors import ColormapDatabase as ColormapDatabase |
| 31 | + from .colors import ColorDatabase as ColorDatabase |
| 32 | + from .colors import ContinuousColormap as ContinuousColormap |
| 33 | + from .colors import DiscreteColormap as DiscreteColormap |
| 34 | + from .colors import DiscreteNorm as DiscreteNorm |
| 35 | + from .colors import DivergingNorm as DivergingNorm |
| 36 | + from .colors import LinearSegmentedColormap as LinearSegmentedColormap |
| 37 | + from .colors import LinearSegmentedNorm as LinearSegmentedNorm |
| 38 | + from .colors import ListedColormap as ListedColormap |
| 39 | + from .colors import PerceptualColormap as PerceptualColormap |
| 40 | + from .colors import PerceptuallyUniformColormap as PerceptuallyUniformColormap |
| 41 | + from .colors import SegmentedNorm as SegmentedNorm |
| 42 | + from .colors import _cmap_database as colormaps |
| 43 | + from .config import config_inline_backend as config_inline_backend |
| 44 | + from .config import Configurator as Configurator |
| 45 | + from .config import rc as rc |
| 46 | + from .config import rc_matplotlib as rc_matplotlib |
| 47 | + from .config import rc_ultraplot as rc_ultraplot |
| 48 | + from .config import register_cmaps as register_cmaps |
| 49 | + from .config import register_colors as register_colors |
| 50 | + from .config import register_cycles as register_cycles |
| 51 | + from .config import register_fonts as register_fonts |
| 52 | + from .config import use_style as use_style |
| 53 | + from .constructor import Colormap as Colormap |
| 54 | + from .constructor import Cycle as Cycle |
| 55 | + from .constructor import Formatter as Formatter |
| 56 | + from .constructor import FORMATTERS as FORMATTERS |
| 57 | + from .constructor import Locator as Locator |
| 58 | + from .constructor import LOCATORS as LOCATORS |
| 59 | + from .constructor import Norm as Norm |
| 60 | + from .constructor import NORMS as NORMS |
| 61 | + from .constructor import Proj as Proj |
| 62 | + from .constructor import PROJS as PROJS |
| 63 | + from .constructor import Scale as Scale |
| 64 | + from .constructor import SCALES as SCALES |
| 65 | + from .demos import show_channels as show_channels |
| 66 | + from .demos import show_cmaps as show_cmaps |
| 67 | + from .demos import show_colorspaces as show_colorspaces |
| 68 | + from .demos import show_colors as show_colors |
| 69 | + from .demos import show_cycles as show_cycles |
| 70 | + from .demos import show_fonts as show_fonts |
| 71 | + from .figure import Figure as Figure |
| 72 | + from .gridspec import GridSpec as GridSpec |
| 73 | + from .gridspec import SubplotGrid as SubplotGrid |
| 74 | + from .legend import GeometryEntry as GeometryEntry |
| 75 | + from .legend import Legend as Legend |
| 76 | + from .legend import LegendEntry as LegendEntry |
| 77 | + from .proj import Aitoff as Aitoff |
| 78 | + from .proj import Hammer as Hammer |
| 79 | + from .proj import KavrayskiyVII as KavrayskiyVII |
| 80 | + from .proj import NorthPolarAzimuthalEquidistant as NorthPolarAzimuthalEquidistant |
| 81 | + from .proj import NorthPolarGnomonic as NorthPolarGnomonic |
| 82 | + from .proj import ( |
| 83 | + NorthPolarLambertAzimuthalEqualArea as NorthPolarLambertAzimuthalEqualArea, |
| 84 | + ) |
| 85 | + from .proj import SouthPolarAzimuthalEquidistant as SouthPolarAzimuthalEquidistant |
| 86 | + from .proj import SouthPolarGnomonic as SouthPolarGnomonic |
| 87 | + from .proj import ( |
| 88 | + SouthPolarLambertAzimuthalEqualArea as SouthPolarLambertAzimuthalEqualArea, |
| 89 | + ) |
| 90 | + from .proj import WinkelTripel as WinkelTripel |
| 91 | + from .scale import CutoffScale as CutoffScale |
| 92 | + from .scale import ExpScale as ExpScale |
| 93 | + from .scale import FuncScale as FuncScale |
| 94 | + from .scale import InverseScale as InverseScale |
| 95 | + from .scale import LinearScale as LinearScale |
| 96 | + from .scale import LogitScale as LogitScale |
| 97 | + from .scale import LogScale as LogScale |
| 98 | + from .scale import MercatorLatitudeScale as MercatorLatitudeScale |
| 99 | + from .scale import PowerScale as PowerScale |
| 100 | + from .scale import SineLatitudeScale as SineLatitudeScale |
| 101 | + from .scale import SymmetricalLogScale as SymmetricalLogScale |
| 102 | + from .text import CurvedText as CurvedText |
| 103 | + from .ultralayout import ColorbarLayoutSolver as ColorbarLayoutSolver |
| 104 | + from .ultralayout import compute_ultra_positions as compute_ultra_positions |
| 105 | + from .ultralayout import get_grid_positions_ultra as get_grid_positions_ultra |
| 106 | + from .ultralayout import is_orthogonal_layout as is_orthogonal_layout |
| 107 | + from .ultralayout import UltraLayoutSolver as UltraLayoutSolver |
| 108 | + from .ticker import AutoCFDatetimeFormatter as AutoCFDatetimeFormatter |
| 109 | + from .ticker import AutoCFDatetimeLocator as AutoCFDatetimeLocator |
| 110 | + from .ticker import AutoFormatter as AutoFormatter |
| 111 | + from .ticker import CFDatetimeFormatter as CFDatetimeFormatter |
| 112 | + from .ticker import DegreeFormatter as DegreeFormatter |
| 113 | + from .ticker import DegreeLocator as DegreeLocator |
| 114 | + from .ticker import DiscreteLocator as DiscreteLocator |
| 115 | + from .ticker import FracFormatter as FracFormatter |
| 116 | + from .ticker import IndexFormatter as IndexFormatter |
| 117 | + from .ticker import IndexLocator as IndexLocator |
| 118 | + from .ticker import LatitudeFormatter as LatitudeFormatter |
| 119 | + from .ticker import LatitudeLocator as LatitudeLocator |
| 120 | + from .ticker import LongitudeFormatter as LongitudeFormatter |
| 121 | + from .ticker import LongitudeLocator as LongitudeLocator |
| 122 | + from .ticker import SciFormatter as SciFormatter |
| 123 | + from .ticker import SigFigFormatter as SigFigFormatter |
| 124 | + from .ticker import SimpleFormatter as SimpleFormatter |
| 125 | + from .ui import close as close |
| 126 | + from .ui import figure as figure |
| 127 | + from .ui import ioff as ioff |
| 128 | + from .ui import ion as ion |
| 129 | + from .ui import isinteractive as isinteractive |
| 130 | + from .ui import show as show |
| 131 | + from .ui import subplot as subplot |
| 132 | + from .ui import subplots as subplots |
| 133 | + from .ui import switch_backend as switch_backend |
| 134 | + from .utils import arange as arange |
| 135 | + from .utils import check_for_update as check_for_update |
| 136 | + from .utils import edges as edges |
| 137 | + from .utils import edges2d as edges2d |
| 138 | + from .utils import get_colors as get_colors |
| 139 | + from .utils import saturate as saturate |
| 140 | + from .utils import scale_luminance as scale_luminance |
| 141 | + from .utils import scale_saturation as scale_saturation |
| 142 | + from .utils import set_alpha as set_alpha |
| 143 | + from .utils import set_hue as set_hue |
| 144 | + from .utils import set_luminance as set_luminance |
| 145 | + from .utils import set_saturation as set_saturation |
| 146 | + from .utils import shade as shade |
| 147 | + from .utils import shift_hue as shift_hue |
| 148 | + from .utils import to_hex as to_hex |
| 149 | + from .utils import to_rgb as to_rgb |
| 150 | + from .utils import to_rgba as to_rgba |
| 151 | + from .utils import to_xyz as to_xyz |
| 152 | + from .utils import to_xyza as to_xyza |
| 153 | + from .utils import units as units |
| 154 | + |
14 | 155 | name = "ultraplot" |
15 | 156 |
|
16 | 157 | try: |
|
0 commit comments