Description
Currently, in Global_POI and POI, there are two ways names are set:
via Enum
in the
poi.level_one_info": "Any",
poi.level_two_info": "Any",
tag.
via info dict
poi.info["label_name"] header. See mrk.json import and export
- Change all functions manipulating pois, so that "label_names" are also transferred.
- Make it possible to use [idx, "level2name"], and ["level1name", "level2name"] can be used instead of ids.
- Make it possible everywhere to use an Enum (and just pull the .value for the int). print a warning if the level_*_info is not set, but someone is using an enum.
- make a property or function that returns level_one_name via the two index (or enum)
- make a property or function that returns label_name via the one index (or enum)
- update the datastrukter (still be able to load the old one from the POI file) instead of poi.info["label_name"]["(ID , ID)"] convert the ids into ints and make the dict in two levels. make it possible to give the first level a name per ID. save them in the new format except for mrk.json this is fixed.
old:
"label_name": {"(1, 2)": "C2"}
new:
"label_name": {
1: {
2: "C2",
"name":"Spine",
}
}
when saved new format.
label_name has a higher pro than the level_x_info, but throws a warning if the name is not in the level_x_info but level_x_info is given.
https://github.com/Hendrik-code/TPTBox/blob/main/TPTBox/core/poi.py
https://github.com/Hendrik-code/TPTBox/blob/main/TPTBox/core/poi_fun/poi_global.py
https://github.com/Hendrik-code/TPTBox/blob/main/TPTBox/core/poi_fun/save_mkr.py
https://github.com/Hendrik-code/TPTBox/blob/main/TPTBox/core/poi_fun/save_load.py
Description
Currently, in Global_POI and POI, there are two ways names are set:
via Enum
in the
poi.level_one_info": "Any",
poi.level_two_info": "Any",
tag.
via info dict
poi.info["label_name"] header. See mrk.json import and export
old:
"label_name": {"(1, 2)": "C2"}
new:
"label_name": {
1: {
2: "C2",
"name":"Spine",
}
}
when saved new format.
label_name has a higher pro than the level_x_info, but throws a warning if the name is not in the level_x_info but level_x_info is given.
https://github.com/Hendrik-code/TPTBox/blob/main/TPTBox/core/poi.py
https://github.com/Hendrik-code/TPTBox/blob/main/TPTBox/core/poi_fun/poi_global.py
https://github.com/Hendrik-code/TPTBox/blob/main/TPTBox/core/poi_fun/save_mkr.py
https://github.com/Hendrik-code/TPTBox/blob/main/TPTBox/core/poi_fun/save_load.py