Skip to content
Snippets Groups Projects
Commit fa52bcad authored by Christoph von Oy's avatar Christoph von Oy
Browse files

Fixes

parent cdbffad3
No related branches found
No related tags found
No related merge requests found
......@@ -137,10 +137,10 @@ class TrivialDynamic(Dynamic):
return 0 <= index and index <= len(self.d_steps)
def get_indices_within_p(self, p_start, p_end):
return range(p_start, p_end)
return pd.RangeIndex(p_start, p_end)
def get_indices_within(self, i_start, i_end):
return range(i_start, i_end)
return pd.RangeIndex(i_start, i_end)
def get_index_of(self, position):
return position
......@@ -224,7 +224,7 @@ class BackedDynamic(Dynamic):
return self.step_size_p(self.indices.index(index))
def step_sizes(self):
return [self.step_size_p(position) for position in range(self.number_of_steps)]
return [self.step_size_p(position) for position in range(self.number_of_steps())]
def get_sub_dynamic_p(self, positions):
if any(position < 0 or len(self.indices) <= position for position in positions):
......@@ -482,6 +482,8 @@ def resample_from_backed(values, dynamic, source_p_start, source_p_end, target_d
source_p_end = dynamic.get_position_of(target_i_end_prev)
target_indices = target_dynamic.get_indices_within(target_i_end_prev, target_i_end)
target_values.loc[target_indices] = values[dynamic.indices[source_p_end]]
else:
source_p_end = dynamic.get_position_of(target_i_end)
for source_position in range(source_p_start, source_p_end):
target_indices = target_dynamic.get_indices_within(dynamic.indices[source_position], dynamic.indices[source_position + 1])
target_values.loc[target_indices] = values[dynamic.indices[source_position]]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment