Open schlunma opened 1 month ago
Here's the extract from the ESMVT testing of 3.9:
def __getitem__(self, key):
if key not in self._cache:
if key == 'numberOfSection':
value = self._number
else:
if key not in self._keys:
key2 = KEY_ALIAS.get(key)
if key2 and key2 in self._keys:
key = key2
else:
emsg = f"{key} not defined in section {self._number}"
> raise KeyError(emsg)
E KeyError: 'indicatorOfUnitOfTimeRange not defined in section 4'
Sorry, the ESMValTool tests work indeed fine, but when I try to open the file mentioned above I get another error:
>>> import iris
>>> path = "polar_stereo.grib2"
>>> cubes = iris.load(path)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/manuel/micromamba/envs/xxx/lib/python3.12/site-packages/iris/__init__.py", line 330, in load
return _load_collection(uris, constraints, callback).merged().cubes()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/manuel/micromamba/envs/xxx/lib/python3.12/site-packages/iris/__init__.py", line 298, in _load_collection
result = _CubeFilterCollection.from_cubes(cubes, constraints)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/manuel/micromamba/envs/xxx/lib/python3.12/site-packages/iris/cube.py", line 95, in from_cubes
for cube in cubes:
^^^^^
File "/home/manuel/micromamba/envs/xxx/lib/python3.12/site-packages/iris/__init__.py", line 279, in _generate_cubes
for cube in iris.io.load_files(part_names, callback, constraints):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/manuel/micromamba/envs/xxx/lib/python3.12/site-packages/iris/io/__init__.py", line 212, in load_files
handling_format_spec = FORMAT_AGENT.get_spec(os.path.basename(fn), fh)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/manuel/micromamba/envs/xxx/lib/python3.12/site-packages/iris/io/format_picker.py", line 150, in get_spec
raise ValueError(msg)
ValueError: No format specification could be found for the given buffer. Perhaps a plugin is missing or has not been loaded. File element cache:
{'UriProtocol()': 'file', 'LeadingLine()': "b'\\n'", 'MagicNumber(4, None)': '168430090', 'MagicNumber(8, None)': '723401728380779553', 'DataSourceObjectProtocol()': 'polar_stereo.grib2', 'FileExtension()': '.grib2', 'MagicNumber(100, None)': 'b\'\\n\\n\\n\\n\\n\\n<!DOCTYPE html>\\n<html\\n lang="en"\\...'}
Loading the file with iris_grib.load_cubes(path)
seems to work fine (there's no error).
This is my environment:
Name Version Build Channel
─────────────────────────────────────────────────
iris 3.10.0 pyha770c72_1 conda-forge
iris-grib 0.20.0 pyhd8ed1ab_1 conda-forge
'b\'\n\n\n\n\n\n<!DOCTYPE html>\n<html\n lang="en"\...'
Looks like something has downloaded an HTML file, not a (binary) GRIB file ??
Reading the file
iris_sample_data/sample_data/polar_stereo.grib2
with the latest iris 3.10 produces the following error for me:Here is my environment:
With iris 3.9, we also get an error, but a slightly different one: https://app.circleci.com/pipelines/github/ESMValGroup/ESMValCore/11527/workflows/2dea67e4-e4c9-4f8e-87fc-bb960e0b7849/jobs/48457/parallel-runs/0/steps/0-105. I did not test this locally though, so it could also be a problem of the CI machine.