Skip to content

Commit

Permalink
linting
Browse files Browse the repository at this point in the history
  • Loading branch information
Jan Griesfeller committed Sep 10, 2024
1 parent 4a7b795 commit d140802
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 22 deletions.
40 changes: 20 additions & 20 deletions src/pyaro_readers/actrisebas/ActrisEbasReader.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,11 @@ class ActrisEbasTestDataNotFoundException(Exception):

class ActrisEbasTimeSeriesReader(AutoFilterReaderEngine.AutoFilterReader):
def __init__(
self,
filters=[],
tqdm_desc: str | None = None,
ts_type: str = "daily",
test_flag: bool = True,
self,
filters=[],
tqdm_desc: str | None = None,
ts_type: str = "daily",
test_flag: bool = True,
):
""" """
self._filename = None
Expand Down Expand Up @@ -134,9 +134,9 @@ def metadata(self):
return self._metadata

def read_data(
self,
urls_to_dl: dict,
tqdm_desc="reading stations",
self,
urls_to_dl: dict,
tqdm_desc="reading stations",
):
"""
read the data from EBAS thredds server
Expand All @@ -158,9 +158,9 @@ def read_data(

# put all data variables in the data struct for the moment
for d_idx, _data_var in enumerate(
self._get_ebas_data_vars(
tmp_data,
)
self._get_ebas_data_vars(
tmp_data,
)
):
# the naming of the variable in the file does not reflect the vocabulary naming ot pyaerocom's
# naming
Expand Down Expand Up @@ -234,8 +234,8 @@ def _get_ebas_data_vars(self, tmp_data, actris_var: str = None, units: str = Non
try:
# if defined, return only names that match
if (
tmp_data[data_var].attrs["units"]
== self._def_data["actris_std_units"][data_var]
tmp_data[data_var].attrs["units"]
== self._def_data["actris_std_units"][data_var]
):
data_vars.append(data_var)
except KeyError:
Expand All @@ -244,10 +244,10 @@ def _get_ebas_data_vars(self, tmp_data, actris_var: str = None, units: str = Non
return data_vars

def extract_urls(
self,
json_resp: dict,
sites_to_read: list[str] = [],
sites_to_exclude: list[str] = [],
self,
json_resp: dict,
sites_to_read: list[str] = [],
sites_to_exclude: list[str] = [],
) -> dict:
"""
small helper method to extract URLs to download from json reponse from the EBAS API
Expand All @@ -267,11 +267,11 @@ def extract_urls(
# site_data[DISTRIBUTION_ROOT_KEY] is also a list
# search for protocol DISTRIBUTION_PROTOCOL_NAME
for url_idx, distribution_data in enumerate(
site_data[DISTRIBUTION_ROOT_KEY]
site_data[DISTRIBUTION_ROOT_KEY]
):
if (
distribution_data[DISTRIBUTION_PROTOCOL_KEY]
!= DISTRIBUTION_PROTOCOL_NAME
distribution_data[DISTRIBUTION_PROTOCOL_KEY]
!= DISTRIBUTION_PROTOCOL_NAME
):
continue
else:
Expand Down
4 changes: 2 additions & 2 deletions tests/test_ActrisEbasReader.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def test_api_reading_small_data_set(self):
engine = pyaro.list_timeseries_engines()[self.engine]
#
with engine.open(
filters=filters,
filters=filters,
) as ts:
self.assertGreaterEqual(len(ts.variables()), 1)

Expand All @@ -75,7 +75,7 @@ def test_api_reading_pyaerocom_naming(self):
engine = pyaro.list_timeseries_engines()[self.engine]
#
with engine.open(
filters=filters,
filters=filters,
) as ts:
self.assertGreaterEqual(len(ts.variables()), 1)

Expand Down

0 comments on commit d140802

Please sign in to comment.