Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
126 changes: 126 additions & 0 deletions pymeos/main/_generated/geo_methods.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
# Copyright (c) 2016-2026, Université libre de Bruxelles and PyMEOS
# contributors. Licensed under the PostgreSQL License (see LICENSE).
#
# ============================================================================
# GENERATED by tools/oo_codegen/codegen.py -- DO NOT EDIT.
# Regenerate:
# python3 tools/oo_codegen/codegen.py --mixin geo \
# --mixin-out pymeos/main/_generated/geo_methods.py
# ============================================================================
#
# Wired into pymeos.main.TPoint via TPointDispatchMixin. Every method
# dispatches by argument type to the EXACT pymeos_cffi backing the
# hand-written method used -- same native call, same transforms, same
# result, never reimplemented: identical by construction.
"""Generated regular OO methods for the TPoint family."""
from __future__ import annotations

from typing import TYPE_CHECKING

import shapely.geometry.base as shpb
from pymeos_cffi import *

from ...temporal import Temporal
import shapely.geometry as shp
import shapely.geometry.base as shpb
from ...collections import GeoSet

if TYPE_CHECKING:
from ..tpoint import TPoint, TGeogPoint


class TPointDispatchMixin:
"""Generated regular families (comparison, spatial relationship,
distance, restriction) for :class:`TPoint`."""

def at(self, other):
"""Generated regular ``at``.

MEOS Functions:
temporal_at_values, tgeo_at_stbox, tpoint_at_geom, tpoint_at_value
"""
from ..tpoint import TPoint, TGeogPoint
from ...boxes import STBox

if isinstance(other, shp.Point):
result = tpoint_at_value(
self._inner, geo_to_gserialized(other, isinstance(self, TGeogPoint))
)
elif isinstance(other, shpb.BaseGeometry):
result = tpoint_at_geom(
self._inner, geo_to_gserialized(other, isinstance(self, TGeogPoint))
)
elif isinstance(other, GeoSet):
result = temporal_at_values(self._inner, other._inner)
elif isinstance(other, STBox):
result = tgeo_at_stbox(self._inner, other._inner, True)
else:
return super().at(other)
return Temporal._factory(result)

def distance(self, other):
"""Generated regular ``distance``.

MEOS Functions:
tdistance_tgeo_geo, tdistance_tgeo_tgeo
"""
from ..tpoint import TPoint, TGeogPoint
from ...boxes import STBox

if isinstance(other, shpb.BaseGeometry):
result = tdistance_tgeo_geo(
self._inner, geo_to_gserialized(other, isinstance(self, TGeogPoint))
)
elif isinstance(other, STBox):
result = tdistance_tgeo_geo(self._inner, stbox_to_geo(other._inner))
elif isinstance(other, TPoint):
result = tdistance_tgeo_tgeo(self._inner, other._inner)
else:
raise TypeError(f"Operation not supported with type " f"{other.__class__}")
return Temporal._factory(result)

def minus(self, other):
"""Generated regular ``minus``.

MEOS Functions:
temporal_minus_values, tgeo_minus_stbox, tpoint_minus_geom, tpoint_minus_value
"""
from ..tpoint import TPoint, TGeogPoint
from ...boxes import STBox

if isinstance(other, shp.Point):
result = tpoint_minus_value(
self._inner, geo_to_gserialized(other, isinstance(self, TGeogPoint))
)
elif isinstance(other, shpb.BaseGeometry):
result = tpoint_minus_geom(
self._inner, geo_to_gserialized(other, isinstance(self, TGeogPoint))
)
elif isinstance(other, GeoSet):
result = temporal_minus_values(self._inner, other._inner)
elif isinstance(other, STBox):
result = tgeo_minus_stbox(self._inner, other._inner, True)
else:
return super().minus(other)
return Temporal._factory(result)

def nearest_approach_distance(self, other):
"""Generated regular ``nearest_approach_distance``.

MEOS Functions:
nad_tgeo_geo, nad_tgeo_stbox, nad_tgeo_tgeo
"""
from ..tpoint import TPoint, TGeogPoint
from ...boxes import STBox

if isinstance(other, shpb.BaseGeometry):
result = nad_tgeo_geo(
self._inner, geo_to_gserialized(other, isinstance(self, TGeogPoint))
)
elif isinstance(other, STBox):
result = nad_tgeo_stbox(self._inner, other._inner)
elif isinstance(other, TPoint):
result = nad_tgeo_tgeo(self._inner, other._inner)
else:
raise TypeError(f"Operation not supported with type " f"{other.__class__}")
return result
80 changes: 80 additions & 0 deletions pymeos/main/_generated/tbool_methods.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
# Copyright (c) 2016-2026, Université libre de Bruxelles and PyMEOS
# contributors. Licensed under the PostgreSQL License (see LICENSE).
#
# ============================================================================
# GENERATED by tools/oo_codegen/codegen.py -- DO NOT EDIT.
# Regenerate:
# python3 tools/oo_codegen/codegen.py --mixin tbool \
# --mixin-out pymeos/main/_generated/tbool_methods.py
# ============================================================================
#
# Wired into pymeos.main.TBool via TBoolDispatchMixin. Every method
# dispatches by argument type to the EXACT pymeos_cffi backing the
# hand-written method used -- same native call, same transforms, same
# result, never reimplemented: identical by construction.
"""Generated regular OO methods for the TBool family."""
from __future__ import annotations

from typing import TYPE_CHECKING

import shapely.geometry.base as shpb
from pymeos_cffi import *

from ...temporal import Temporal


if TYPE_CHECKING:
from ..tbool import TBool


class TBoolDispatchMixin:
"""Generated regular families (comparison, spatial relationship,
distance, restriction) for :class:`TBool`."""

def at(self, other):
"""Generated regular ``at``.

MEOS Functions:
tbool_at_value
"""
if isinstance(other, bool):
result = tbool_at_value(self._inner, other)
else:
return super().at(other)
return Temporal._factory(result)

def minus(self, other):
"""Generated regular ``minus``.

MEOS Functions:
tbool_minus_value
"""
if isinstance(other, bool):
result = tbool_minus_value(self._inner, other)
else:
return super().minus(other)
return Temporal._factory(result)

def temporal_equal(self, other):
"""Generated regular ``temporal_equal``.

MEOS Functions:
teq_tbool_bool
"""
if isinstance(other, bool):
result = teq_tbool_bool(self._inner, other)
else:
return super().temporal_equal(other)
return Temporal._factory(result)

def temporal_not_equal(self, other):
"""Generated regular ``temporal_not_equal``.

MEOS Functions:
tne_tbool_bool
"""
if isinstance(other, bool):
result = tne_tbool_bool(self._inner, other)
else:
return super().temporal_not_equal(other)
return Temporal._factory(result)
156 changes: 156 additions & 0 deletions pymeos/main/_generated/tfloat_methods.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
# Copyright (c) 2016-2026, Université libre de Bruxelles and PyMEOS
# contributors. Licensed under the PostgreSQL License (see LICENSE).
#
# ============================================================================
# GENERATED by tools/oo_codegen/codegen.py -- DO NOT EDIT.
# Regenerate:
# python3 tools/oo_codegen/codegen.py --mixin tfloat \
# --mixin-out pymeos/main/_generated/tfloat_methods.py
# ============================================================================
#
# Wired into pymeos.main.TFloat via TFloatDispatchMixin. Every method
# dispatches by argument type to the EXACT pymeos_cffi backing the
# hand-written method used -- same native call, same transforms, same
# result, never reimplemented: identical by construction.
"""Generated regular OO methods for the TFloat family."""
from __future__ import annotations

from typing import TYPE_CHECKING

import shapely.geometry.base as shpb
from pymeos_cffi import *

from ...temporal import Temporal
from ...collections import IntSet, IntSpan, IntSpanSet

if TYPE_CHECKING:
from ..tfloat import TFloat


class TFloatDispatchMixin:
"""Generated regular families (comparison, spatial relationship,
distance, restriction) for :class:`TFloat`."""

def always_equal(self, other):
"""Generated regular ``always_equal``.

MEOS Functions:
always_eq_temporal_temporal, always_eq_tfloat_float
"""
from ..tfloat import TFloat

if isinstance(other, float):
result = always_eq_tfloat_float(self._inner, other)
elif isinstance(other, TFloat):
result = always_eq_temporal_temporal(self._inner, other._inner)
else:
raise TypeError(f"Operation not supported with type " f"{other.__class__}")
return result > 0

def always_not_equal(self, other):
"""Generated regular ``always_not_equal``.

MEOS Functions:
always_ne_temporal_temporal, always_ne_tfloat_float
"""
from ..tfloat import TFloat

if isinstance(other, float):
result = always_ne_tfloat_float(self._inner, other)
elif isinstance(other, TFloat):
result = always_ne_temporal_temporal(self._inner, other._inner)
else:
raise TypeError(f"Operation not supported with type " f"{other.__class__}")
return result > 0

def at(self, other):
"""Generated regular ``at``.

MEOS Functions:
tfloat_at_value
"""
if isinstance(other, (int, float)):
result = tfloat_at_value(self._inner, float(other))
elif isinstance(other, IntSet):
return super().at(other.to_floatset())
elif isinstance(other, IntSpan):
return super().at(other.to_floatspan())
elif isinstance(other, IntSpanSet):
return super().at(other.to_floatspanset())
else:
return super().at(other)
return Temporal._factory(result)

def ever_equal(self, other):
"""Generated regular ``ever_equal``.

MEOS Functions:
ever_eq_temporal_temporal, ever_eq_tfloat_float
"""
from ..tfloat import TFloat

if isinstance(other, float):
result = ever_eq_tfloat_float(self._inner, other)
elif isinstance(other, TFloat):
result = ever_eq_temporal_temporal(self._inner, other._inner)
else:
raise TypeError(f"Operation not supported with type " f"{other.__class__}")
return result > 0

def ever_not_equal(self, other):
"""Generated regular ``ever_not_equal``.

MEOS Functions:
ever_ne_temporal_temporal, ever_ne_tfloat_float
"""
from ..tfloat import TFloat

if isinstance(other, float):
result = ever_ne_tfloat_float(self._inner, other)
elif isinstance(other, TFloat):
result = ever_ne_temporal_temporal(self._inner, other._inner)
else:
raise TypeError(f"Operation not supported with type " f"{other.__class__}")
return result > 0

def minus(self, other):
"""Generated regular ``minus``.

MEOS Functions:
tfloat_minus_value
"""
if isinstance(other, (int, float)):
result = tfloat_minus_value(self._inner, float(other))
elif isinstance(other, IntSet):
return super().minus(other.to_floatset())
elif isinstance(other, IntSpan):
return super().minus(other.to_floatspan())
elif isinstance(other, IntSpanSet):
return super().minus(other.to_floatspanset())
else:
return super().minus(other)
return Temporal._factory(result)

def temporal_equal(self, other):
"""Generated regular ``temporal_equal``.

MEOS Functions:
teq_tfloat_float
"""
if isinstance(other, (int, float)):
result = teq_tfloat_float(self._inner, float(other))
else:
return super().temporal_equal(other)
return Temporal._factory(result)

def temporal_not_equal(self, other):
"""Generated regular ``temporal_not_equal``.

MEOS Functions:
tne_tfloat_float
"""
if isinstance(other, (int, float)):
result = tne_tfloat_float(self._inner, float(other))
else:
return super().temporal_not_equal(other)
return Temporal._factory(result)
Loading