arc_stations = [[0, 10, 20, 30], [210, 220, 230, 240]]
arc_ws = [2.33, 2.33]
spiral_stations = [[140, 150, 160, 170], [490, 500, 510, 520]]
spiral_w_increasing = [0.29, -0,29]
stations = [0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 110, 120, 130, 140, 150, 160, 170, 180, 190, 200, 210, 220, 230, 240, 250, 260, 270, 280, 290, 300, 9000]
speed_at_arc_station = []
for values, multiplier in zip(arc_stations, arc_ws):
saas_map = {value: round(multiplier * (i + 1), 2) for i, value in enumerate(values)}
speed_at_arc_station.extend(saas_map.items())
mapped_arcs = [{k: v} for k, v in speed_at_arc_station]
speed_at_spriral_station = []
for values, multiplier in zip(spiral_stations, spiral_w_increasing):
saps_map = mappings = {value: round(abs(multiplier * (i + 1)), 2) for i, value in enumerate(values)}
speed_at_spriral_station.extend(saps_map.items())
mapped_spirals = [{k: v} for k, v in speed_at_spriral_station]
mapped_alignment_elements = {}
for mapping in mapped_arcs:
for key, value in mapping.items():
key = str(key)
value = float(value)
mapped_alignment_elements[key] = max(mapped_alignment_elements.get(key, float('-inf')), value)
for mapping in mapped_spirals:
for key, value in mapping.items():
key = str(key)
value = float(value)
mapped_alignment_elements[key] = max(mapped_alignment_elements.get(key, float('-inf')), value)
s_w = [{k: v} for k, v in mapped_alignment_elements.items()]
w_list = []
for station in stations:
station_str = str(station)
if station_str in mapped_alignment_elements:
w_list.append(mapped_alignment_elements[station_str])
else:
w_list.append(0)
print(w_list)
OUT = w_list
It is exactly the same as in Dynamo. Values are similar, not the orginal, because they are more than 20000. Here it is working fine, but If I use it in Dynamo, I’m getting only [0, 0, 0, … ]
EDIT.1: I tried only with station variable from dynamo and I still get the problem.
EDIT.2: Even with same values, but when I exported them to excel and then created new list, it is working…
EDIT.3:This code block is making the issue. No matter If I round it, it makes issue.
If I manually add values, instead ot writting a…b…c it works fine.