OnroerendErfgoed / brdr

BRDR - a Python library to assist in realigning (multi-)polygons (OGC Simple Features) to reference borders
MIT License
3 stars 0 forks source link

refactor the structure of the (internal) dicts: dict_series, dict_predicted,.... #57

Open dieuska opened 1 week ago

dieuska commented 1 week ago

In the current code, when executing a series of calculation for multiple relevant distances, the result is arranged by relevant distance: (key = relevant distance). It should be better to always give results arranged on thematic_id (key=thematic_id) because most of the functionalities is based on the fact that we want to do calculations, predictions etc. for all thematic objects.

At the moment this structure has to be re-arranged multiple times (util-function: dict_series_by_keys). If we would do this refactoring, this re-arrangement shouldn't be necessary anymore resulting in less handling.

So I would propose to always give results in following order: image

This could be a big refactoring as this is used in multiple functions

dieuska commented 1 week ago

@roefem what do you think about this remark?

roefem commented 1 week ago

Seems good to me, I don't see any issues with reordering the way dict_series is composed

dieuska commented 3 days ago

when executing; to test if this refactoring is really faster? (at least it looks more logic to me to do this refactoring