Skip to content

Commit 8120900

Browse files
committed
attempt fix
1 parent b1a2155 commit 8120900

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

ultraplot/__init__.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626

2727
# Exceptions to the automated lazy loading
2828
_LAZY_LOADING_EXCEPTIONS = {
29+
"constructor": ("constructor", None),
2930
"crs": ("proj", None),
3031
"colormaps": ("colors", "_cmap_database"),
3132
"check_for_update": ("utils", "check_for_update"),
@@ -39,7 +40,9 @@
3940
"tests": ("tests", None),
4041
"rcsetup": ("internals", "rcsetup"),
4142
"warnings": ("internals", "warnings"),
42-
"figure": ("figure", "Figure"),
43+
"Figure": ("figure", "Figure"),
44+
"Axes": ("axes", "Axes"),
45+
"rc": ("config", "rc"),
4346
}
4447

4548

@@ -229,7 +232,7 @@ def _load_all():
229232
_build_registry_map()
230233
if _REGISTRY_ATTRS:
231234
names.update(_REGISTRY_ATTRS)
232-
names.update({"__version__", "version", "name"})
235+
names.update({"__version__", "version", "name", "setup", "pyplot"})
233236
_EAGER_DONE = True
234237
return sorted(names)
235238

@@ -264,7 +267,7 @@ def setup(*, eager=None):
264267

265268

266269
def __getattr__(name):
267-
if name in {"pytest_plugins", "__version__", "version", "name", "__all__"}:
270+
if name in {"__version__", "version", "name", "__all__"}:
268271
if name == "__all__":
269272
value = _load_all()
270273
globals()["__all__"] = value
@@ -297,14 +300,12 @@ def __getattr__(name):
297300

298301
if name in _LAZY_LOADING_EXCEPTIONS:
299302
_setup()
300-
_maybe_eager_import()
301303
return _resolve_extra(name)
302304

303305
_discover_modules()
304306
if _ATTR_MAP and name in _ATTR_MAP:
305307
module_name, attr_name = _ATTR_MAP[name]
306308
_setup()
307-
_maybe_eager_import()
308309

309310
module = _import_module(module_name)
310311
value = getattr(module, attr_name) if attr_name else module

ultraplot/tests/test_imshow.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1+
import numpy as np
12
import pytest
2-
3-
import ultraplot as plt, numpy as np
43
from matplotlib.testing import setup
54

5+
import ultraplot as plt
6+
67

78
@pytest.fixture()
89
def setup_mpl():
@@ -39,7 +40,6 @@ def test_standardized_input(rng):
3940
axs[1].pcolormesh(xedges, yedges, data)
4041
axs[2].contourf(x, y, data)
4142
axs[3].contourf(xedges, yedges, data)
42-
fig.show()
4343
return fig
4444

4545

0 commit comments

Comments
 (0)