Skip to content

Poi label names - #124

Draft
Hendrik-code wants to merge 3 commits into
mainfrom
poi-label-names
Draft

Poi label names#124
Hendrik-code wants to merge 3 commits into
mainfrom
poi-label-names

Conversation

@Hendrik-code

Copy link
Copy Markdown
Owner

No description provided.

Hendrik-code and others added 3 commits June 29, 2026 13:21
POI.copy(), _set_inplace(), POI_Global.to_other(), and calc_poi_average() dropped
the naming metadata (level_one_info, level_two_info, and with it info['label_name']),
and POI_Descriptor.copy() dropped its name<->id definition. Now every copy/derive
path preserves them, so names survive reorient/rescale/extract/map_labels/to_global/
average (all of which route through copy()). Verified preserved across those ops;
76 existing POI tests still pass.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
label_name now uses the nested form {region:{subregion:name,'name':group}} instead
of flat {'(1, 2)':'C2'}. Old flat files (and JSON string keys) are migrated on load
(normalize_label_name); saving always writes the new format (mrk.json export stays
byte-identical, fed from the nested dict). New accessors POI.label_name(region,
subregion) and POI.level_one_name(region) resolve custom names with priority over
level_two_info/level_one_info enum names (warning when a custom name diverges from a
given enum name); set_label_name/set_level_one_name write them. mrk/txt import and
join_left updated to the nested form. 89 POI tests + 8 new tests pass.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
unpack_poi_id now resolves a key part via level_one_info/level_two_info enum names
(when set) before the descriptor's definition, so poi[idx, 'level2name'] and
poi['level1name', 'level2name'] work for get/set/contains alongside ids and Enums.
Using an Enum key while the matching level_*_info is still 'Any' (unset) now emits a
warning (the .value is still used). 100 POI tests pass.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@Hendrik-code Hendrik-code self-assigned this Aug 10, 2026
@Hendrik-code Hendrik-code added the enhancement New feature or request label Aug 10, 2026
@Hendrik-code Hendrik-code linked an issue Aug 10, 2026 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make POI names first level support

1 participant