Skip to content

feat: portable bare-name dialect generated from the canonical contract#87

Open
estebanzimanyi wants to merge 1 commit into
bump/meos-1.4from
feat/portable-aliases
Open

feat: portable bare-name dialect generated from the canonical contract#87
estebanzimanyi wants to merge 1 commit into
bump/meos-1.4from
feat/portable-aliases

Conversation

@estebanzimanyi
Copy link
Copy Markdown
Member

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 exact pymeos_cffi function 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.
  • Type-agnostic across all six in-scope families: temporal, geo, cbuffer, npoint, pose, rgeo.
  • tools/portable_aliases/: the contract (portable-aliases.json) and parity logic (portable.py, portable_parity.py) vendored byte-identically from MobilityDB/MEOS-API (RFC #920); generate.py emits pymeos/portable.py from 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 regenerates pymeos/portable.py from 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.portable namespace is intentional to avoid shadowing existing class methods.

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant