Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
zmoon committed Apr 7, 2023
1 parent 8ca06c3 commit af3c746
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
6 changes: 1 addition & 5 deletions monetio/obs/ish.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,10 +174,10 @@ def _clean(frame):
frame = ISH._clean_column_by_name(frame, "ws", multiplier=10) # m/s
frame = ISH._clean_column_by_name(frame, "ceiling", missing=99999)
frame = ISH._clean_column_by_name(frame, "vsb", missing=999999)
frame = ISH._clean_column_by_name(frame, "vsb", missing=99999) # m
frame = ISH._clean_column_by_name(frame, "t", multiplier=10, missing=9999) # degC
frame = ISH._clean_column_by_name(frame, "dpt", multiplier=10, missing=9999) # degC
frame = ISH._clean_column_by_name(frame, "p", multiplier=10, missing=99999) # hPa
frame = ISH._clean_column_by_name(frame, "vsb", missing=99999) # m
return frame

@staticmethod
Expand Down Expand Up @@ -307,8 +307,6 @@ def add_data(
-------
DataFrame
"""
from numpy import NaN

self.dates = pd.to_datetime(dates)
self.verbose = verbose
if verbose:
Expand Down Expand Up @@ -347,12 +345,10 @@ def add_data(
dfs = [dask.delayed(self.read_data_frame)(f) for f in objs]
dff = dd.from_delayed(dfs)
self.df = dff.compute(num_workers=n_procs)
self.df.loc[self.df.vsb == 99999, "vsb"] = NaN
else:
if verbose:
print(f"Aggregating {len(urls.name)} URLs...")
self.df = self.aggregrate_files(urls, n_procs=n_procs)
# self.df.loc[self.df.vsb == 99999, "vsb"] = NaN

if resample:
if verbose:
Expand Down
1 change: 1 addition & 0 deletions tests/test_ish.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ def test_ish_one_site(download):
} < set(df.columns), "data columns"
assert (df.t < 100).all(), "temp in degC"
assert (df.dpt < 100).all(), "temp in degC"
assert (df.vsb == 99999).sum() == 0


def test_ish_no_resample():
Expand Down

0 comments on commit af3c746

Please sign in to comment.