diff --git a/python/neuroglancer/__init__.py b/python/neuroglancer/__init__.py index c21690483..3433e8d1b 100644 --- a/python/neuroglancer/__init__.py +++ b/python/neuroglancer/__init__.py @@ -14,109 +14,63 @@ from . import ( # noqa: I001 - segment_colors, # noqa: F401 - server, # noqa: F401 - skeleton, # noqa: F401 + segment_colors, + server, + skeleton, ) -from .default_credentials_manager import set_boss_token # noqa: F401 -from .equivalence_map import EquivalenceMap # noqa: F401 -from .local_volume import LocalVolume # noqa: F401 -from .screenshot import ScreenshotSaver # noqa: F401 +from .default_credentials_manager import set_boss_token +from .equivalence_map import EquivalenceMap +from .local_volume import LocalVolume +from .screenshot import ScreenshotSaver from .server import ( - is_server_running, # noqa: F401 - set_server_bind_address, # noqa: F401 - set_static_content_source, # noqa: F401 - set_dev_server_content_source, # noqa: F401 - stop, # noqa: F401 -) -from .url_state import parse_url, to_json_dump, to_url # noqa: F401 -from .viewer import UnsynchronizedViewer, Viewer # noqa: F401 -from .viewer_config_state import ( - PrefetchState, # noqa: F401 - ScaleBarOptions, # noqa: F401 -) -from .viewer_state import ( - SegmentIdMapEntry, # noqa: F401 - LayerSelectedValues, # noqa: F401 - LayerSelectionState, # noqa: F401 - CoordinateSpace, # noqa: F401 - DimensionScale, # noqa: F401 - CoordinateArray, # noqa: F401 - Tool, # noqa: F401 - PlacePointTool, # noqa: F401 - PlaceLineTool, # noqa: F401 - PlaceBoundingBoxTool, # noqa: F401 - PlaceEllipsoidTool, # noqa: F401 - PlacePolylineTool, # noqa: F401 - BlendTool, # noqa: F401 - OpacityTool, # noqa: F401 - VolumeRenderingTool, # noqa: F401 - VolumeRenderingGainTool, # noqa: F401 - VolumeRenderingDepthSamplesTool, # noqa: F401 - CrossSectionRenderScaleTool, # noqa: F401 - SelectedAlphaTool, # noqa: F401 - NotSelectedAlphaTool, # noqa: F401 - ObjectAlphaTool, # noqa: F401 - HideSegmentZeroTool, # noqa: F401 - HoverHighlightTool, # noqa: F401 - BaseSegmentColoringTool, # noqa: F401 - IgnoreNullVisibleSetTool, # noqa: F401 - ColorSeedTool, # noqa: F401 - SegmentDefaultColorTool, # noqa: F401 - MeshRenderScaleTool, # noqa: F401 - MeshSilhouetteRenderingTool, # noqa: F401 - SaturationTool, # noqa: F401 - SkeletonRenderingMode2dTool, # noqa: F401 - SkeletonRenderingMode3dTool, # noqa: F401 - SkeletonRenderingLineWidth2dTool, # noqa: F401 - SkeletonRenderingLineWidth3dTool, # noqa: F401 - ShaderControlTool, # noqa: F401 - MergeSegmentsTool, # noqa: F401 - SplitSegmentsTool, # noqa: F401 - SelectSegmentsTool, # noqa: F401 - DimensionTool, # noqa: F401 - SidePanelLocation, # noqa: F401 - SelectedLayerState, # noqa: F401 - StatisticsDisplayState, # noqa: F401 - LayerSidePanelState, # noqa: F401 - LayerListPanelState, # noqa: F401 - HelpPanelState, # noqa: F401 - DimensionPlaybackVelocity, # noqa: F401 - Layer, # noqa: F401 - PointAnnotationLayer, # noqa: F401 - CoordinateSpaceTransform, # noqa: F401 - LayerDataSubsource, # noqa: F401 - LayerDataSource, # noqa: F401 - LayerDataSources, # noqa: F401 - InvlerpParameters, # noqa: F401 - TransferFunctionParameters, # noqa: F401 - ImageLayer, # noqa: F401 - SkeletonRenderingOptions, # noqa: F401 - StarredSegments, # noqa: F401 - VisibleSegments, # noqa: F401 - SegmentationLayer, # noqa: F401 - SingleMeshLayer, # noqa: F401 - Annotation, # noqa: F401 - PointAnnotation, # noqa: F401 - LineAnnotation, # noqa: F401 - PolyLineAnnotation, # noqa: F401 - AxisAlignedBoundingBoxAnnotation, # noqa: F401 - EllipsoidAnnotation, # noqa: F401 - AnnotationPropertySpec, # noqa: F401 - AnnotationLayer, # noqa: F401 - LocalAnnotationLayer, # noqa: F401 - ManagedLayer, # noqa: F401 - Layers, # noqa: F401 - LinkedPosition, # noqa: F401 - LinkedZoomFactor, # noqa: F401 - LinkedDepthRange, # noqa: F401 - LinkedOrientationState, # noqa: F401 - CrossSection, # noqa: F401 - CrossSectionMap, # noqa: F401 - DataPanelLayout, # noqa: F401 - StackLayout, # noqa: F401 - row_layout, # noqa: F401 - column_layout, # noqa: F401 - LayerGroupViewer, # noqa: F401 - ViewerState, # noqa: F401 + is_server_running, + set_server_bind_address, + set_static_content_source, + set_dev_server_content_source, + stop, ) +from .url_state import parse_url, to_json_dump, to_url +from .viewer import UnsynchronizedViewer, Viewer +from . import viewer_config_state +from . import viewer_state + +__all__ = [ + # Submodules + "segment_colors", + "server", + "skeleton", + # From default_credentials_manager + "set_boss_token", + # From equivalence_map + "EquivalenceMap", + # From local_volume + "LocalVolume", + # From screenshot + "ScreenshotSaver", + # From server + "is_server_running", + "set_server_bind_address", + "set_static_content_source", + "set_dev_server_content_source", + "stop", + # From url_state + "parse_url", + "to_json_dump", + "to_url", + # From viewer + "UnsynchronizedViewer", + "Viewer", +] + +# Add exports from viewer_config_state and viewer_state +__all__ += viewer_config_state.__all__ +__all__ += viewer_state.__all__ + + +# Make viewer_config_state and viewer_state exported attrs directly accessible +def __getattr__(name): + if name in viewer_config_state.__all__: + return getattr(viewer_config_state, name) + if name in viewer_state.__all__: + return getattr(viewer_state, name) + raise AttributeError(f"module {__name__!r} has no attribute {name!r}")