feat: better localization of shards
Signed-off-by: Konstantin Fickel <mail@konstantinfickel.de>
This commit is contained in:
parent
79095bad4a
commit
4dbd142c74
3 changed files with 61 additions and 14 deletions
|
|
@ -22,16 +22,18 @@ def localize_shard(
|
|||
adjusted_moment: datetime = extract_datetime_from_marker_list(shard.markers, moment)
|
||||
|
||||
for marker in shard.markers:
|
||||
normalized_marker = marker.lower()
|
||||
if marker in config.markers:
|
||||
marker_definition = config.markers[marker]
|
||||
for placement in marker_definition.placements:
|
||||
if set(placement.if_with) <= set(shard.markers):
|
||||
dimension = config.dimensions[placement.dimension]
|
||||
|
||||
if marker_definition := config.markers[normalized_marker]:
|
||||
dimension_name = marker_definition.dimension
|
||||
dimension = config.dimensions[marker_definition.dimension]
|
||||
value = placement.value or marker
|
||||
|
||||
if dimension.propagate:
|
||||
position[dimension_name] = normalized_marker
|
||||
else:
|
||||
private_position[dimension_name] = normalized_marker
|
||||
if dimension.propagate:
|
||||
position[placement.dimension] = value
|
||||
else:
|
||||
private_position[placement.dimension] = value
|
||||
|
||||
children = [
|
||||
localize_shard(child, config, position, adjusted_moment)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue