JMEOS 1.3#9
Conversation
…o run them & added .idea personal config files in the .gitignore
…n of temporal_to_tsequence (temporal.c) which was still given a string as the interpolation type instead of an integer & added TestLogger in order to trace the lifecycle of each test and the parameters used
…le & testShiftScale
…tInst has no interpolation but it used to be tested as a LINEAR one
… functions t(int,float)box_expand
…y geom_in, pgis_geography_in by geog_in, adapted ConversionUtils & TPoint files accordingly
…point_as_text now tspatial_as_text, tpoint_to_stbox now tspatial_to_stbox, tpoint_srid now tspatial_srid: tpoint_round, tpoint_start_value, tpoint_end_value left
… with a single instance or a discret sequence set of TGeogPoint/TGeomPoint, fixed assertion using a STEP print verification (Interp=Step
- Replace meos.h with v1.3 and add meos_geo.h - Update FunctionsExtractor and Generator to support new headers and types - Fix existing tests to match MEOS
…t values and output them in MF-JSON format
… such as csv and sql files
…into java + the resulting generated csv files
…tyDB, orchestrated with docker and jdbc
…nd how to run/troubleshoot them
… all MEOS C functions in functions.java
…inversed condition when sanitizing functions name
…d were causing a JVM crash with SIGSEGV: created a strategy adapted to each type of pointer to dereference or not accordingly
…ks multiple times and outputs the average of the performances
|
This PR is directly referenced in MobilityDB Discussion #861 — a new cross-platform SQL portability initiative targeting MobilityDB/PostgreSQL, MobilityDuck/DuckDB, and MobilitySpark/Spark. JMEOS 1.3's The discussion includes a portable operator → function mapping table that defines the canonical SQL name every platform should register for each MEOS function — feedback on the names from the JMEOS perspective would be valuable. |
| run: pwd | ||
|
|
||
| - name: Update apt cache | ||
| run: sudo apt-get update |
There was a problem hiding this comment.
Really needed? Seems images should be quite up to date..
| @@ -0,0 +1,901 @@ | |||
| /***************************************************************************** | |||
There was a problem hiding this comment.
Are those files still needed if we start to solely rely on the JSON generator?
There was a problem hiding this comment.
Same comment as for the files in lib, are those still needed?
There was a problem hiding this comment.
The code generation process should probably not be part of the main folder, I propose to create a new top-level folder called codegen in which we would have:
- src/ containing generator code
- test (test the generator in itself)
- main
- input/ with the json file from MEOS API
Also, add a prefix to generated files (only functions.java) => GeneratedFunctions.java (also CamelCase)
README.MD should then be updated to explain how to use the new structure to update the generated code.
There was a problem hiding this comment.
If I am not mistaken, Examples folder should live at the root of the project.
|
|
||
|
|
||
| import static org.junit.jupiter.api.Assertions.*; | ||
|
|
||
| @ExtendWith(TestLogger.class) |
There was a problem hiding this comment.
Replace with junit logger config and delete TestLogger.java
There was a problem hiding this comment.
…osIoErrorBranchTest
|
|
||
| public class MeosErrorHandler implements error_handler_fn { | ||
|
|
||
| private static final Logger logger = LoggerFactory.getLogger(MeosErrorHandler.class); |
There was a problem hiding this comment.
Add a Generic exception in case error code is not known.
JMEOS update: MEOS 1.3 compatibility, unit tests, examples, exception system
Overview
This PR brings JMEOS up to date with MEOS 1.3, fixes the entire unit test suite, adds a comprehensive set of usage examples and Jupyter notebooks, and introduces a structured Java exception system modelled after PyMEOS-CFFI.
1. MEOS 1.3 compatibility
FunctionsExtractor&FunctionsGeneratormeos.h+meos_geo.h), making it possible to include additional headers in the future (e.g.meos_cbuffer.h)functions.javafrom the updated headersNewFunctionsGeneratorFunctionsExtractor&FunctionsGeneratorfunctions.javafrom meos-idl.jsonRenamed / removed functions
tpoint_*→tgeo_*patternDockerfile
2. Unit test suite
TFloatTest,TIntTest,TTextTest,TBoolTest,STBoxTest,TBoxTest,FloatSetTest,FloatSpanTest,FloatSpanSetTest,IntSetTest,IntSpanTest,IntSpanSetTest,TextSetTest,DateSetTest,DateSpanTest,DateSpanSetTest,TsTzSetTest,TsTzSpanTest,TsTzSpanSetTest,TGeomPointTest,TGeogPointTestTestLogger, a JUnit 5 extension implementingBeforeEachCallback/AfterEachCallbackthat logs each test's name, input parameters to better trace the source error3. Usage examples & Jupyter notebooks
20+ example programs ported from the MEOS C examples:
N01_Hello_World.java01_hello_world.cN01_Hello_World_Geodetic.java01_hello_world_geodetic.cN02_AIS_Read.java02_ais_read.cN03_AIS_Assemble.java03_ais_assemble.cN03_BerlinMOD_Assemble.java03_berlinmod_assemble.cN04_AIS_Store.java04_ais_store.cN04_AIS_Stream_DB.java04_ais_stream_db.cN04_AIS_Stream_File.java04_ais_stream_file.cN05_BerlinMOD_Disassemble.java05_berlinmod_disassemble.cN06_BerlinMOD_Clip.java06_berlinmod_clip.cN07_BerlinMOD_Tile.java07_berlinmod_tile.cN08_BerlinMOD_Simplify.java08_berlinmod_simplify.cN09_BerlinMOD_Aggregate.java09_berlinmod_aggregate.cN10_AIS_Assemble_Full.javaais_assemble_full.cN11_AIS_Expand_Full.javaais_expand_full.cN12_AIS_Transform_Full.javaais_transform_full.cN13_Aggregation_Demo.java*_agg.cfilesN14_RTree_Index.javartree_example.cN15_TPoint_MakeCoords.javatpointseq_make_coords.cN16_Clustering_KMeans.javapopplaces_kmeans.cN17_Clustering_Regions_Intersecting.javaregions_intersecting.cN18_Clustering_DBSCAN.javageonames_dbscan.cTwo interactive Jupyter notebooks using the IJava kernel, allowing in-notebook execution of JMEOS code with inline results:
Jupyter_AIS.ipynb: exercices exploring AIS dataJupyter_BerlinMod_Brussels.ipynb: RTree vs Brute Force on the Brussels communes dataset4. Java exception system
Previously, errors raised by the native MEOS library were printed to the console only and there was no way to intercept them in Java via
try-catch, making robust error handling impossible in any application built on JMEOS.The new system, modelled after PyMEOS-CFFI, consists of three components:
Exception hierarchy
20 classes organised into 4 branches:
MeosInternalErrorMeosArgumentErrorMeosIoErrorMeosFeatureNotSupportedMeosErrorHandlerRegisters a C callback via the
error_handler_fninterface. On each native call, it captures the error code and message.checkError()maps the code to the appropriate Java exception and throws it.Integration in
functions.javaEvery generated wrapper function now calls
MeosErrorHandler.checkError()immediately after the native call to ensure no MEOS error can remain silent.