Bump PyMEOS to MEOS 1.4 (work in progress)#81
Draft
estebanzimanyi wants to merge 6 commits into
Draft
Conversation
Update the pin to pymeos-cffi >=1.4.0 and version to 1.4.0-alpha-1. Rename the call sites that switched from MEOS 1.3's tpoint family to the 1.4 tgeo/tspatial families: - temporal-output renames: geoset_as_ewkt/as_text/out -> spatialset_*, geoset_round -> set_round, geoset_srid -> spatialset_srid, pgis_geometry_in/geography_in -> geom_in/geog_in - tpoint_to_stbox -> tspatial_to_stbox - tpoint_at_stbox/minus_stbox -> tgeo_at_stbox/minus_stbox - tpoint_at_geom_time(t, gs, None, None) -> tpoint_at_geom(t, gs) - tpoint_minus_geom_time(t, gs, None, None) -> tpoint_minus_geom(t, gs) - tcontains/tdisjoint/tdwithin/tintersects/ttouches_tpoint_* -> *_tgeo_*, with the restr/atvalue trailing args dropped - edisjoint/edwithin/eintersects/etouches_tpoint_* -> *_tgeo_* - nad/nai/distance_tpoint_* -> *_tgeo_* - tpoint_extent_transfn -> tspatial_extent_transfn - spanset_make: dropped normalize/order args (1.4 signature is 1-arg) - STBox.expand_space: tpoint_expand_space/geo_expand_space were removed in 1.4; rebuild as (geo|tspatial)_to_stbox + stbox_expand_space Pytest collects 4480 tests on this branch. Test execution still trips on functions that need shape metadata in MEOS-API (e.g. stbox_quad_split's count output param); follow-up after MEOS-API adds those entries.
temporal_to_tsequence / temporal_to_tsequenceset now take the InterpolationType enum directly; PyMEOS was passing the legacy string form. Pass the IntEnum value (which is already what TInterpolation holds underneath). temporal_append_tinstant gained an interp argument in 1.4. It only matters when the receiver is a TInstant being promoted to a TSequence; default to STEP because LINEAR is rejected by MEOS for discrete-only base types like bool/text/integer.
Closes the rename tail surfaced by running the full pytest suite:
- tpoint_as_text / tpoint_as_ewkt -> tspatial_as_text / tspatial_as_ewkt
- tpoint_start_value / tpoint_end_value / tpoint_value_at_timestamptz /
tpoint_values / tpoint_stboxes -> tgeo_*
- tpoint_srid / tpoint_set_srid -> tspatial_srid / tspatial_set_srid
- teq/tne/ever_eq/ever_ne/always_eq/always_ne_tpoint_point -> *_tgeo_geo
- shortestline_tpoint_* -> shortestline_tgeo_*
- tgeompoint_to_tgeogpoint / tgeogpoint_to_tgeompoint ->
tgeometry_to_tgeography / tgeography_to_tgeometry
- tfloat_round / tpoint_round -> temporal_round
- tfloat_derivative -> temporal_derivative
- econtains_geo_tpoint -> econtains_geo_tgeo
- tpoint_space_split / tpoint_space_time_split -> tgeo_space_*
- lwproj_transform -> tspatial_transform (signature collapsed; PJ cache
no longer needed because MEOS 1.4 takes the SRID directly)
- tpoint_expand_space removed; rebuild as tspatial_to_stbox +
stbox_expand_space
- tpoint_trajectory gained a trailing unary_union bool argument
After these the pytest count is 4464 passed / 16 failed. The 16
remaining failures are: 8 intentional 1.4 restrictions where
tdwithin/etc reject geodetic input ('Only planar coordinates
supported'), 6 string-representation changes (single-segment Step
sequences now render 'Interp=Step;' explicitly), and 2 roundoff
fixture issues. All three categories need committer input on whether
to update test expectations, gate by srid, or report upstream.
Cherry-picks the equivalent of bump/meos-1.3 commits 52e8237 + d8f9c02 + 22110ef. PyMEOS 1.4 needs the same workflow shape: apt postgresql-server-dev-16, head_ref-first PyMEOS-CFFI checkout, and MEOS branch derived from the package version (so 1.4 picks up MEOS master / future stable-1.4 automatically).
Four assertions had expectations that didn't match the underlying math:
- tests/collections/time/dateset_test.py::TestDateSetComparisons::test_eq
asserted dateset == other where the two are intentionally different
(see test_ne immediately after); use the reflexive form.
- tests/main/tfloat_test.py::test_temporal_equal_int passes
TFloatSeq('[1.5, 2.5]').temporal_equal(1). The fixture expected
True at start (1.5 == 1 is False), and the SequenceSet variant was
missing the wrap into TBoolSeqSet that MEOS now emits for linear
inputs. Updated to all-False, wrapped correctly.
- tests/main/tfloat_test.py::test_temporal_equal_float_1_5
SequenceSet expected the same 2-segment shape as the Sequence
variant but MEOS splits at the 12:00 crossing point into 3+1
segments. Updated to the actual output.
- tests/main/tfloat_test.py::test_temporal_not_equal_int_1 asserted
False at start and True at end. For [1.5, 2.5] linearly varying,
!= 1 is True everywhere. Updated to all-True.
Pytest now 4482 / 4482 (100%).
The 1.4 surface (PR #81) cdef's meos_cbuffer.h / meos_pose.h / meos_rgeo.h, which only land in /usr/local/include when the build enables those features. Without them the cffi step bails on FileNotFoundError. Mirrors the PyMEOS-CFFI pr_build.yml flags.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pins pymeos-cffi to >=1.4.0 and renames the 1.3 tpoint-family call sites to the 1.4 tgeo/tspatial equivalents (tcontains/tdisjoint/tdwithin/tintersects/ttouches, edisjoint/edwithin/eintersects/etouches, nad/nai/distance, extent_transfn). Drops the restr/atvalue trailing args on the spatial-rel family and the None,None pair on tpoint_at_geom_time/tpoint_minus_geom_time. Renames geoset_as_ewkt/geoset_as_text/geoset_out to spatialset_as_ewkt/spatialset_as_text and geoset_round/geoset_srid to set_round/spatialset_srid. STBox.expand_space is rewritten to chain (geo|tspatial)_to_stbox with stbox_expand_space because geo_expand_space and tpoint_expand_space were removed. Pytest now collects 4480 tests and 396 pass before tbox_expand_float; tbox_expand_value is Datum-based in 1.4 and needs either a PyMEOS-CFFI Python-side helper that wraps Float8GetDatum/Int32GetDatum or an inline Datum cast on the PyMEOS side. Marking draft until those handful of Datum-bearing call sites land.