Skip to content

Commit

Permalink
fix concat issue
Browse files Browse the repository at this point in the history
  • Loading branch information
d-chambers committed Jan 4, 2024
1 parent 5d09f7d commit b2e537f
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions tests/test_utils/test_stations_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
from obsplus.utils.time import to_utc
from obsplus.interfaces import StationClient
from obsplus.exceptions import AmbiguousResponseError
from obsplus.utils.time import to_timedelta64


class TestDfToInventory:
Expand Down Expand Up @@ -86,13 +87,14 @@ def inv_df_duplicate_channels(self, df_from_inv):
start/end dates.
"""
# first add duplicates of fur with different start/end times
df_from_inv["end_date"] = np.datetime64("2020-01-01")
df_from_inv["end_date"] = np.datetime64("2020-01-01", "ns")
sub_fur = df_from_inv[df_from_inv["station"] == "FUR"]
year = np.timedelta64(365, "D")
year = to_timedelta64(3600) * 24 * 365
sub_fur["end_date"] = sub_fur["start_date"] - year
sub_fur["start_date"] = sub_fur["end_date"] - 3 * year
new_df = pd.concat([df_from_inv, sub_fur], ignore_index=True).reset_index(
drop=True
new_df = (
pd.concat([df_from_inv, sub_fur], axis=0)
.reset_index(drop=True)
)
return new_df

Expand Down

0 comments on commit b2e537f

Please sign in to comment.