Skip to content

Commit

Permalink
fix to make sure all station ids are strings
Browse files Browse the repository at this point in the history
  • Loading branch information
Jan Jurgen Griesfeller committed Aug 15, 2023
1 parent ea86802 commit aa52bdf
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pyaerocom/io/read_airnow.py
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,11 @@ def _filedata_to_statlist(self, arrs, vars_to_retrieve):
mask = data[:, varcol] == var_in_file
subset = data[mask]
dtime_subset = dtime[mask]
statlist = np.unique(subset[:, statcol])
# not all stations seems to provide the station id as string...
try:
statlist = np.unique(subset[:, statcol])
except TypeError:
statlist = np.unique(str(subset[:, statcol]))

Check warning on line 409 in pyaerocom/io/read_airnow.py

View check run for this annotation

Codecov / codecov/patch

pyaerocom/io/read_airnow.py#L408-L409

Added lines #L408 - L409 were not covered by tests
for stat_id in tqdm(statlist, desc=var):
if not stat_id in stat_ids:
continue
Expand Down

0 comments on commit aa52bdf

Please sign in to comment.