|
26 | 26 |
|
27 | 27 | # Exceptions to the automated lazy loading |
28 | 28 | _LAZY_LOADING_EXCEPTIONS = { |
| 29 | + "constructor": ("constructor", None), |
29 | 30 | "crs": ("proj", None), |
30 | 31 | "colormaps": ("colors", "_cmap_database"), |
31 | 32 | "check_for_update": ("utils", "check_for_update"), |
|
39 | 40 | "tests": ("tests", None), |
40 | 41 | "rcsetup": ("internals", "rcsetup"), |
41 | 42 | "warnings": ("internals", "warnings"), |
42 | | - "figure": ("figure", "Figure"), |
| 43 | + "Figure": ("figure", "Figure"), |
| 44 | + "Axes": ("axes", "Axes"), |
| 45 | + "rc": ("config", "rc"), |
43 | 46 | } |
44 | 47 |
|
45 | 48 |
|
@@ -229,7 +232,7 @@ def _load_all(): |
229 | 232 | _build_registry_map() |
230 | 233 | if _REGISTRY_ATTRS: |
231 | 234 | names.update(_REGISTRY_ATTRS) |
232 | | - names.update({"__version__", "version", "name"}) |
| 235 | + names.update({"__version__", "version", "name", "setup", "pyplot"}) |
233 | 236 | _EAGER_DONE = True |
234 | 237 | return sorted(names) |
235 | 238 |
|
@@ -264,7 +267,7 @@ def setup(*, eager=None): |
264 | 267 |
|
265 | 268 |
|
266 | 269 | def __getattr__(name): |
267 | | - if name in {"pytest_plugins", "__version__", "version", "name", "__all__"}: |
| 270 | + if name in {"__version__", "version", "name", "__all__"}: |
268 | 271 | if name == "__all__": |
269 | 272 | value = _load_all() |
270 | 273 | globals()["__all__"] = value |
@@ -297,14 +300,12 @@ def __getattr__(name): |
297 | 300 |
|
298 | 301 | if name in _LAZY_LOADING_EXCEPTIONS: |
299 | 302 | _setup() |
300 | | - _maybe_eager_import() |
301 | 303 | return _resolve_extra(name) |
302 | 304 |
|
303 | 305 | _discover_modules() |
304 | 306 | if _ATTR_MAP and name in _ATTR_MAP: |
305 | 307 | module_name, attr_name = _ATTR_MAP[name] |
306 | 308 | _setup() |
307 | | - _maybe_eager_import() |
308 | 309 |
|
309 | 310 | module = _import_module(module_name) |
310 | 311 | value = getattr(module, attr_name) if attr_name else module |
|
0 commit comments