Skip to content

Commit cef2a8c

Browse files
flake issues
1 parent 3000cdc commit cef2a8c

File tree

3 files changed

+22
-12
lines changed

3 files changed

+22
-12
lines changed

pygeoapi/api/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1519,7 +1519,7 @@ def validate_filter_dims(query_string):
15191519
checked = {}
15201520
for pair in query_string.split(','):
15211521
if ':' not in pair:
1522-
msg = """filter dimension and value must be separated by a colon ':' """
1522+
msg = """filter dimension and value must be separated by a colon ':' """ # noqa
15231523
LOGGER.debug(msg)
15241524
raise ValueError(msg)
15251525

pygeoapi/provider/xarray_.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ def get_dims(self):
137137
dtype = 'int'
138138
else:
139139
dtype = 'str'
140-
LOGGER.debug(f"""key: {key} with type: {type(value.values.tolist()[0])}""")
140+
LOGGER.debug(f"""key: {key} with type: {type(value.values.tolist()[0])}""") # noqa
141141
self._dims[key] = {
142142
'type': type(value.values.tolist()[0]),
143143
'title': value.attrs.get('long_name'),

pygeoapi/provider/xarray_edr.py

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@
3131

3232
import numpy as np
3333

34-
from pygeoapi.provider.base import ProviderNoDataError, ProviderQueryError, ProviderInvalidQueryError
34+
from pygeoapi.provider.base import (ProviderNoDataError, ProviderQueryError,
35+
ProviderInvalidQueryError)
3536
from pygeoapi.provider.base_edr import BaseEDRProvider
3637
from pygeoapi.provider.xarray_ import (
3738
_to_datetime_string,
@@ -122,13 +123,18 @@ def position(self, **kwargs):
122123
if isinstance(dims, dict):
123124
for coord, level in dims.items():
124125
if coord in self._dims:
125-
if self._dims[coord]['type'](level) in self._dims[coord]['values']:
126+
if self._dims[coord]['type'](level) in self._dims[coord]['values']: # noqa
126127
if self._dims[coord]['type'] == str:
127-
string_query[coord] = self._dims[coord]['type'](level)
128+
string_query[coord] = self._dims[coord]['type'](level) # noqa
128129
else:
129-
query_params[coord] = self._dims[coord]['type'](level)
130+
query_params[coord] = self._dims[coord]['type'](level) # noqa
130131
else:
131-
raise ProviderInvalidQueryError(user_msg=f"""Invalid Value '{level}' for Dimension Parameter '{coord}'. Valid Values are '{self._dims[coord]['values']}'""")
132+
raise ProviderInvalidQueryError(
133+
user_msg=(
134+
f"Invalid Value '{level}' for Dimension Parameter '{coord}'. " # noqa
135+
f"Valid Values are '{self._dims[coord]['values']}'" # noqa
136+
)
137+
)
132138

133139
data = data.sel(string_query)
134140
else:
@@ -241,18 +247,22 @@ def cube(self, **kwargs):
241247
if isinstance(dims, dict):
242248
for coord, level in dims.items():
243249
if coord in self._dims:
244-
if self._dims[coord]['type'](level) in self._dims[coord]['values']:
250+
if self._dims[coord]['type'](level) in self._dims[coord]['values']: # noqa
245251
if self._dims[coord]['type'] == str:
246-
string_query[coord] = self._dims[coord]['type'](level)
252+
string_query[coord] = self._dims[coord]['type'](level) # noqa
247253
else:
248-
query_params[coord] = self._dims[coord]['type'](level)
254+
query_params[coord] = self._dims[coord]['type'](level) # noqa
249255
else:
250256
raise ProviderInvalidQueryError(
251-
user_msg=f"""Invalid Value '{level}' for Dimension Parameter '{coord}'. Valid Values are '{self._dims[coord]['values']}'""")
257+
user_msg=(
258+
f"Invalid Value '{level}' for Dimension Parameter '{coord}'. " # noqa
259+
f"Valid Values are '{self._dims[coord]['values']}'" # noqa
260+
)
261+
)
252262

253263
data = data.sel(string_query)
254264
else:
255-
raise ProviderInvalidQueryError(user_msg=f"""Invalid Dimension Parameter '{coord}'""")
265+
raise ProviderInvalidQueryError(user_msg=f"""Invalid Dimension Parameter '{coord}'""") # noqa
256266

257267
data = data.sel(query_params)
258268
data = _convert_float32_to_float64(data)

0 commit comments

Comments
 (0)