From 89efc1655f35980960f28038836bef763561c74a Mon Sep 17 00:00:00 2001 From: abdu558 Date: Sun, 28 Jul 2024 19:57:21 +0100 Subject: [PATCH] Fix incorrect variable name and update ndbc tests --- searvey/_ndbc_api.py | 2 +- tests/ndbc_test.py | 7 ++----- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/searvey/_ndbc_api.py b/searvey/_ndbc_api.py index 7b7511d..c91c838 100644 --- a/searvey/_ndbc_api.py +++ b/searvey/_ndbc_api.py @@ -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) ] diff --git a/tests/ndbc_test.py b/tests/ndbc_test.py index d1ebf27..965b131 100644 --- a/tests/ndbc_test.py +++ b/tests/ndbc_test.py @@ -34,7 +34,7 @@ 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 @@ -42,11 +42,8 @@ def test_fetch_ndbc_station_data(): 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