Skip to content

Commit

Permalink
Treat the None as string "None"
Browse files Browse the repository at this point in the history
  • Loading branch information
ssolson committed Jan 11, 2024
1 parent da97b9b commit 1e88f00
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions mhkit/tests/wave/io/hindcast/test_wind_toolkit.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ def setUpClass(self):
)
self.ml.index = pd.to_datetime(self.ml.index)


self.mp = pd.read_csv(
join(datadir, "wtk_multiparm.csv"),
index_col="time_index",
Expand Down Expand Up @@ -94,6 +95,10 @@ def setUpClass(self):
},
)

# Replace NaN values in 'state' and 'county' with the string "None"
self.my_meta['state'] = self.my_meta['state'].fillna("None")
self.my_meta['county'] = self.my_meta['county'].fillna("None")

self.ml_meta = pd.read_csv(
join(datadir, "wtk_multiloc_meta.csv"),
index_col=0,
Expand All @@ -119,6 +124,9 @@ def setUpClass(self):
"offshore": "int16",
},
)
# Replace NaN values in 'state' and 'county' with the string "None"
self.ml_meta['state'] = self.ml_meta['state'].fillna("None")
self.ml_meta['county'] = self.ml_meta['county'].fillna("None")

self.mp_meta = pd.read_csv(
join(datadir, "wtk_multiparm_meta.csv"),
Expand All @@ -145,6 +153,9 @@ def setUpClass(self):
"offshore": "int16",
},
)
# Replace NaN values in 'state' and 'county' with the string "None"
self.mp_meta['state'] = self.mp_meta['state'].fillna("None")
self.mp_meta['county'] = self.mp_meta['county'].fillna("None")

@classmethod
def tearDownClass(self):
Expand Down Expand Up @@ -177,10 +188,12 @@ def test_multi_parm(self):
data_type = "1-hour"
years = [2012]
lat_lon = (17.2, -156.5) # Hawaii

parameters = ["temperature_20m", "temperature_40m"]
wtk_multiparm, meta = wtk.request_wtk_point_data(
data_type, parameters, lat_lon, years
)

assert_frame_equal(self.mp, wtk_multiparm)
assert_frame_equal(self.mp_meta, meta)

Expand Down

0 comments on commit 1e88f00

Please sign in to comment.