Skip to content

Commit

Permalink
Move unintentionally-exported code to private modules (#168)
Browse files Browse the repository at this point in the history
  • Loading branch information
kylebarron committed Oct 31, 2023
1 parent 0f9518a commit 91ed47b
Show file tree
Hide file tree
Showing 18 changed files with 24 additions and 22 deletions.
2 changes: 1 addition & 1 deletion docs/api/viz.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ The top-level namespace accessible after `import lonboard`.

Layers are also accessible in the top-level namespace, but are documented in the `layers/` folder.

::: lonboard.viz.viz
::: lonboard.viz
options:
show_root_full_path: false
6 changes: 4 additions & 2 deletions lonboard/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from . import colormap, traits
from ._layer import PathLayer, ScatterplotLayer, SolidPolygonLayer
from ._map import Map
from ._version import __version__
from .layer import PathLayer, ScatterplotLayer, SolidPolygonLayer
from .viz import viz
from ._viz import viz
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import numpy as np
import pyarrow as pa

from lonboard.geoarrow.extension_types import construct_geometry_array
from lonboard._geoarrow.extension_types import construct_geometry_array


def geopandas_to_geoarrow(
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import numpy as np
import pyarrow as pa

from lonboard.constants import EXTENSION_NAME
from lonboard._constants import EXTENSION_NAME


@dataclass
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import numpy as np
import pyarrow as pa

from lonboard.constants import EXTENSION_NAME
from lonboard._constants import EXTENSION_NAME


@dataclass
Expand Down
8 changes: 4 additions & 4 deletions lonboard/layer.py → lonboard/_layer.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
import traitlets
from anywidget import AnyWidget

from lonboard.constants import EPSG_4326, EXTENSION_NAME, OGC_84
from lonboard.geoarrow.geopandas_interop import geopandas_to_geoarrow
from lonboard.serialization import infer_rows_per_chunk
from lonboard._constants import EPSG_4326, EXTENSION_NAME, OGC_84
from lonboard._geoarrow.geopandas_interop import geopandas_to_geoarrow
from lonboard._serialization import infer_rows_per_chunk
from lonboard._viewport import compute_view
from lonboard.traits import ColorAccessor, FloatAccessor, PyarrowTableTrait
from lonboard.viewport import compute_view

# bundler yields lonboard/static/{index.js,styles.css}
bundler_output_dir = Path(__file__).parent / "static"
Expand Down
2 changes: 1 addition & 1 deletion lonboard/widget.py → lonboard/_map.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import ipywidgets
import traitlets

from lonboard.layer import BaseLayer
from lonboard._layer import BaseLayer

# bundler yields lonboard/static/{index.js,styles.css}
bundler_output_dir = Path(__file__).parent / "static"
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion lonboard/_testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"""
import pyarrow.feather as feather

from lonboard.layer import BaseLayer
from lonboard._layer import BaseLayer


def export_widget(widget: BaseLayer, path: str):
Expand Down
2 changes: 1 addition & 1 deletion lonboard/utils.py → lonboard/_utils.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import pyarrow as pa

from lonboard.constants import EXTENSION_NAME
from lonboard._constants import EXTENSION_NAME

GEOARROW_EXTENSION_TYPE_NAMES = {e.value for e in EXTENSION_NAME}

Expand Down
6 changes: 3 additions & 3 deletions lonboard/viewport.py → lonboard/_viewport.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@

import pyarrow as pa

from lonboard.geoarrow.ops.bbox import Bbox, total_bounds
from lonboard.geoarrow.ops.centroid import WeightedCentroid, weighted_centroid
from lonboard.utils import get_geometry_column_index
from lonboard._geoarrow.ops.bbox import Bbox, total_bounds
from lonboard._geoarrow.ops.centroid import WeightedCentroid, weighted_centroid
from lonboard._utils import get_geometry_column_index


def get_bbox_center(table: pa.Table) -> Tuple[Bbox, WeightedCentroid]:
Expand Down
8 changes: 4 additions & 4 deletions lonboard/viz.py → lonboard/_viz.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
import shapely.geometry.base
from numpy.typing import NDArray

from lonboard.constants import EPSG_4326, EXTENSION_NAME, OGC_84
from lonboard.geoarrow.extension_types import construct_geometry_array
from lonboard.geoarrow.geopandas_interop import geopandas_to_geoarrow
from lonboard.layer import PathLayer, ScatterplotLayer, SolidPolygonLayer
from lonboard._constants import EPSG_4326, EXTENSION_NAME, OGC_84
from lonboard._geoarrow.extension_types import construct_geometry_array
from lonboard._geoarrow.geopandas_interop import geopandas_to_geoarrow
from lonboard._layer import PathLayer, ScatterplotLayer, SolidPolygonLayer

if TYPE_CHECKING:
import geopandas as gpd
Expand Down
2 changes: 1 addition & 1 deletion lonboard/traits.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
from traitlets.utils.descriptions import class_of, describe
from typing_extensions import Self

from lonboard.serialization import (
from lonboard._serialization import (
COLOR_SERIALIZATION,
FLOAT_SERIALIZATION,
TABLE_SERIALIZATION,
Expand Down
2 changes: 1 addition & 1 deletion tests/test_layer.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import shapely
from traitlets import TraitError

from lonboard.layer import ScatterplotLayer
from lonboard import ScatterplotLayer


def test_accessor_length_validation():
Expand Down

0 comments on commit 91ed47b

Please sign in to comment.