Skip to content

Commit

Permalink
Python: Scalar FFI import & export (#525)
Browse files Browse the repository at this point in the history
Starts work on accepting scalar input into functions. Implements
conversions from `__geo_interface__` to geoarrow scalars.

Todo:

- [x] Export geoarrow scalars via `__arrow_c_array__`
- [x] Import geoarrow scalars via `__arrow_c_array__`
- [x] Import geoarrow scalars via `__geo_interface__` (on each scalar
class, not just on the `ScalarInput` wrapper)

Closes #524, closes
#436
  • Loading branch information
kylebarron authored Feb 21, 2024
1 parent 9b537c6 commit 6aa1ffb
Show file tree
Hide file tree
Showing 31 changed files with 792 additions and 405 deletions.
30 changes: 30 additions & 0 deletions python/core/python/geoarrow/rust/core/_rust.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -35,57 +35,87 @@ from .types import (
from .enums import AreaMethod, LengthMethod, SimplifyMethod

class Point:
def __arrow_c_array__(
self, requested_schema: object | None = None
) -> Tuple[object, object]: ...
def __eq__(self, other: Self) -> bool: ...
@property
def __geo_interface__(self) -> dict: ...
def _repr_svg_(self) -> str: ...

class LineString:
def __arrow_c_array__(
self, requested_schema: object | None = None
) -> Tuple[object, object]: ...
def __eq__(self, other: Self) -> bool: ...
@property
def __geo_interface__(self) -> dict: ...
def _repr_svg_(self) -> str: ...

class Polygon:
def __arrow_c_array__(
self, requested_schema: object | None = None
) -> Tuple[object, object]: ...
def __eq__(self, other: Self) -> bool: ...
@property
def __geo_interface__(self) -> dict: ...
def _repr_svg_(self) -> str: ...

class MultiPoint:
def __arrow_c_array__(
self, requested_schema: object | None = None
) -> Tuple[object, object]: ...
def __eq__(self, other: Self) -> bool: ...
@property
def __geo_interface__(self) -> dict: ...
def _repr_svg_(self) -> str: ...

class MultiLineString:
def __arrow_c_array__(
self, requested_schema: object | None = None
) -> Tuple[object, object]: ...
def __eq__(self, other: Self) -> bool: ...
@property
def __geo_interface__(self) -> dict: ...
def _repr_svg_(self) -> str: ...

class MultiPolygon:
def __arrow_c_array__(
self, requested_schema: object | None = None
) -> Tuple[object, object]: ...
def __eq__(self, other: Self) -> bool: ...
@property
def __geo_interface__(self) -> dict: ...
def _repr_svg_(self) -> str: ...

class Geometry:
# def __arrow_c_array__(
# self, requested_schema: object | None = None
# ) -> Tuple[object, object]: ...
def __eq__(self, other: Self) -> bool: ...
@property
def __geo_interface__(self) -> dict: ...
def _repr_svg_(self) -> str: ...

class GeometryCollection:
def __arrow_c_array__(
self, requested_schema: object | None = None
) -> Tuple[object, object]: ...
def __eq__(self, other: Self) -> bool: ...
@property
def __geo_interface__(self) -> dict: ...
def _repr_svg_(self) -> str: ...

class WKB:
def __arrow_c_array__(
self, requested_schema: object | None = None
) -> Tuple[object, object]: ...
def __eq__(self, other: Self) -> bool: ...

class Rect:
def __arrow_c_array__(
self, requested_schema: object | None = None
) -> Tuple[object, object]: ...
def __eq__(self, other: Self) -> bool: ...

class PointArray:
Expand Down
Loading

0 comments on commit 6aa1ffb

Please sign in to comment.