Skip to content

Ili24 minimal - #1

Draft
3nids wants to merge 69 commits into
masterfrom
ili24-minimal
Draft

3nids wants to merge 69 commits into
masterfrom
ili24-minimal

Conversation

@3nids

@3nids 3nids commented Oct 22, 2026 •

Copy link
Copy Markdown
Member

not meant to be merged, just to see the diff and potentially discuss to push upstream

@3nids
3nids marked this pull request as draft October 22, 2026 19:48
vvmruder and others added 24 commits November 30, 2026 21:45
- A 2.3 class extending a class with an OID got a second `TID` field next to the inherited `tid`, so the value was lost.
- Associations whose roles both allow at most one object were lost.
- Association attributes were never generated, neither on association classes nor on embedded roles.
- Associations with an OID definition never got their TID.
- A 2.3 BOUNDARY could hold only one POLYLINE, although the refman allows several.
- XML BLACKBOX was a plain string, so any XML content inside it was lost.
- Enumeration values stayed plain text, so even an unknown value like `QUATSCH` passed unchecked.
- Extended enumerations lacked the values of their base, e.g. `ausser_Betrieb` in SIA405_Abwasser.
- 2.3 had no escaping of python keywords, so an attribute named `from` broke the class.
- Reading an XTF with classes of the other INTERLIS version failed with an unrelated "unknown property" error.
- The documentation of coord and line types was written after `Meta`, so it was no docstring.
A line type declared inline in an attribute has no ElementInPackage in
the IMD, only an LTParent, the attribute it belongs to. `LineType.from_imd`
took that for "not the same package as the coord type" and qualified the
coord type with its tid, e.g. `StructureItems_V1.Coord2`. In a class of a
topic that resolves, the topic module imports the model. In a structure
of the model it does not: the rendered module of the model has no name
`StructureItems_V1`, and `RuntimeLibrary.build()` fails the same way:

    NameError: name 'StructureItems_V1' is not defined

This takes the package of a local type from the class of its attribute,
as `get_model_name_from_type` already does, and compares the packages of
the line type and of the coord type: the same package names the coord
type by its name.

Found in ili2django, which generates the Django models of DMAV and reads
XTF with the runtime classes; a test model of its own, a structure with
an inline POLYLINE over a COORD domain of the model, could not be built.

The handwritten model StructureLine24_V1 holds both cases, an inline
POLYLINE in a structure of the model and one in a class of the topic.
The tests of the type names, of the runtime build and of the import of
the rendered library fail without the fix.
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.

3 participants