Skip to content

Commit

Permalink
Fix incorrect variable name and update ndbc tests
Browse files Browse the repository at this point in the history
  • Loading branch information
abdu558 committed Jul 28, 2024
1 parent a9c407e commit 89efc16
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
2 changes: 1 addition & 1 deletion searvey/_ndbc_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ def _fetch_ndbc(
"mode": mode,
"start_time": _resolve_start_date(now, start_dates)[0],
"end_time": _resolve_end_date(now, end_dates)[0],
"columns": columns,
"cols": columns,
}
for station_id, start_dates, end_dates in zip(station_ids, start_dates, end_dates)
]
Expand Down
7 changes: 2 additions & 5 deletions tests/ndbc_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,19 +34,16 @@ def test_fetch_ndbc_station_data():
"""
This test will attempt to get data for a single station.
"""
dataframes = ndbc.fetch_ndbc_station(
df = ndbc.fetch_ndbc_station(
station_id="SRST2",
mode="stdmet",
# test that both formats work
start_date=datetime.date(2023, 1, 1),
end_date="2023-01-10"
)

assert isinstance(dataframes, dict)
assert len(dataframes) == 1
assert "SRST2" in dataframes
df = dataframes["SRST2"]
assert isinstance(df, pd.DataFrame)

assert df.index.name == "timestamp"
assert all(
col in df.columns
Expand Down

0 comments on commit 89efc16

Please sign in to comment.