Skip to content

Commit

Permalink
updated for potential otehr dimensions in the candcsu6 data
Browse files Browse the repository at this point in the history
removed logger

typo

pinned pandas

fixed - to _
  • Loading branch information
Louis-Philippe Rousseau Lambert committed Sep 27, 2023
1 parent 24782a4 commit 89a5dc0
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
2 changes: 1 addition & 1 deletion msc_pygeoapi/loader/swob_realtime.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ def parse_swob(swob_file):
properties[f'{last_element}-qa'] = value
elif name == 'data_flag':
properties[f'{last_element}-data_flag-uom'] = uom
properties[f'{last_element}-data_flag-code-src'] = nest_elem.attrib['code-src'] # noqa
properties[f'{last_element}-data_flag-code_src'] = nest_elem.attrib['code-src'] # noqa
properties[f'{last_element}-data_flag-value'] = value

swob_values['properties'] = properties
Expand Down
17 changes: 10 additions & 7 deletions msc_pygeoapi/provider/candcsu6_xarray.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,12 +200,15 @@ def _get_coverage_properties(self):
if coord.lower() == 'time':
time_var = coord
continue
if self._data.coords[coord].attrs['units'] == 'degrees_north':
y_var = coord
continue
if self._data.coords[coord].attrs['units'] == 'degrees_east':
x_var = coord
continue
try:
if self._data.coords[coord].attrs['units'] == 'degrees_north':
y_var = coord
continue
if self._data.coords[coord].attrs['units'] == 'degrees_east':
x_var = coord
continue
except KeyError:
LOGGER.warning(f'unknown dimension{self._data.coords[coord]}')

if self.x_field is None:
self.x_field = x_var
Expand Down Expand Up @@ -309,7 +312,7 @@ def _to_datetime_string(self, datetime_):
value = str(value)
return value
except Exception as err:
LOGGER.error(err)
LOGGER.warning(err)

def query(self, properties=[], subsets={},
bbox=[], datetime_=None, format_='json'):
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ fiona
gdal
lxml
netcdf4
pandas<2.1
parse
pygeometa
pyproj<3.5
Expand Down

0 comments on commit 89a5dc0

Please sign in to comment.