Skip to content

Commit dbf91fc

Browse files
committed
Only resample to 500 if number of test points is greater than that
1 parent fbf0724 commit dbf91fc

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

testing/utilities.py

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -170,14 +170,17 @@ def compare_ref_timeseries_df(self, df, ref_filepath):
170170

171171
# Check time is index
172172
assert(df.index.name == 'time')
173-
# Resample to 500 points.
174-
y_test = []
175-
keys = []
176-
for key in df.columns:
177-
y_test.append(self.create_test_points(df[key], n=500))
178-
keys.append(key)
179-
df_test = pd.concat(y_test, axis=1, keys=keys)
180-
df_test.index.name = 'time'
173+
# Resample to 500 points limit if needed.
174+
if len(df)>500:
175+
y_test = []
176+
keys = []
177+
for key in df.columns:
178+
y_test.append(self.create_test_points(df[key], n=500))
179+
keys.append(key)
180+
df_test = pd.concat(y_test, axis=1, keys=keys)
181+
df_test.index.name = 'time'
182+
else:
183+
df_test = df
181184
# Perform test
182185
if os.path.exists(ref_filepath):
183186
# If reference exists, check it

0 commit comments

Comments
 (0)