Skip to content

Commit

Permalink
Explicit __all__ in init.py
Browse files Browse the repository at this point in the history
  • Loading branch information
hoxbro committed Jun 19, 2024
1 parent bb97aa8 commit d521978
Show file tree
Hide file tree
Showing 4 changed files with 121 additions and 17 deletions.
80 changes: 70 additions & 10 deletions geoviews/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from functools import partial

import param
from holoviews import ( # noqa: F401
from holoviews import (
Cycle,
Dimension,
DynamicMap,
Expand All @@ -23,14 +23,14 @@
save,
)

from . import ( # noqa: F401
from . import (
data,
feature,
plotting,
tile_sources,
)
from ._warnings import GeoviewsDeprecationWarning, GeoviewsUserWarning # noqa: F401
from .element import ( # noqa: F401
from ._warnings import GeoviewsDeprecationWarning, GeoviewsUserWarning
from .element import (
RGB,
WMTS,
Contours,
Expand All @@ -57,12 +57,74 @@
TriMesh,
VectorField,
WindBarbs,
_Element,
)
from .util import from_xarray # noqa: F401
from .util import from_xarray

__version__ = str(param.version.Version(fpath=__file__, archive_commit="$Format:%h$",
reponame="geoviews"))
__version__ = str(
param.version.Version(
fpath=__file__, archive_commit="$Format:%h$", reponame="geoviews"
)
)

__all__ = (
"Contours",
"Cycle",
"Dataset",
"Dimension",
"DynamicMap",
"EdgePaths",
"Feature",
"FilledContours",
"GeoviewsDeprecationWarning",
"GeoviewsUserWarning",
"Graph",
"GridSpace",
"HexTiles",
"HoloMap",
"Image",
"ImageStack",
"Labels",
"Layout",
"LineContours",
"NdLayout",
"NdOverlay",
"Nodes",
"Overlay",
"Palette",
"Path",
"Points",
"Polygons",
"QuadMesh",
"RGB",
"Rectangles",
"Segments",
"Shape",
"Store",
"Text",
"Tiles",
"TriMesh",
"VectorField",
"WMTS",
"WindBarbs",
"__version__",
"data",
"dim",
"extension",
"feature",
"from_xarray",
"help",
"opts",
"output",
"plotting",
"render",
"renderer",
"save",
"tile_sources",
# Lazy modules
"annotate",
"project",
"operation",
)

# Ensure opts utility is initialized with GeoViews elements
if Store._options:
Expand Down Expand Up @@ -99,8 +161,6 @@ def __getattr__(attr):
return operation
raise AttributeError(f"module {__name__} has no attribute {attr!r}")

__all__ = [k for k in locals() if not k.startswith('_')]
__all__ += ['annotate', 'project', 'operation', '__version__']

def __dir__():
return __all__
Expand Down
8 changes: 5 additions & 3 deletions geoviews/data/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from .geom_dict import GeomDictInterface # noqa (API import)
from .geopandas import GeoPandasInterface # noqa (API import)
from .iris import CubeInterface # noqa (API import)
from .geom_dict import GeomDictInterface
from .geopandas import GeoPandasInterface
from .iris import CubeInterface

__all__ = ("GeomDictInterface", "GeoPandasInterface", "CubeInterface")
33 changes: 32 additions & 1 deletion geoviews/element/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Polygons as HvPolygons,
)

from .geo import ( # noqa: F401
from .geo import (
RGB,
WMTS,
Contours,
Expand Down Expand Up @@ -36,6 +36,37 @@
is_geographic,
)

__all__ = (
"Contours",
"Dataset",
"EdgePaths",
"Feature",
"FilledContours",
"GeoConversion",
"Graph",
"HexTiles",
"Image",
"ImageStack",
"Labels",
"LineContours",
"Nodes",
"Path",
"Points",
"Polygons",
"QuadMesh",
"RGB",
"Rectangles",
"Segments",
"Shape",
"Text",
"Tiles",
"TriMesh",
"VectorField",
"WMTS",
"WindBarbs",
"is_geographic",
)


class GeoConversion(ElementConversion):
"""
Expand Down
17 changes: 14 additions & 3 deletions geoviews/models/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
from .custom_tools import ( # noqa
CheckpointTool, ClearTool, PolyVertexDrawTool, PolyVertexEditTool,
RestoreTool
from .custom_tools import (
CheckpointTool,
ClearTool,
PolyVertexDrawTool,
PolyVertexEditTool,
RestoreTool,
)

__all__ = (
"CheckpointTool",
"ClearTool",
"PolyVertexDrawTool",
"PolyVertexEditTool",
"RestoreTool",
)

0 comments on commit d521978

Please sign in to comment.