diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index decb222..1a91a7c 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -96,7 +96,7 @@ jobs: # carries, or a change to them is not exercised until after it merges. # Consumers use the action; this repository owns the rules. - name: Refuse a skip, and a suite that shrank - run: tools/check-test-outcome.py "$RUNNER_TEMP/pytest.log" --min-tests 546 + run: tools/check-test-outcome.py "$RUNNER_TEMP/pytest.log" --min-tests 547 # The rules earn their place by refusing a log that carries what they # name. Both fixtures are written here rather than tracked, and the diff --git a/docs/object-model.md b/docs/object-model.md index 35f8be1..545b843 100644 --- a/docs/object-model.md +++ b/docs/object-model.md @@ -125,7 +125,7 @@ that set from the two predicates and fails until each has a class, so a base type MEOS adds reaches the model with no edit to the file. `Nsegment`, `Raquet` and `JsonPath` are the MeosTypes no membership predicate admits; the model states them, and the same gate states that it -does. `Pcschema`, `RTree`, `RTreeNNCursor`, `SPTree`, `SPNNCursor` and +does. `Pcschema`, `Raster`, `RTree`, `RTreeNNCursor`, `SPTree`, `SPNNCursor` and `MeosArray` go further: MEOS registers them in no enum at all, and they say so with a null `temptype` rather than by leaving the field out. To a binding a pointer to a struct diff --git a/meta/object-model.json b/meta/object-model.json index 4b47a51..6a49f9c 100644 --- a/meta/object-model.json +++ b/meta/object-model.json @@ -381,7 +381,8 @@ "posechain", "pcpoint", "pcpatch", - "raquet" + "raquet", + "raster" ] }, "companions": { @@ -707,6 +708,16 @@ "conditional": "RASTER", "doc": "A raster tile. A MeosType no membership predicate admits, as Nsegment is." }, + "Raster": { + "kind": "leaf", + "parent": "Value", + "prefixes": [ + "raster" + ], + "temptype": null, + "conditional": "RASTER", + "doc": "A georeferenced raster of one or more bands, the value every raster accessor, clip, warp and polygonization takes. MEOS registers it in no enum, so it names no temptype." + }, "Pcschema": { "kind": "leaf", "parent": "Value", diff --git a/tests/test_object_model.py b/tests/test_object_model.py index 26905b3..db2d9ce 100644 --- a/tests/test_object_model.py +++ b/tests/test_object_model.py @@ -241,9 +241,23 @@ def test_a_type_meos_registers_in_no_enum_still_gets_a_class(self): unregistered = {n for n, s in nodes.items() if s["kind"] == "leaf" and s["temptype"] is None} self.assertEqual(unregistered, - {"Pcschema", "RTree", "RTreeNNCursor", "SPTree", + {"Pcschema", "Raster", "RTree", "RTreeNNCursor", "SPTree", "SPNNCursor", "MeosArray"}) + def test_a_raster_is_a_class_its_functions_are_methods_of(self): + # MEOS registers no MeosType for a raster, its tile Raquet being the type the + # temporal raster values carry, while every raster function takes one first. + om = attach_object_model({"functions": [ + {"name": n, "api": "public", + "params": [{"name": "rast", "cType": "const Raster *"}]} + for n in ("raster_copy", "raster_mem_size", "raster_width") + ]}, MODEL, None)["objectModel"] + self.assertEqual(om["classes"]["Raster"]["cType"], "Raster") + names = {m["function"]: m["ooName"] for m in om["classes"]["Raster"]["methods"]} + self.assertEqual(names, {"raster_copy": "copy", "raster_mem_size": "memSize", + "raster_width": "width"}) + self.assertEqual(om["summary"]["unclassified"], 0) + def test_a_function_named_as_its_own_prefix_still_has_a_member_name(self): # `meos_pc_schema` IS its class's prefix, so dropping the prefix leaves # nothing — the one case the override table exists for.