Skip to content

Commit 399febe

Browse files
fix indexing issue/error
1 parent a9e51f7 commit 399febe

1 file changed

Lines changed: 9 additions & 6 deletions

File tree

test_suite/test_smscg.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
""" Tests to make sure that Suisun Marsh Salinity Control Gates are operated properly
2-
"""
3-
1+
"""Tests to make sure that Suisun Marsh Salinity Control Gates are operated properly"""
42

53
import pytest
64
import os
@@ -59,11 +57,16 @@ def align_dfs(boat, flash, radial):
5957

6058
def extend_idx(df, start, end):
6159
start_row = df.iloc[0].to_frame().T
62-
start_row.index = [start]
60+
if start_row.index[0] > start:
61+
start_row.index = [start]
62+
df = pd.concat([start_row, df])
6363
end_row = df.iloc[-1].to_frame().T
64-
end_row.index = [end]
64+
if end_row.index[0] < end:
65+
end_row.index = [end]
66+
df = pd.concat([df, end_row])
67+
68+
return df
6569

66-
return pd.concat([start_row, df, end_row])
6770

6871
@pytest.mark.prerun
6972
def test_smscg_boatlock(sim_dir, params, smscg_dfs):

0 commit comments

Comments
 (0)