Drive functions.py codegen from meos-idl.json#18
Draft
estebanzimanyi wants to merge 4 commits into
Draft
Conversation
Replaces the regex-over-builder/meos.h parser in build_pymeos_functions.py with a JSON loader that consumes the IDL produced by MEOS-API. build_header.py keeps producing builder/meos.h for CFFI cdef compilation; only the wrapper-generation step now reads the structured catalog. Picks up 13 functions the regex silently dropped (meos_error, tfloat_avg_value, geo_get_srid, geog_from_binary, meos_basetype + family, temptype_subtype/_all, mfjson skiplist_make) and normalises meos_set_spatial_ref_sys_csv's argument from a raw const char* cast to an encoded str. json_object-bearing signatures are filtered out to match build_header.py's undefined-types skip.
build_pymeos_functions.py used to carry two hardcoded sets enumerating which params are extra Python returns (22 entries) and which accept None (52 entries). Both sets are now populated from the IDL's shape field, which MEOS-API ships in meta/meos-meta.json so every binding reads the same catalog. result_parameters stays local because the override (out-param replaces the bool return when truthy) is PyMEOS-CFFI ergonomic, not a fact about the C API. Re-vendoring the IDL also picks up the missing outputArrays entries for tpoint_as_mvtgeom, which previously took gsarr / timesarr as Python lists rather than as out-parameters; the regenerated wrapper now returns (result, gsarr, timesarr).
The previous build_pymeos_functions.py output_parameters set was missing tpoint_as_mvtgeom's gsarr and timesarr entries, which made the wrapper take both as user-facing list arguments rather than as output parameters; the shape-driven consolidation corrects that and the regenerated wrapper now returns (result, gsarr, timesarr). The smoke test now reflects on the wrapper's signature with inspect.signature so the gsarr / timesarr parameters are asserted absent from the user-facing arglist. Also adds an explicit meos_initialize(None) call to exercise the shape.nullable path for tz_str.
The previous attempt called meos_initialize(None) and immediately meos_finalize() to exercise shape.nullable for tz_str; the double-init / finalize cycle aborts with SIGABRT (exit 134) on Linux, which masks the actual codegen signal. Move the nullable check to inspect.signature so the annotation is verified statically (the parameter must accept None) and the live MEOS lifecycle stays a single happy-path init/finalize. tpoint_as_mvtgeom's output-parameter regression guard is unchanged.
ba735f0 to
a888355
Compare
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.
Replaces the regex-over-builder/meos.h parser in build_pymeos_functions.py with a JSON loader that consumes the IDL produced by MEOS-API. build_header.py keeps producing builder/meos.h for CFFI cdef compilation; only the wrapper-generation step now reads the structured catalog. Picks up 13 functions the regex silently dropped (meos_error, tfloat_avg_value, geo_get_srid, geog_from_binary, meos_basetype + family, temptype_subtype/_all, mfjson skiplist_make) and normalises meos_set_spatial_ref_sys_csv's argument from a raw const char* cast to an encoded str. json_object-bearing signatures are filtered out to match build_header.py's undefined-types skip. Stacks on bump/meos-1.3 (#17); IDL accuracy relies on MEOS-API #1 (the stdbool stub) being merged before the next regen.