Skip to content

Commit

Permalink
fix(import): correct import pattern
Browse files Browse the repository at this point in the history
  • Loading branch information
jourdain committed Oct 22, 2024
1 parent 1f4eaf0 commit 4d478bf
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
21 changes: 13 additions & 8 deletions pan3d/__init__.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,22 @@
import logging
from .dataset_builder import DatasetBuilder
from pan3d.dataset_builder import DatasetBuilder
from contextlib import suppress


logger = logging.getLogger(__name__)
logger.setLevel(logging.INFO)

__version__ = "0.9.1"

try:
from .dataset_viewer import DatasetViewer
from .explorers.slice_explorer import SliceExplorer
__all__ = ["DatasetBuilder"]

__all__ = [DatasetBuilder, DatasetViewer, SliceExplorer]
except Exception:
# Trame is not installed, DatasetViewer will not be accessible
__all__ = [DatasetBuilder]
with suppress(ImportError):
from pan3d.dataset_viewer import DatasetViewer # noqa

__all__.append("DatasetViewer")


with suppress(ImportError):
from pan3d.explorers.slice_explorer import SliceExplorer # noqa

__all__.append("SliceExplorer")
2 changes: 1 addition & 1 deletion pan3d/dataset_viewer.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
from pan3d import catalogs as pan3d_catalogs
from pan3d.dataset_builder import DatasetBuilder
from pan3d.ui import AxisDrawer, MainDrawer, Toolbar, RenderOptions, BoundsConfigure
from pan3d.utils import (
from pan3d.utils.constants import (
initial_state,
has_gpu_rendering,
)
Expand Down

0 comments on commit 4d478bf

Please sign in to comment.