feat: portable bare-name dialect generated from the canonical contract#87
Open
estebanzimanyi wants to merge 1 commit into
Open
feat: portable bare-name dialect generated from the canonical contract#87estebanzimanyi wants to merge 1 commit into
estebanzimanyi wants to merge 1 commit into
Conversation
Expose every MobilityDB operator under its canonical portable bare name (overlaps, contains, teq, nearestApproachDistance, ...) as a dedicated `pymeos.portable` module, generated from the cross-binding source of truth (MobilityDB/MEOS-API meta/portable-aliases.json, RFC #920; vendored verbatim). Each bare name dispatches, by the runtime C type of its arguments, to the exact pymeos_cffi function the operator is backed by -- the same native call the type-qualified API uses. Nothing is reimplemented, so each bare name is identical to its operator by construction. - tools/portable_aliases/: the contract plus parity logic vendored byte-identically from MEOS-API, and generate.py - pymeos/portable.py: generated; 29 bare names, type-agnostic across all six in-scope families (temporal, geo, cbuffer, npoint, pose, rgeo) - tests/test_portable_parity.py and a CI step gate the contract: 29/29 backed, 0 unbacked, all six families, zero per-binding exceptions, verified against the live binding
estebanzimanyi
added a commit
that referenced
this pull request
May 19, 2026
Reads a vendored meos-idl.json and emits one PyMEOS OO method per regular method-family member (comparison, spatial relationship, distance, restriction) into tools/oo_codegen/_preview/<family>_methods.py. Each generated method dispatches, by the argument's C-name token, to the exact pymeos_cffi backing function the hand-written surface uses, so it is identical to its hand-written counterpart by construction; nothing is reimplemented. The irregular core (constructors, conversions, accessors, transforms, I/O) stays hand-written and is counted, not dropped. tools/oo_codegen/_preview/ is a non-destructive Draft artifact the package never imports; it lets a reviewer diff the generated uniform surface against pymeos/main/*.py before any staged migration. Delivery mirrors GoMEOS PR #2; the dispatch/backing model mirrors PyMEOS PR #87. Coverage: 2833 catalogued functions fully accounted for - 107 regular methods (407 typed overloads) across all six families (cbuffer, geo, npoint, pose, rgeo, temporal), 864 hand-written core, 43 Datum-bearing internals excluded, 1519 out of scope. Zero unaccounted. Adds tests/test_oo_codegen_coverage.py (offline gate: zero unaccounted, six families, preview compiles and stays in lock-step with the generator, every backing symbol is a real catalogued function) and a CI step running the generator's accounting check.
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.
Stacked on #81 (
bump/meos-1.4).PyMEOS now exposes every MobilityDB operator under its canonical portable bare name — one name per operator, identical across every binding/engine — generated from the single cross-binding source of truth.
What
pymeos.portable(generated, dedicated namespace): 29 bare names (overlaps,contains,teq,nearestApproachDistance, …), each a callable that dispatches by the runtime C type of its arguments to the exactpymeos_cffifunction the operator is backed by — the same native call the type-qualified API uses. Nothing is reimplemented; each bare name is identical to its operator by construction.tools/portable_aliases/: the contract (portable-aliases.json) and parity logic (portable.py,portable_parity.py) vendored byte-identically fromMobilityDB/MEOS-API(RFC #920);generate.pyemitspymeos/portable.pyfrom them.Gate
tests/test_portable_parity.py(pytest) and a CI step assert: the contract is 29 bijective pairs; the generated API exposes every bare name with a non-empty backing table; parity is 29/29 backed, 0 unbacked (byte-identical to the MEOS-API logic); all six families are witnessed; every committed backing symbol exists in the live binding. Zero per-binding exceptions. The CI step regeneratespymeos/portable.pyfrom the MEOS built in CI so the shipped module always matches the binding.Follow-up
An optional ergonomic top-level re-export can be added if desired; the dedicated
pymeos.portablenamespace is intentional to avoid shadowing existing class methods.