Skip to content

Commit

Permalink
flake8 fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Louis-Philippe Rousseau Lambert committed Sep 1, 2023
1 parent a15cfcd commit 47ca3dd
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions msc_pygeoapi/provider/candcsu6_xarray.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
class CanDCSU6Provider(XarrayProvider):
"""CanDCSU6 Provider"""

def __init__(self, provider_def):
def __init__(self, provider_def):
"""
Initialize object
:param provider_def: provider definition
Expand All @@ -68,8 +68,10 @@ def __init__(self, provider_def):
self.axes.append('season')
if 'Pct' in self.data:
self.axes.append('percentile')
if all(item not in self.data for item in ['2021-2050', '2041-2070', '2071-2100']):
self.axes.extend([self._coverage_properties['time_axis_label']])
if all(item not in self.data for item in
['2021-2050', '2041-2070', '2071-2100']):
self.axes.extend(
[self._coverage_properties['time_axis_label']])
else:
self.axes.append('P30Y-Avg')

Expand Down Expand Up @@ -103,7 +105,8 @@ def get_coverage_domainset(self):
'uomLabel': '%',
}])

if all(item not in self.data for item in ['1971-2000', '2021-2050', '2041-2070', '2071-2100']):
if all(item not in self.data for item in
['1971-2000', '2021-2050', '2041-2070', '2071-2100']):
time_resolution = c_props['restime']['value']
time_period = c_props['restime']['period']
domainset['generalGrid']['axis'][2]['uomLabel'] = time_period
Expand Down Expand Up @@ -331,7 +334,7 @@ def query(self, properties=[], subsets={},
msg = 'multiple scenario are not supported'
LOGGER.error(msg)
raise ProviderQueryError(msg)
elif scenario[0] is not 'SSP126':
elif scenario[0] != 'SSP126':
scenario_value = scenario[0].replace('SSP', '')
self.data = self.data.replace('126', scenario_value)
except Exception as err:
Expand Down Expand Up @@ -365,7 +368,7 @@ def query(self, properties=[], subsets={},
msg = 'multiple 30 years average are not supported'
LOGGER.error(msg)
raise ProviderQueryError(msg)
elif years_avg[0] is not '2021-2050':
elif years_avg[0] != '2021-2050':
self.data = self.data.replace('2021-2050', years_avg[0])
except Exception as err:
LOGGER.error(err)
Expand Down

0 comments on commit 47ca3dd

Please sign in to comment.