From 1ba5663a1e4d60e319ab465cb560f7be357d8320 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Esteban=20Zim=C3=A1nyi?= Date: Thu, 12 Nov 2026 17:39:35 +0100 Subject: [PATCH 1/6] Write the text of every set, span, span set and temporal value through its template writer The as_text, __str__ and as_wkt of IntSet, FloatSet, TextSet, DateSet, TsTzSet, IntSpan, FloatSpan, DateSpan, TsTzSpan, IntSpanSet, FloatSpanSet, DateSpanSet, TsTzSpanSet, TBool, TInt, TFloat and TText call the writer of their template, set_out, span_out, spanset_out or temporal_out, the writer the catalog's typeEncodings names for the text of each of these types. FloatSet, FloatSpan, FloatSpanSet and TFloat pass their max_decimals, and the other classes pass 0, the digits their writers took. No signature changes. Why. MEOS writes the text of a value with one function per template, and its API no longer declares the per-type writers dateset_out, floatset_out, intspan_out, tint_out and the others PyMEOS called, so pymeos failed to import against the libmeos and the PyMEOS-CFFI of MobilityDB master. Witness. Against the libmeos and catalog of MobilityDB master c5174b8af1 and PyMEOS-CFFI master dc6fb28, master stops at collection with "ImportError: cannot import name 'floatset_out' from 'pymeos_cffi'" and runs no test; on this branch the suite runs 4872 tests, 4827 passing, and the 45 failing are in functions other than the text writers: the hex WKB of an STBox, bearing, nearest_approach_distance of a TBox, delete, ever_touches and the temporal rigid geometry restrictions and accessors. ruff check and ruff format find nothing. --- pymeos/collections/base/spanset.py | 2 +- pymeos/collections/number/floatset.py | 6 +++--- pymeos/collections/number/floatspan.py | 6 +++--- pymeos/collections/number/floatspanset.py | 6 +++--- pymeos/collections/number/intset.py | 6 +++--- pymeos/collections/number/intspan.py | 6 +++--- pymeos/collections/number/intspanset.py | 6 +++--- pymeos/collections/text/textset.py | 4 ++-- pymeos/collections/time/dateset.py | 6 +++--- pymeos/collections/time/datespan.py | 6 +++--- pymeos/collections/time/datespanset.py | 6 +++--- pymeos/collections/time/tstzset.py | 4 ++-- pymeos/collections/time/tstzspan.py | 4 ++-- pymeos/collections/time/tstzspanset.py | 4 ++-- pymeos/main/tbool.py | 8 ++++---- pymeos/main/tfloat.py | 8 ++++---- pymeos/main/tint.py | 6 +++--- pymeos/main/ttext.py | 6 +++--- 18 files changed, 50 insertions(+), 50 deletions(-) diff --git a/pymeos/collections/base/spanset.py b/pymeos/collections/base/spanset.py index eaa62d7d..e69b6efa 100644 --- a/pymeos/collections/base/spanset.py +++ b/pymeos/collections/base/spanset.py @@ -127,7 +127,7 @@ def __repr__(self): A new :class:`str` instance MEOS Functions: - tstzspanset_out + spanset_out """ return f"{self.__class__.__name__}({self})" diff --git a/pymeos/collections/number/floatset.py b/pymeos/collections/number/floatset.py index 2d67661f..bc23062a 100644 --- a/pymeos/collections/number/floatset.py +++ b/pymeos/collections/number/floatset.py @@ -9,7 +9,6 @@ floatset_end_value, floatset_in, floatset_make, - floatset_out, floatset_shift_scale, floatset_start_value, floatset_value_n, @@ -23,6 +22,7 @@ overleft_set_float, overright_set_float, right_set_float, + set_out, union_set_float, union_set_set, ) @@ -78,9 +78,9 @@ def as_text(self, max_decimals: int = 15) -> str: A new :class:`str` instance MEOS Functions: - floatset_out + set_out """ - return floatset_out(self._inner, max_decimals) + return set_out(self._inner, max_decimals) # ------------------------- Conversions ----------------------------------- diff --git a/pymeos/collections/number/floatspan.py b/pymeos/collections/number/floatspan.py index 4ca773f6..18167558 100644 --- a/pymeos/collections/number/floatspan.py +++ b/pymeos/collections/number/floatspan.py @@ -12,7 +12,6 @@ floatspan_in, floatspan_lower, floatspan_make, - floatspan_out, floatspan_shift_scale, floatspan_to_intspan, floatspan_upper, @@ -28,6 +27,7 @@ overright_span_float, right_span_float, span_eq, + span_out, union_span_float, union_span_span, union_spanset_span, @@ -84,9 +84,9 @@ def as_text(self, max_decimals: int = 15) -> str: A new :class:`str` instance MEOS Functions: - floatspan_out + span_out """ - return floatspan_out(self._inner, max_decimals) + return span_out(self._inner, max_decimals) # ------------------------- Conversions ----------------------------------- diff --git a/pymeos/collections/number/floatspanset.py b/pymeos/collections/number/floatspanset.py index 3592dd94..4bff705b 100644 --- a/pymeos/collections/number/floatspanset.py +++ b/pymeos/collections/number/floatspanset.py @@ -10,7 +10,6 @@ distance_spanset_float, float_to_spanset, floatspanset_in, - floatspanset_out, floatspanset_shift_scale, floatspanset_to_intspanset, floatspanset_width, @@ -21,6 +20,7 @@ overright_spanset_float, right_spanset_float, spanset_eq, + spanset_out, union_spanset_float, ) @@ -72,9 +72,9 @@ def as_text(self, max_decimals: int = 15) -> str: A new :class:`str` instance MEOS Functions: - floatspanset_out + spanset_out """ - return floatspanset_out(self._inner, max_decimals) + return spanset_out(self._inner, max_decimals) # ------------------------- Conversions ----------------------------------- diff --git a/pymeos/collections/number/intset.py b/pymeos/collections/number/intset.py index 3eb96247..f7c8ba29 100644 --- a/pymeos/collections/number/intset.py +++ b/pymeos/collections/number/intset.py @@ -11,7 +11,6 @@ intset_end_value, intset_in, intset_make, - intset_out, intset_shift_scale, intset_start_value, intset_value_n, @@ -23,6 +22,7 @@ overleft_set_int, overright_set_int, right_set_int, + set_out, union_set_int, union_set_set, ) @@ -77,9 +77,9 @@ def as_text(self) -> str: A new :class:`str` instance MEOS Functions: - intset_out + set_out """ - return intset_out(self._inner) + return set_out(self._inner, 0) # ------------------------- Conversions ----------------------------------- diff --git a/pymeos/collections/number/intspan.py b/pymeos/collections/number/intspan.py index fab27b5f..f20c9adf 100644 --- a/pymeos/collections/number/intspan.py +++ b/pymeos/collections/number/intspan.py @@ -15,7 +15,6 @@ intspan_in, intspan_lower, intspan_make, - intspan_out, intspan_shift_scale, intspan_to_floatspan, intspan_upper, @@ -28,6 +27,7 @@ overright_span_int, right_span_int, span_eq, + span_out, union_span_int, union_span_span, union_spanset_span, @@ -83,9 +83,9 @@ def as_text(self) -> str: A new :class:`str` instance MEOS Functions: - intspan_out + span_out """ - return intspan_out(self._inner) + return span_out(self._inner, 0) # ------------------------- Conversions ----------------------------------- diff --git a/pymeos/collections/number/intspanset.py b/pymeos/collections/number/intspanset.py index df91ff15..8bcca984 100644 --- a/pymeos/collections/number/intspanset.py +++ b/pymeos/collections/number/intspanset.py @@ -11,7 +11,6 @@ int_to_spanset, intersection_spanset_int, intspanset_in, - intspanset_out, intspanset_shift_scale, intspanset_to_floatspanset, intspanset_width, @@ -21,6 +20,7 @@ overright_spanset_int, right_spanset_int, spanset_eq, + spanset_out, union_spanset_int, ) @@ -72,9 +72,9 @@ def as_text(self) -> str: A new :class:`str` instance MEOS Functions: - intspanset_out + spanset_out """ - return intspanset_out(self._inner) + return spanset_out(self._inner, 0) # ------------------------- Conversions ----------------------------------- diff --git a/pymeos/collections/text/textset.py b/pymeos/collections/text/textset.py index bd5871cd..fe34915b 100644 --- a/pymeos/collections/text/textset.py +++ b/pymeos/collections/text/textset.py @@ -49,9 +49,9 @@ def as_text(self) -> str: A new :class:`str` instance MEOS Functions: - textset_out + set_out """ - return textset_out(self._inner) + return set_out(self._inner, 0) # ------------------------- Conversions ----------------------------------- diff --git a/pymeos/collections/time/dateset.py b/pymeos/collections/time/dateset.py index a552ccfe..0fea2dc0 100644 --- a/pymeos/collections/time/dateset.py +++ b/pymeos/collections/time/dateset.py @@ -13,7 +13,6 @@ dateset_end_value, dateset_in, dateset_make, - dateset_out, dateset_shift_scale, dateset_start_value, dateset_value_n, @@ -27,6 +26,7 @@ minus_set_set, overafter_set_date, overbefore_set_date, + set_out, union_set_date, union_set_set, ) @@ -83,9 +83,9 @@ def as_text(self) -> str: A new :class:`str` instance MEOS Functions: - dateset_out + set_out """ - return dateset_out(self._inner) + return set_out(self._inner, 0) # ------------------------- Conversions ----------------------------------- diff --git a/pymeos/collections/time/datespan.py b/pymeos/collections/time/datespan.py index 5bf41043..7fb93ddc 100644 --- a/pymeos/collections/time/datespan.py +++ b/pymeos/collections/time/datespan.py @@ -15,7 +15,6 @@ datespan_in, datespan_lower, datespan_make, - datespan_out, datespan_shift_scale, datespan_to_tstzspan, datespan_upper, @@ -31,6 +30,7 @@ minus_span_spanset, overafter_span_date, overbefore_span_date, + span_out, union_span_date, ) @@ -89,9 +89,9 @@ def as_text(self) -> str: A new :class:`str` instance MEOS Functions: - datespan_out + span_out """ - return datespan_out(self._inner) + return span_out(self._inner, 0) # ------------------------- Conversions ----------------------------------- diff --git a/pymeos/collections/time/datespanset.py b/pymeos/collections/time/datespanset.py index 0b8e456c..6db98f0e 100644 --- a/pymeos/collections/time/datespanset.py +++ b/pymeos/collections/time/datespanset.py @@ -20,7 +20,6 @@ datespanset_end_date, datespanset_in, datespanset_num_dates, - datespanset_out, datespanset_shift_scale, datespanset_start_date, datespanset_to_tstzspanset, @@ -30,6 +29,7 @@ minus_spanset_date, overafter_spanset_date, overbefore_spanset_date, + spanset_out, union_spanset_date, ) @@ -84,9 +84,9 @@ def as_text(self) -> str: A new :class:`str` instance MEOS Functions: - datespanset_out + spanset_out """ - return datespanset_out(self._inner) + return spanset_out(self._inner, 0) # ------------------------- Conversions ----------------------------------- diff --git a/pymeos/collections/time/tstzset.py b/pymeos/collections/time/tstzset.py index 6403760a..b436a3a2 100644 --- a/pymeos/collections/time/tstzset.py +++ b/pymeos/collections/time/tstzset.py @@ -59,9 +59,9 @@ def as_text(self) -> str: A new :class:`str` instance MEOS Functions: - tstzset_out + set_out """ - return tstzset_out(self._inner) + return set_out(self._inner, 0) # ------------------------- Conversions ----------------------------------- # ------------------------- Accessors ------------------------------------- diff --git a/pymeos/collections/time/tstzspan.py b/pymeos/collections/time/tstzspan.py index 913842f5..0c2d983d 100644 --- a/pymeos/collections/time/tstzspan.py +++ b/pymeos/collections/time/tstzspan.py @@ -61,9 +61,9 @@ def as_text(self) -> str: A new :class:`str` instance MEOS Functions: - tstzspan_out + span_out """ - return tstzspan_out(self._inner) + return span_out(self._inner, 0) # ------------------------- Conversions ----------------------------------- diff --git a/pymeos/collections/time/tstzspanset.py b/pymeos/collections/time/tstzspanset.py index 03d21bcf..1fd42ff6 100644 --- a/pymeos/collections/time/tstzspanset.py +++ b/pymeos/collections/time/tstzspanset.py @@ -59,9 +59,9 @@ def as_text(self) -> str: A new :class:`str` instance MEOS Functions: - tstzspanset_out + spanset_out """ - return tstzspanset_out(self._inner) + return spanset_out(self._inner, 0) # ------------------------- Conversions ----------------------------------- diff --git a/pymeos/main/tbool.py b/pymeos/main/tbool.py index 368c41d1..44211d59 100644 --- a/pymeos/main/tbool.py +++ b/pymeos/main/tbool.py @@ -112,18 +112,18 @@ def as_text(self) -> str: Returns the string representation of `self`. MEOS Function: - tbool_out + temporal_out """ - return tbool_out(self._inner) + return temporal_out(self._inner, 0) def as_wkt(self): """ Returns the string representation of `self` in WKT format. MEOS Function: - tbool_out + temporal_out """ - return tbool_out(self._inner) + return temporal_out(self._inner, 0) # ------------------------- Accessors ------------------------------------- def value_set(self) -> set[bool]: diff --git a/pymeos/main/tfloat.py b/pymeos/main/tfloat.py index 432a3cab..b21d3f8e 100644 --- a/pymeos/main/tfloat.py +++ b/pymeos/main/tfloat.py @@ -133,9 +133,9 @@ def as_text(self, max_decimals: int = 15) -> str: A string representation of `self`. MEOS Functions: - tfloat_out + temporal_out """ - return tfloat_out(self._inner, max_decimals) + return temporal_out(self._inner, max_decimals) def as_wkt(self, max_decimals: int = 15) -> str: """ @@ -148,9 +148,9 @@ def as_wkt(self, max_decimals: int = 15) -> str: A WKT representation of `self`. MEOS Functions: - tfloat_out + temporal_out """ - return tfloat_out(self._inner, max_decimals) + return temporal_out(self._inner, max_decimals) # ------------------------- Conversions ---------------------------------- def to_tint(self) -> TInt: diff --git a/pymeos/main/tint.py b/pymeos/main/tint.py index 3862c8a6..33d7c181 100644 --- a/pymeos/main/tint.py +++ b/pymeos/main/tint.py @@ -121,9 +121,9 @@ def as_text(self) -> str: A string representation of `self`. MEOS Functions: - tint_out + temporal_out """ - return tint_out(self._inner) + return temporal_out(self._inner, 0) def as_wkt(self): """ @@ -135,7 +135,7 @@ def as_wkt(self): MEOS Functions: tint_as_wkt """ - return tint_out(self._inner) + return temporal_out(self._inner, 0) # ------------------------- Conversions ---------------------------------- def to_tfloat(self) -> TFloat: diff --git a/pymeos/main/ttext.py b/pymeos/main/ttext.py index 61898471..bd5934a4 100644 --- a/pymeos/main/ttext.py +++ b/pymeos/main/ttext.py @@ -121,9 +121,9 @@ def as_text(self) -> str: A string with the string representation of `self`. MEOS Functions: - ttext_out + temporal_out """ - return ttext_out(self._inner) + return temporal_out(self._inner, 0) def as_wkt(self) -> str: """ @@ -135,7 +135,7 @@ def as_wkt(self) -> str: MEOS Functions: ttext_as_wkt """ - return ttext_out(self._inner) + return temporal_out(self._inner, 0) # ------------------------- Accessors ------------------------------------- def value_set(self) -> set[str]: From dc3252a490b2b60d8f603b205a3593d0bf1609b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Esteban=20Zim=C3=A1nyi?= Date: Thu, 12 Nov 2026 18:30:27 +0100 Subject: [PATCH 2/6] Call the bearing, the box distance and the rigid geometry functions MEOS declares TPoint.bearing of a geometry calls bearing_tpoint_point(temp, gs), the function of that order of its operands. TBox.nearest_approach_distance of another TBox calls nad_tbox_tbox, which answers an integer and a float box alike. The accessors, the time restrictions, the deletions, the appends, set_interp and round of TRgeometry call the generic temporal function of their name, temporal_instants, temporal_at_timestamptz, temporal_delete_tstzspan and the 16 others, in place of the trgeometry_ function they called. No signature changes. Why. MobilityDB 78ebe3b7fe dropped the invert flag of bearing_tpoint_point, b51a13407e replaced nad_tboxint_tboxint, nad_tboxbigint_tboxbigint and nad_tboxfloat_tboxfloat by nad_tbox_tbox, and 0cf4ad1c4c removed the trgeometry_ twins of the generic temporal functions, which now answer a temporal rigid geometry, so these calls stopped with a TypeError or a NameError. Witness. Against the libmeos of MobilityDB c5174b8af1, the 8 bearing tests, the 4 nearest_approach_distance tests of a TBox and the 4 trgeometry accessor and gap tests pass, where they failed; the integer boxes TBOXINT XT([1, 3),[2001-01-01, 2001-01-02]) and TBOXINT XT([6, 9),[2001-01-01, 2001-01-02]) answer 4.0 and the float boxes TBOXFLOAT XT([1.5, 3.5],[2001-01-01, 2001-01-02]) and TBOXFLOAT XT([6, 9],[2001-01-01, 2001-01-02]) 2.5, the values of b51a13407e. The suite reads 29 failed and 4843 passed, from 45 and 4827. --- pymeos/boxes/tbox.py | 5 +-- pymeos/main/tpoint.py | 2 +- pymeos/main/trgeometry.py | 72 +++++++++++++++++++-------------------- 3 files changed, 38 insertions(+), 41 deletions(-) diff --git a/pymeos/boxes/tbox.py b/pymeos/boxes/tbox.py index 8a955616..c95daa50 100644 --- a/pymeos/boxes/tbox.py +++ b/pymeos/boxes/tbox.py @@ -1082,10 +1082,7 @@ def nearest_approach_distance(self, other: TBox | TNumber) -> float: nad_tbox_tbox """ if isinstance(other, TBox): - if self._is_float(): - return nad_tboxfloat_tboxfloat(self._inner, other._inner) - else: - return nad_tboxint_tboxint(self._inner, other._inner) + return nad_tbox_tbox(self._inner, other._inner) elif isinstance(other, TInt): return nad_tint_tbox(other._inner, self._inner) elif isinstance(other, TFloat): diff --git a/pymeos/main/tpoint.py b/pymeos/main/tpoint.py index c9927d77..7b82f7e0 100644 --- a/pymeos/main/tpoint.py +++ b/pymeos/main/tpoint.py @@ -364,7 +364,7 @@ def bearing(self, other: shpb.BaseGeometry | TPoint) -> TFloat: """ if isinstance(other, shpb.BaseGeometry): gs = geo_to_gserialized(other, isinstance(self, TGeogPoint)) - result = bearing_tpoint_point(self._inner, gs, False) + result = bearing_tpoint_point(self._inner, gs) elif isinstance(other, TPoint): result = bearing_tpoint_tpoint(self._inner, other._inner) else: diff --git a/pymeos/main/trgeometry.py b/pymeos/main/trgeometry.py index 6de0b7a2..47e115b0 100644 --- a/pymeos/main/trgeometry.py +++ b/pymeos/main/trgeometry.py @@ -323,9 +323,9 @@ def start_instant(self: Self) -> TRgeometryInst: A new :class:`TRgeometryInst` object. MEOS Functions: - trgeometry_start_instant + temporal_start_instant """ - return Temporal._factory(trgeometry_start_instant(self._inner)) + return Temporal._factory(temporal_start_instant(self._inner)) def end_instant(self: Self) -> TRgeometryInst: """ @@ -335,9 +335,9 @@ def end_instant(self: Self) -> TRgeometryInst: A new :class:`TRgeometryInst` object. MEOS Functions: - trgeometry_end_instant + temporal_end_instant """ - return Temporal._factory(trgeometry_end_instant(self._inner)) + return Temporal._factory(temporal_end_instant(self._inner)) def instant_n(self, n: int) -> TRgeometryInst: """ @@ -350,9 +350,9 @@ def instant_n(self, n: int) -> TRgeometryInst: A new :class:`TRgeometryInst` object. MEOS Functions: - trgeometry_instant_n + temporal_instant_n """ - return Temporal._factory(trgeometry_instant_n(self._inner, n + 1)) + return Temporal._factory(temporal_instant_n(self._inner, n + 1)) def instants(self) -> list[TRgeometryInst]: """ @@ -362,9 +362,9 @@ def instants(self) -> list[TRgeometryInst]: A :class:`list` of :class:`TRgeometryInst` objects. MEOS Functions: - trgeometry_instants + temporal_instants """ - ins, count = trgeometry_instants(self._inner) + ins, count = temporal_instants(self._inner) return [Temporal._factory(ins[i]) for i in range(count)] def points(self) -> GeometrySet: @@ -449,9 +449,9 @@ def round(self, max_decimals: int = 0) -> TRgeometry: A new :class:`TRgeometry` object. MEOS Functions: - trgeometry_round + temporal_round """ - result = trgeometry_round(self._inner, max_decimals) + result = temporal_round(self._inner, max_decimals) return Temporal._factory(result) def transform(self: Self, srid: int) -> Self: @@ -481,9 +481,9 @@ def set_interpolation(self: Self, interpolation: TInterpolation) -> Self: A new :class:`TRgeometry` instance. MEOS Functions: - trgeometry_set_interp + temporal_set_interp """ - result = trgeometry_set_interp(self._inner, interpolation.value) + result = temporal_set_interp(self._inner, interpolation.value) return Temporal._factory(result) def append_instant( @@ -504,11 +504,11 @@ def append_instant( A new :class:`TRgeometry` object. MEOS Functions: - trgeometry_append_tinstant + temporal_append_tinstant """ interp = self.interpolation() mt = timedelta_to_interval(max_time) if max_time is not None else None - result = trgeometry_append_tinstant(self._inner, instant._inner, interp.value, max_dist, mt, False) + result = temporal_append_tinstant(self._inner, instant._inner, interp.value, max_dist, mt, False) return Temporal._factory(result) def append_sequence(self: Self, sequence: TRgeometrySeq) -> TRgeometry: @@ -522,9 +522,9 @@ def append_sequence(self: Self, sequence: TRgeometrySeq) -> TRgeometry: A new :class:`TRgeometry` object. MEOS Functions: - trgeometry_append_tsequence + temporal_append_tsequence """ - result = trgeometry_append_tsequence(self._inner, sequence._inner, False) + result = temporal_append_tsequence(self._inner, sequence._inner, False) return Temporal._factory(result) # ------------------------- Ever and Always Comparisons ------------------- @@ -630,9 +630,9 @@ def segments(self) -> list[TRgeometrySeq]: Returns the temporal segments of `self`. MEOS Functions: - trgeometry_segments + temporal_segments """ - seqs, count = trgeometry_segments(self._inner) + seqs, count = temporal_segments(self._inner) return [Temporal._factory(seqs[i]) for i in range(count)] # ------------------------- Modifications --------------------------------- @@ -646,17 +646,17 @@ def delete(self, other: Time, connect: bool = True) -> TRgeometry: connect: Whether to connect the resulting segments. MEOS Functions: - trgeometry_delete_timestamptz, trgeometry_delete_tstzset, - trgeometry_delete_tstzspan, trgeometry_delete_tstzspanset + temporal_delete_timestamptz, temporal_delete_tstzset, + temporal_delete_tstzspan, temporal_delete_tstzspanset """ if isinstance(other, datetime): - result = trgeometry_delete_timestamptz(self._inner, datetime_to_timestamptz(other), connect) + result = temporal_delete_timestamptz(self._inner, datetime_to_timestamptz(other), connect) elif isinstance(other, TsTzSet): - result = trgeometry_delete_tstzset(self._inner, other._inner, connect) + result = temporal_delete_tstzset(self._inner, other._inner, connect) elif isinstance(other, TsTzSpan): - result = trgeometry_delete_tstzspan(self._inner, other._inner, connect) + result = temporal_delete_tstzspan(self._inner, other._inner, connect) elif isinstance(other, TsTzSpanSet): - result = trgeometry_delete_tstzspanset(self._inner, other._inner, connect) + result = temporal_delete_tstzspanset(self._inner, other._inner, connect) else: return super().delete(other, connect) return Temporal._factory(result) @@ -671,9 +671,9 @@ def before(self, timestamp: datetime, strict: bool = False) -> TRgeometry: strict: Whether the bound is strict. MEOS Functions: - trgeometry_before_timestamptz + temporal_before_timestamptz """ - result = trgeometry_before_timestamptz(self._inner, datetime_to_timestamptz(timestamp), strict) + result = temporal_before_timestamptz(self._inner, datetime_to_timestamptz(timestamp), strict) return Temporal._factory(result) def after(self, timestamp: datetime, strict: bool = False) -> TRgeometry: @@ -686,9 +686,9 @@ def after(self, timestamp: datetime, strict: bool = False) -> TRgeometry: strict: Whether the bound is strict. MEOS Functions: - trgeometry_after_timestamptz + temporal_after_timestamptz """ - result = trgeometry_after_timestamptz(self._inner, datetime_to_timestamptz(timestamp), strict) + result = temporal_after_timestamptz(self._inner, datetime_to_timestamptz(timestamp), strict) return Temporal._factory(result) # ------------------------- Distance Operations --------------------------- @@ -839,34 +839,34 @@ def start_sequence(self) -> TRgeometrySeq: Returns the first sequence of `self`. MEOS Functions: - trgeometry_start_sequence + temporal_start_sequence """ - return self.ComponentClass(_inner=trgeometry_start_sequence(self._inner)) + return self.ComponentClass(_inner=temporal_start_sequence(self._inner)) def end_sequence(self) -> TRgeometrySeq: """ Returns the last sequence of `self`. MEOS Functions: - trgeometry_end_sequence + temporal_end_sequence """ - return self.ComponentClass(_inner=trgeometry_end_sequence(self._inner)) + return self.ComponentClass(_inner=temporal_end_sequence(self._inner)) def sequence_n(self, n: int) -> TRgeometrySeq: """ Returns the ``n``-th sequence of `self` (0-based). MEOS Functions: - trgeometry_sequence_n + temporal_sequence_n """ - return self.ComponentClass(_inner=trgeometry_sequence_n(self._inner, n + 1)) + return self.ComponentClass(_inner=temporal_sequence_n(self._inner, n + 1)) def sequences(self) -> list[TRgeometrySeq]: """ Returns the list of sequences of `self`. MEOS Functions: - trgeometry_sequences + temporal_sequences """ - seqs, count = trgeometry_sequences(self._inner) + seqs, count = temporal_sequences(self._inner) return [self.ComponentClass(_inner=seqs[i]) for i in range(count)] From 2f98cdba31e97a1bd685f3ed3829f20586621282 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Esteban=20Zim=C3=A1nyi?= Date: Thu, 12 Nov 2026 18:31:34 +0100 Subject: [PATCH 3/6] Regenerate the point and rigid geometry mixins from the catalog of MEOS master The mixins of TGeomPoint, TGeogPoint and TRgeometry in pymeos/main/_generated are the output of tools/oo_codegen/codegen.py --mixin geompoint, geogpoint and rgeo on the catalog of MobilityDB master. The at and minus of a temporal point name tgeo_at_geom, tgeo_at_value and their minus twins as their MEOS functions. disjoint, intersects and is_always_within_distance of a temporal geography point take a shapely geometry, which they hand to tdisjoint_tgeo_geo, tintersects_tgeo_geo and adwithin_tgeo_geo as a geography. The at and minus of a temporal rigid geometry restrict it to a geometry, a value or a box, and leave a time value and a pose set to Temporal.at and Temporal.minus, which call temporal_at_timestamptz, temporal_at_values and their siblings; its disjoint and intersects of a geometry or another temporal rigid geometry call tdisjoint_trgeometry_geo, tintersects_trgeometry_geo and their trgeometry_trgeometry twins. Why. MobilityDB 6975f3c3bf removed tpoint_at_geom, tpoint_at_value and their minus twins, which answered what tgeo_at_geom and tgeo_at_value answer; dd6d5f67c9 gave the temporal geography point its relationships with a geography; 0cf4ad1c4c removed the trgeometry_at and trgeometry_minus functions of time values and of value sets, whose generic temporal functions answer a temporal rigid geometry; and 266f7ed2bb made tIntersects and tDisjoint of a temporal rigid geometry C functions of MEOS. The committed mixins were the generator's output on an older catalog and called 10 functions the catalog no longer has. Witness. On the catalog meos-idl.json of MobilityDB 2c5a8bb595, the three regenerated mixins equal the generator's output, codegen.py --check accounts for 5270 of 5270 functions with the six families present, and the 4 subtests of test_oo_codegen_coverage and the 4 trgeometry restriction tests pass, where they failed. The suite reads 21 failed and 4847 passed, from 29 and 4843. ruff check and ruff format find nothing. --- pymeos/main/_generated/tgeogpoint_methods.py | 16 ++++-- pymeos/main/_generated/tgeompoint_methods.py | 4 +- pymeos/main/_generated/trgeometry_methods.py | 60 ++++++++++++-------- 3 files changed, 48 insertions(+), 32 deletions(-) diff --git a/pymeos/main/_generated/tgeogpoint_methods.py b/pymeos/main/_generated/tgeogpoint_methods.py index d4b86e4e..50ca724d 100644 --- a/pymeos/main/_generated/tgeogpoint_methods.py +++ b/pymeos/main/_generated/tgeogpoint_methods.py @@ -85,7 +85,7 @@ def at(self, other): """Generated regular ``at``. MEOS Functions: - tgeo_at_geom, tgeo_at_stbox, tgeo_at_value, tpoint_at_elevation, tpoint_at_geom, tpoint_at_value + tgeo_at_geom, tgeo_at_stbox, tgeo_at_value, tpoint_at_elevation """ from ...boxes import STBox @@ -109,7 +109,9 @@ def disjoint(self, other): """ from ..tpoint import TGeogPoint - if isinstance(other, TGeogPoint): + if isinstance(other, shpb.BaseGeometry): + result = tdisjoint_tgeo_geo(self._inner, geo_to_gserialized(other, True)) + elif isinstance(other, TGeogPoint): result = tdisjoint_tgeo_tgeo(self._inner, other._inner) else: raise TypeError(f"Operation not supported with type {other.__class__}") @@ -187,7 +189,9 @@ def intersects(self, other): """ from ..tpoint import TGeogPoint - if isinstance(other, TGeogPoint): + if isinstance(other, shpb.BaseGeometry): + result = tintersects_tgeo_geo(self._inner, geo_to_gserialized(other, True)) + elif isinstance(other, TGeogPoint): result = tintersects_tgeo_tgeo(self._inner, other._inner) else: raise TypeError(f"Operation not supported with type {other.__class__}") @@ -217,7 +221,9 @@ def is_always_within_distance(self, other, distance): """ from ..tpoint import TGeogPoint - if isinstance(other, TGeogPoint): + if isinstance(other, shpb.BaseGeometry): + result = adwithin_tgeo_geo(self._inner, geo_to_gserialized(other, True), distance, True) + elif isinstance(other, TGeogPoint): result = adwithin_tgeo_tgeo(self._inner, other._inner, distance, True) else: raise TypeError(f"Operation not supported with type {other.__class__}") @@ -259,7 +265,7 @@ def minus(self, other): """Generated regular ``minus``. MEOS Functions: - tgeo_minus_geom, tgeo_minus_stbox, tgeo_minus_value, tpoint_minus_elevation, tpoint_minus_geom, tpoint_minus_value + tgeo_minus_geom, tgeo_minus_stbox, tgeo_minus_value, tpoint_minus_elevation """ from ...boxes import STBox diff --git a/pymeos/main/_generated/tgeompoint_methods.py b/pymeos/main/_generated/tgeompoint_methods.py index d997e851..219dd719 100644 --- a/pymeos/main/_generated/tgeompoint_methods.py +++ b/pymeos/main/_generated/tgeompoint_methods.py @@ -97,7 +97,7 @@ def at(self, other): """Generated regular ``at``. MEOS Functions: - tgeo_at_geom, tgeo_at_stbox, tgeo_at_value, tpoint_at_elevation, tpoint_at_geom, tpoint_at_value + tgeo_at_geom, tgeo_at_stbox, tgeo_at_value, tpoint_at_elevation """ from ...boxes import STBox @@ -289,7 +289,7 @@ def minus(self, other): """Generated regular ``minus``. MEOS Functions: - tgeo_minus_geom, tgeo_minus_stbox, tgeo_minus_value, tpoint_minus_elevation, tpoint_minus_geom, tpoint_minus_value + tgeo_minus_geom, tgeo_minus_stbox, tgeo_minus_value, tpoint_minus_elevation """ from ...boxes import STBox diff --git a/pymeos/main/_generated/trgeometry_methods.py b/pymeos/main/_generated/trgeometry_methods.py index 416d6c24..5aa82e9c 100644 --- a/pymeos/main/_generated/trgeometry_methods.py +++ b/pymeos/main/_generated/trgeometry_methods.py @@ -16,14 +16,12 @@ from __future__ import annotations -from datetime import datetime from typing import TYPE_CHECKING import shapely.geometry.base as shpb from pymeos_cffi import * -from ...collections import TsTzSet, TsTzSpan, TsTzSpanSet -from ...collections.pose import Pose, PoseSet +from ...collections.pose import Pose from ...temporal import Temporal from ..tpoint import TPoint @@ -99,7 +97,7 @@ def at(self, other): """Generated regular ``at``. MEOS Functions: - trgeometry_at_geom, trgeometry_at_stbox, trgeometry_at_timestamptz, trgeometry_at_tstzset, trgeometry_at_tstzspan, trgeometry_at_tstzspanset, trgeometry_at_value, trgeometry_at_values + trgeometry_at_geom, trgeometry_at_stbox, trgeometry_at_value """ from ...boxes import STBox @@ -107,22 +105,28 @@ def at(self, other): result = trgeometry_at_value(self._inner, other._inner) elif isinstance(other, shpb.BaseGeometry): result = trgeometry_at_geom(self._inner, geometry_to_gserialized(other)) - elif isinstance(other, PoseSet): - result = trgeometry_at_values(self._inner, other._inner) elif isinstance(other, STBox): result = trgeometry_at_stbox(self._inner, other._inner, True) - elif isinstance(other, datetime): - result = trgeometry_at_timestamptz(self._inner, datetime_to_timestamptz(other)) - elif isinstance(other, TsTzSet): - result = trgeometry_at_tstzset(self._inner, other._inner) - elif isinstance(other, TsTzSpan): - result = trgeometry_at_tstzspan(self._inner, other._inner) - elif isinstance(other, TsTzSpanSet): - result = trgeometry_at_tstzspanset(self._inner, other._inner) else: return super().at(other) return Temporal._factory(result) + def disjoint(self, other): + """Generated regular ``disjoint``. + + MEOS Functions: + tdisjoint_geo_trgeometry, tdisjoint_trgeometry_geo, tdisjoint_trgeometry_trgeometry + """ + from ..trgeometry import TRgeometry + + if isinstance(other, shpb.BaseGeometry): + result = tdisjoint_trgeometry_geo(self._inner, geometry_to_gserialized(other)) + elif isinstance(other, TRgeometry): + result = tdisjoint_trgeometry_trgeometry(self._inner, other._inner) + else: + raise TypeError(f"Operation not supported with type {other.__class__}") + return Temporal._factory(result) + def distance(self, other): """Generated regular ``distance``. @@ -201,6 +205,22 @@ def ever_touches(self, other): raise TypeError(f"Operation not supported with type {other.__class__}") return result == 1 + def intersects(self, other): + """Generated regular ``intersects``. + + MEOS Functions: + tintersects_geo_trgeometry, tintersects_trgeometry_geo, tintersects_trgeometry_trgeometry + """ + from ..trgeometry import TRgeometry + + if isinstance(other, shpb.BaseGeometry): + result = tintersects_trgeometry_geo(self._inner, geometry_to_gserialized(other)) + elif isinstance(other, TRgeometry): + result = tintersects_trgeometry_trgeometry(self._inner, other._inner) + else: + raise TypeError(f"Operation not supported with type {other.__class__}") + return Temporal._factory(result) + def is_always_covers(self, other): """Generated regular ``is_always_covers``. @@ -293,7 +313,7 @@ def minus(self, other): """Generated regular ``minus``. MEOS Functions: - trgeometry_minus_geom, trgeometry_minus_stbox, trgeometry_minus_timestamptz, trgeometry_minus_tstzset, trgeometry_minus_tstzspan, trgeometry_minus_tstzspanset, trgeometry_minus_value, trgeometry_minus_values + trgeometry_minus_geom, trgeometry_minus_stbox, trgeometry_minus_value """ from ...boxes import STBox @@ -301,18 +321,8 @@ def minus(self, other): result = trgeometry_minus_value(self._inner, other._inner) elif isinstance(other, shpb.BaseGeometry): result = trgeometry_minus_geom(self._inner, geometry_to_gserialized(other)) - elif isinstance(other, PoseSet): - result = trgeometry_minus_values(self._inner, other._inner) elif isinstance(other, STBox): result = trgeometry_minus_stbox(self._inner, other._inner, True) - elif isinstance(other, datetime): - result = trgeometry_minus_timestamptz(self._inner, datetime_to_timestamptz(other)) - elif isinstance(other, TsTzSet): - result = trgeometry_minus_tstzset(self._inner, other._inner) - elif isinstance(other, TsTzSpan): - result = trgeometry_minus_tstzspan(self._inner, other._inner) - elif isinstance(other, TsTzSpanSet): - result = trgeometry_minus_tstzspanset(self._inner, other._inner) else: return super().minus(other) return Temporal._factory(result) From cebabf0b6960de5a6bd28494aeaac303933c3901 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Esteban=20Zim=C3=A1nyi?= Date: Thu, 12 Nov 2026 18:36:00 +0100 Subject: [PATCH 4/6] Expect the answers of MEOS master in the WKB, delete, touches and rigid geometry tests The hex WKB of an STBox states the type of the box after the byte-order byte, 1900 in little-endian, so the STBox X((1,1),(2,2)) of the tests writes 01190001000000000000F03F0000000000000040000000000000F03F0000000000000040, the hex of the MobilityDB manual for asHexWKB of that box, and the Z, T, XT and ZT boxes write their body after the same code. delete of the first timestamp of a sequence, with the default connect, answers the value from its second instant on, the bound inclusive: the sequence [1@2019-09-01, 2@2019-09-02] of TInt gives [2@2019-09-02], and the sequence set gives {[2@2019-09-02],[1@2019-09-03, 1@2019-09-05]}, for TBool, TInt, TFloat, TText, TGeomPoint and TGeogPoint alike. ever_touches of a temporal point and Point(1 1) is False for every subtype, a point touching a geometry where it lies on the boundary of the geometry and a point having an empty boundary; the same values touch the unit square, whose corner Point(1 1) they all stand on, and the test asserts that too. The ever and always relationship tests of TRgeometry read contains, covered by, covers and touches on the body placed at the poses of the sequence held with step interpolation, read disjoint, within distance and intersects on the body in linear motion, and assert that contains of the body in linear motion raises MeosInvalidArgValueError. Why. MobilityDB 721bb8a350 has the WKB of every box state its type; 7e13618f6c deletes a timestamp as the timestamp set of one element, connect joining the instants around it, which its 50 expected outputs and meos/test/delete_timestamptz_test.c state; dc7040170f answers eTouches(tgeompoint, geometry 'Point(1 1)') false, as 070_tpoint_spatialrels expects since; and cf60d0866c refuses contains, covers and touches of a temporal rigid geometry in linear motion, which moves and turns between its instants, as 154_trgeo_spatialrels expects with "Operation not supported for temporal values with linear interpolation". The tests expected the answers of MEOS before these commits. Witness. Against the libmeos of MobilityDB c5174b8af1, stbox_as_hexwkb of the five boxes answers each former string with 1900 after its first byte; temporal_delete_timestamptz of tint '[1@2001-01-01, 2@2001-01-02, 1@2001-01-03]' at 2001-01-01 with connect answers [2@2001-01-02, 1@2001-01-03], the expected output of 022_temporal, and at 2019-09-01 on the test's sequence it answers what temporal_delete_tstzset of {2019-09-01} answers; etouches_tpoint_geo answers 0 on the two inputs of 070_tpoint_spatialrels that expect f and 1 on the triangle that expects t, and GEOS answers Point(1 1) touches Point(1 1) false; the 22 relationship assertions of TRgeometry answer as the tests state on the step body, and the 10 contains, covers and touches ones raise on the linear body. The suite reads 4868 passed, 0 failed and 0 skipped, from 21 failed and 4847 passed. ruff check and ruff format find nothing. --- tests/boxes/stbox_test.py | 10 +++++----- tests/main/tbool_test.py | 4 ++-- tests/main/tfloat_test.py | 4 ++-- tests/main/tgeogpoint_test.py | 6 ++---- tests/main/tgeompoint_test.py | 19 ++++++++++--------- tests/main/tint_test.py | 4 ++-- tests/main/trgeometry_test.py | 33 +++++++++++++++++++++++---------- tests/main/ttext_test.py | 4 ++-- 8 files changed, 48 insertions(+), 36 deletions(-) diff --git a/tests/boxes/stbox_test.py b/tests/boxes/stbox_test.py index dcc56572..10d6a0c1 100644 --- a/tests/boxes/stbox_test.py +++ b/tests/boxes/stbox_test.py @@ -451,20 +451,20 @@ def test_repr(self, stbox, expected): [ ( stbx, - "0101000000000000F03F0000000000000040000000000000F03F0000000000000040", + "01190001000000000000F03F0000000000000040000000000000F03F0000000000000040", ), ( stbz, - "0111000000000000F03F0000000000000040000000000000F03F0000000000000040000000000000F03F0000000000000040", + "01190011000000000000F03F0000000000000040000000000000F03F0000000000000040000000000000F03F0000000000000040", ), - (stbt, "010227000300A01E4E713402000000F66B85340200"), + (stbt, "0119000227000300A01E4E713402000000F66B85340200"), ( stbxt, - "010327000300A01E4E713402000000F66B85340200000000000000F03F0000000000000040000000000000F03F0000000000000040", + "0119000327000300A01E4E713402000000F66B85340200000000000000F03F0000000000000040000000000000F03F0000000000000040", ), ( stbzt, - "011327000300A01E4E713402000000F66B85340200000000000000F03F0000000000000040000000000000F03F0000000000000040000000000000F03F0000000000000040", + "0119001327000300A01E4E713402000000F66B85340200000000000000F03F0000000000000040000000000000F03F0000000000000040000000000000F03F0000000000000040", ), ], ids=["STBox X", "STBox Z", "STBox T", "STBox XT", "STBox ZT"], diff --git a/tests/main/tbool_test.py b/tests/main/tbool_test.py index d71d658e..2dcb7de5 100644 --- a/tests/main/tbool_test.py +++ b/tests/main/tbool_test.py @@ -1248,12 +1248,12 @@ def test_update(self, temporal, instant, expected): ( tbs, datetime(year=2019, month=9, day=1, tzinfo=timezone.utc), - TBoolSeqSet("{(True@2019-09-01, False@2019-09-02]}"), + TBoolSeq("[False@2019-09-02]"), ), ( tbss, datetime(year=2019, month=9, day=1, tzinfo=timezone.utc), - TBoolSeqSet("{(True@2019-09-01, False@2019-09-02],[True@2019-09-03, True@2019-09-05]}"), + TBoolSeqSet("{[False@2019-09-02],[True@2019-09-03, True@2019-09-05]}"), ), ], ids=[ diff --git a/tests/main/tfloat_test.py b/tests/main/tfloat_test.py index fd12b4d0..ad8c854a 100644 --- a/tests/main/tfloat_test.py +++ b/tests/main/tfloat_test.py @@ -1739,12 +1739,12 @@ def test_update(self, temporal, instant, expected): ( tfs, datetime(year=2019, month=9, day=1, tzinfo=timezone.utc), - TFloatSeqSet("{(1.5@2019-09-01, 2.5@2019-09-02]}"), + TFloatSeq("[2.5@2019-09-02]"), ), ( tfss, datetime(year=2019, month=9, day=1, tzinfo=timezone.utc), - TFloatSeqSet("{(1.5@2019-09-01, 2.5@2019-09-02],[1.5@2019-09-03, 1.5@2019-09-05]}"), + TFloatSeqSet("{[2.5@2019-09-02],[1.5@2019-09-03, 1.5@2019-09-05]}"), ), ], ids=[ diff --git a/tests/main/tgeogpoint_test.py b/tests/main/tgeogpoint_test.py index b30d449b..deb9c849 100644 --- a/tests/main/tgeogpoint_test.py +++ b/tests/main/tgeogpoint_test.py @@ -2030,14 +2030,12 @@ def test_update(self, temporal, instant, expected): ( tps, datetime(year=2019, month=9, day=1, tzinfo=timezone.utc), - TGeogPointSeqSet("{(Point(1 1)@2019-09-01, Point(2 2)@2019-09-02]}"), + TGeogPointSeq("[Point(2 2)@2019-09-02]"), ), ( tpss, datetime(year=2019, month=9, day=1, tzinfo=timezone.utc), - TGeogPointSeqSet( - "{(Point(1 1)@2019-09-01, Point(2 2)@2019-09-02],[Point(1 1)@2019-09-03, Point(1 1)@2019-09-05]}" - ), + TGeogPointSeqSet("{[Point(2 2)@2019-09-02],[Point(1 1)@2019-09-03, Point(1 1)@2019-09-05]}"), ), ], ids=[ diff --git a/tests/main/tgeompoint_test.py b/tests/main/tgeompoint_test.py index 551cd9fe..9e0c7bca 100644 --- a/tests/main/tgeompoint_test.py +++ b/tests/main/tgeompoint_test.py @@ -2124,14 +2124,12 @@ def test_update(self, temporal, instant, expected): ( tps, datetime(year=2019, month=9, day=1, tzinfo=timezone.utc), - TGeomPointSeqSet("{(Point(1 1)@2019-09-01, Point(2 2)@2019-09-02]}"), + TGeomPointSeq("[Point(2 2)@2019-09-02]"), ), ( tpss, datetime(year=2019, month=9, day=1, tzinfo=timezone.utc), - TGeomPointSeqSet( - "{(Point(1 1)@2019-09-01, Point(2 2)@2019-09-02],[Point(1 1)@2019-09-03, Point(1 1)@2019-09-05]}" - ), + TGeomPointSeqSet("{[Point(2 2)@2019-09-02],[Point(1 1)@2019-09-03, Point(1 1)@2019-09-05]}"), ), ], ids=[ @@ -2958,21 +2956,24 @@ def test_temporal_ever_contained_withindist_intersects(self, temporal, expected) assert temporal.ever_intersects(Point(1, 1)) == expected assert temporal.ever_intersects(TGeomPointInst("Point(1 1)@2019-09-01")) == expected - # etouches_tpoint_geo, the function of eTouches(tgeompoint, geometry): the - # boundary of the trajectory of a sequence starting at Point(1 1) holds - # Point(1 1), and a trajectory of points has an empty boundary + # etouches_tpoint_geo, the function of eTouches(tgeompoint, geometry): a + # point touches a geometry where it lies on the boundary of the geometry, + # and Point(1 1) has an empty boundary, so no temporal point touches it, + # while every value below stands at Point(1 1), a corner of the unit square; + # two geometries per value, as #test_temporal_ever_contained_withindist_intersects @pytest.mark.parametrize( "temporal, expected", [ (tpi, False), (tpds, False), - (tps, True), - (tpss, True), + (tps, False), + (tpss, False), ], ids=["Instant", "Discrete Sequence", "Sequence", "SequenceSet"], ) def test_temporal_ever_touches(self, temporal, expected): assert temporal.ever_touches(Point(1, 1)) == expected + assert temporal.ever_touches(Polygon([(0, 0), (1, 0), (1, 1), (0, 1), (0, 0)])) is True @pytest.mark.parametrize( "temporal, expected", diff --git a/tests/main/tint_test.py b/tests/main/tint_test.py index 28c51eed..eed67000 100644 --- a/tests/main/tint_test.py +++ b/tests/main/tint_test.py @@ -1482,12 +1482,12 @@ def test_update(self, temporal, instant, expected): ( tis, datetime(year=2019, month=9, day=1, tzinfo=timezone.utc), - TIntSeqSet("{(1@2019-09-01, 2@2019-09-02]}"), + TIntSeq("[2@2019-09-02]"), ), ( tiss, datetime(year=2019, month=9, day=1, tzinfo=timezone.utc), - TIntSeqSet("{(1@2019-09-01, 2@2019-09-02],[1@2019-09-03, 1@2019-09-05]}"), + TIntSeqSet("{[2@2019-09-02],[1@2019-09-03, 1@2019-09-05]}"), ), ], ids=[ diff --git a/tests/main/trgeometry_test.py b/tests/main/trgeometry_test.py index 27fab869..e7aa4ba7 100644 --- a/tests/main/trgeometry_test.py +++ b/tests/main/trgeometry_test.py @@ -2,6 +2,7 @@ from datetime import datetime, timezone import pytest +from pymeos_cffi import MeosInvalidArgValueError from shapely import Point, Polygon from pymeos import ( @@ -167,32 +168,44 @@ class TestTRgeometrySpatialRelationships(TestTRgeometry): far_trs = TRgeometry.from_geometry_tpose( geometry, TPoseSeq("[Pose(Point(100 100), 0)@2019-09-01, Pose(Point(101 101), 0)@2019-09-02]") ) + # A body in linear motion moves and turns between its poses: intersects, + # disjoint and within distance read that motion, while contains, covers and + # touches refuse it and read the body at the same poses held with step + # interpolation; the assertions are those of #TestTCbufferSpatialRelationships. + trs_step = TRgeometry.from_geometry_tpose( + geometry, TPoseSeq("Interp=Step;[Pose(Point(1 1), 0.5)@2019-09-01, Pose(Point(2 2), 0.3)@2019-09-02]") + ) def test_ever_relationships(self): - assert self.trs.is_ever_contained_in(self.around) is True - assert self.trs.is_ever_coveredby(self.around) is True - assert self.trs.is_ever_coveredby(self.far) is False - assert self.trs.is_ever_covers(self.far) is False + assert self.trs_step.is_ever_contained_in(self.around) is True + assert self.trs_step.is_ever_coveredby(self.around) is True + assert self.trs_step.is_ever_coveredby(self.far) is False + assert self.trs_step.is_ever_covers(self.far) is False + with pytest.raises(MeosInvalidArgValueError): + self.trs.is_ever_contained_in(self.around) assert self.trs.is_ever_disjoint(self.far) is True assert self.trs.is_ever_disjoint(self.far_trs) is True assert self.trs.is_ever_within_distance(self.far, 1.0) is False assert self.trs.is_ever_within_distance(self.far_trs, 1000.0) is True assert self.trs.ever_intersects(self.around) is True assert self.trs.ever_intersects(self.far_trs) is False - assert self.trs.ever_touches(self.far) is False + assert self.trs_step.ever_touches(self.far) is False + # The always twin of #test_ever_relationships. def test_always_relationships(self): - assert self.trs.is_always_contained_in(self.around) is True - assert self.trs.is_always_coveredby(self.around) is True - assert self.trs.is_always_coveredby(self.far) is False - assert self.trs.is_always_covers(self.far) is False + assert self.trs_step.is_always_contained_in(self.around) is True + assert self.trs_step.is_always_coveredby(self.around) is True + assert self.trs_step.is_always_coveredby(self.far) is False + assert self.trs_step.is_always_covers(self.far) is False + with pytest.raises(MeosInvalidArgValueError): + self.trs.is_always_contained_in(self.around) assert self.trs.is_always_disjoint(self.far) is True assert self.trs.is_always_disjoint(self.far_trs) is True assert self.trs.is_always_within_distance(self.far, 1.0) is False assert self.trs.is_always_within_distance(self.far_trs, 1000.0) is True assert self.trs.always_intersects(self.around) is True assert self.trs.always_intersects(self.far_trs) is False - assert self.trs.always_touches(self.far) is False + assert self.trs_step.always_touches(self.far) is False class TestTRgeometryRestrictions(TestTRgeometry): diff --git a/tests/main/ttext_test.py b/tests/main/ttext_test.py index f63d1a16..8da73bc7 100644 --- a/tests/main/ttext_test.py +++ b/tests/main/ttext_test.py @@ -1249,12 +1249,12 @@ def test_update(self, temporal, instant, expected): ( tts, datetime(year=2019, month=9, day=1, tzinfo=timezone.utc), - TTextSeqSet("{(AAA@2019-09-01, BBB@2019-09-02]}"), + TTextSeq("[BBB@2019-09-02]"), ), ( ttss, datetime(year=2019, month=9, day=1, tzinfo=timezone.utc), - TTextSeqSet("{(AAA@2019-09-01, BBB@2019-09-02],[AAA@2019-09-03, AAA@2019-09-05]}"), + TTextSeqSet("{[BBB@2019-09-02],[AAA@2019-09-03, AAA@2019-09-05]}"), ), ], ids=[ From c530ac3bd92d0ba2996c1522fabe8bea963af64a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Esteban=20Zim=C3=A1nyi?= Date: Thu, 12 Nov 2026 21:55:39 +0100 Subject: [PATCH 5/6] Expect the insertion into a temporal sequence set connected as connect says test_insert[SequenceSet] of tbool, tfloat, tgeogpoint, tgeompoint, tint and ttext reads the insertion of an instant sequence one day after the last sequence of the set, with connect, as that sequence extended to it, {[1@2019-09-01, 2@2019-09-02],[1@2019-09-03, 1@2019-09-06]} for tint, as temporal_insert answers since MobilityDB 82458a3238 (Insert a temporal sequence set connecting its sequences as connect says) and as test_insert[Sequence] reads the insertion into a sequence. Witness. Against the libmeos of MobilityDB master 7eb4ef3446 with the insertion of an instant on the exclusive lower bound of a sequence (MobilityDB #3626), the whole suite passes 4868 of 4868; against master alone, test_insert passes and the six test_update[SequenceSet] fail, which insert the instant on that bound. --- tests/main/tbool_test.py | 4 +--- tests/main/tfloat_test.py | 2 +- tests/main/tgeogpoint_test.py | 2 +- tests/main/tgeompoint_test.py | 2 +- tests/main/tint_test.py | 2 +- tests/main/ttext_test.py | 2 +- 6 files changed, 6 insertions(+), 8 deletions(-) diff --git a/tests/main/tbool_test.py b/tests/main/tbool_test.py index 2dcb7de5..c84dc687 100644 --- a/tests/main/tbool_test.py +++ b/tests/main/tbool_test.py @@ -1198,9 +1198,7 @@ class TestTBoolModifications(TestTBool): ( tbss, TBoolSeq("[True@2019-09-06]"), - TBoolSeqSet( - "{[True@2019-09-01, False@2019-09-02],[True@2019-09-03, True@2019-09-05],[True@2019-09-06]}" - ), + TBoolSeqSet("{[True@2019-09-01, False@2019-09-02],[True@2019-09-03, True@2019-09-06]}"), ), ], ids=["Instant", "Discrete Sequence", "Sequence", "SequenceSet"], diff --git a/tests/main/tfloat_test.py b/tests/main/tfloat_test.py index ad8c854a..13f10ba1 100644 --- a/tests/main/tfloat_test.py +++ b/tests/main/tfloat_test.py @@ -1693,7 +1693,7 @@ class TestTFloatModifications(TestTFloat): ( tfss, TFloatSeq("[1.5@2019-09-06]"), - TFloatSeqSet("{[1.5@2019-09-01, 2.5@2019-09-02],[1.5@2019-09-03, 1.5@2019-09-05],[1.5@2019-09-06]}"), + TFloatSeqSet("{[1.5@2019-09-01, 2.5@2019-09-02],[1.5@2019-09-03, 1.5@2019-09-06]}"), ), ], ids=["Instant", "Discrete Sequence", "Sequence", "SequenceSet"], diff --git a/tests/main/tgeogpoint_test.py b/tests/main/tgeogpoint_test.py index deb9c849..cd69f7ab 100644 --- a/tests/main/tgeogpoint_test.py +++ b/tests/main/tgeogpoint_test.py @@ -1977,7 +1977,7 @@ class TestTGeogPointModifications(TestTGeogPoint): tpss, TGeogPointSeq("[Point(1 1)@2019-09-06]"), TGeogPointSeqSet( - "{[Point(1 1)@2019-09-01, Point(2 2)@2019-09-02],[Point(1 1)@2019-09-03, Point(1 1)@2019-09-05],[Point(1 1)@2019-09-06]}" + "{[Point(1 1)@2019-09-01, Point(2 2)@2019-09-02],[Point(1 1)@2019-09-03, Point(1 1)@2019-09-06]}" ), ), ], diff --git a/tests/main/tgeompoint_test.py b/tests/main/tgeompoint_test.py index 9e0c7bca..7a6ec933 100644 --- a/tests/main/tgeompoint_test.py +++ b/tests/main/tgeompoint_test.py @@ -2071,7 +2071,7 @@ class TestTGeomPointModifications(TestTGeomPoint): tpss, TGeomPointSeq("[Point(1 1)@2019-09-06]"), TGeomPointSeqSet( - "{[Point(1 1)@2019-09-01, Point(2 2)@2019-09-02],[Point(1 1)@2019-09-03, Point(1 1)@2019-09-05],[Point(1 1)@2019-09-06]}" + "{[Point(1 1)@2019-09-01, Point(2 2)@2019-09-02],[Point(1 1)@2019-09-03, Point(1 1)@2019-09-06]}" ), ), ], diff --git a/tests/main/tint_test.py b/tests/main/tint_test.py index eed67000..5919c1c3 100644 --- a/tests/main/tint_test.py +++ b/tests/main/tint_test.py @@ -1440,7 +1440,7 @@ class TestTIntModifications(TestTInt): ( tiss, TIntSeq("[1@2019-09-06]"), - TIntSeqSet("{[1@2019-09-01, 2@2019-09-02],[1@2019-09-03, 1@2019-09-05],[1@2019-09-06]}"), + TIntSeqSet("{[1@2019-09-01, 2@2019-09-02],[1@2019-09-03, 1@2019-09-06]}"), ), ], ids=["Instant", "Discrete Sequence", "Sequence", "SequenceSet"], diff --git a/tests/main/ttext_test.py b/tests/main/ttext_test.py index 8da73bc7..bd6ab3e6 100644 --- a/tests/main/ttext_test.py +++ b/tests/main/ttext_test.py @@ -1203,7 +1203,7 @@ class TestTTextModifications(TestTText): ( ttss, TTextSeq("[AAA@2019-09-06]"), - TTextSeqSet("{[AAA@2019-09-01, BBB@2019-09-02],[AAA@2019-09-03, AAA@2019-09-05],[AAA@2019-09-06]}"), + TTextSeqSet("{[AAA@2019-09-01, BBB@2019-09-02],[AAA@2019-09-03, AAA@2019-09-06]}"), ), ], ids=["Instant", "Discrete Sequence", "Sequence", "SequenceSet"], From be543fc9924a16242614ae644b923ff0f4f4f6e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Esteban=20Zim=C3=A1nyi?= Date: Fri, 13 Nov 2026 00:29:31 +0100 Subject: [PATCH 6/6] Expect the geodetic meeting at noon on every platform test_temporal_equal_temporal[Sequence] and [SequenceSet] of tgeogpoint read the meeting of a temporal geography point and its reverse at 12:00 on every platform, with no expected failure on arm64, as temporal_eq answers since MobilityDB 919c0d1b58 (Answer the meeting of two temporal geography points on the one point they meet at), which evaluates both values on the one point they meet at. Witness. The strict expected failure fails the run on macos-15 arm64 against MobilityDB master 98a8fbea45, both tests passing there. Against the libmeos of that master on x86-64, the whole suite passes 4868 of 4868, and ruff check and ruff format find nothing. --- tests/main/tgeogpoint_test.py | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/tests/main/tgeogpoint_test.py b/tests/main/tgeogpoint_test.py index cd69f7ab..58c1d161 100644 --- a/tests/main/tgeogpoint_test.py +++ b/tests/main/tgeogpoint_test.py @@ -1,4 +1,3 @@ -import platform from copy import copy from datetime import datetime, timedelta, timezone from operator import not_ @@ -2784,18 +2783,6 @@ def test_ever_equal_always_not_equal(self, temporal, argument, expected): assert temporal.never_equal(argument) == not_(expected) -# MEOS dates the meeting of two geodetic segments with the Cartesian fraction of -# tgeogpointsegm_distance_turnpt and tests the two great-circle points it interpolates there -# for exact equality, so the meeting at 12:00 is found only where the two roundings agree: on -# x86 they do, on arm64 they do not. Strict, so the mark fails the run once MEOS dates the -# meeting exactly on every platform. -GEODETIC_CROSSING_ON_ARM64 = pytest.mark.xfail( - platform.machine() in ("arm64", "aarch64"), - reason="MEOS dates a geodetic crossing by a Cartesian fraction and exact point equality", - strict=True, -) - - class TestTGeogPointTemporalComparisons(TestTGeogPoint): tpi = TGeogPointInst("Point(1 1)@2019-09-01") tpds = TGeogPointSeq("{Point(1 1)@2019-09-01, Point(2 2)@2019-09-02}") @@ -2810,20 +2797,18 @@ class TestTGeogPointTemporalComparisons(TestTGeogPoint): [ (tpi, TBoolInst("False@2019-09-01")), (tpds, TBoolSeq("{False@2019-09-01, False@2019-09-02}")), - pytest.param( + ( tps, TBoolSeqSet( "{[False@2019-09-01, True@2019-09-01 12:00:00+00],(False@2019-09-01 12:00:00+00, False@2019-09-02]}" ), - marks=GEODETIC_CROSSING_ON_ARM64, ), - pytest.param( + ( tpss, TBoolSeqSet( "{[False@2019-09-01, True@2019-09-01 12:00:00+00]," "(False@2019-09-01 12:00:00+00, False@2019-09-02],[True@2019-09-03]}" ), - marks=GEODETIC_CROSSING_ON_ARM64, ), ], ids=["Instant", "Discrete Sequence", "Sequence", "SequenceSet"],