ioos / erddapy

Python interface for ERDDAP
https://ioos.github.io/erddapy/
BSD 3-Clause "New" or "Revised" License
77 stars 30 forks source link

test_to_iris_tabledap in test_to_objects.py fails for newer versions of iris #168

Closed kstonekuan closed 3 years ago

kstonekuan commented 3 years ago

It seems that newer versions of iris (installed using pip3 install scitools-iris) no longer supports the method extract_strict() for the CubeList object.

The latest documentation for iris CubeList can be found here: https://scitools-iris.readthedocs.io/en/stable/generated/api/iris/cube.html#iris.cube.CubeList.extract

Documentation for an older version with extract_strict: https://scitools.org.uk/iris/docs/v2.4.0/iris/iris/cube.html?highlight=cubelist#iris.cube.CubeList.extract_strict

This leads to the following error when using pytest:

―――――――――――――――――――――――――――――――――――――――――――――――― test_to_iris_tabledap ―――――――――――――――――――――――――――――――――――――――――――――――――

taodata = <erddapy.erddapy.ERDDAP object at 0x7fc80e26f400>

    @pytest.mark.web
    @pytest.mark.vcr()
    def test_to_iris_tabledap(taodata):
        cubes = taodata.to_iris()

        assert isinstance(cubes, iris.cube.CubeList)
>       assert isinstance(cubes.extract_strict("depth"), iris.cube.Cube)
E       AttributeError: 'CubeList' object has no attribute 'extract_strict'

tests/test_to_objects.py:80: AttributeError

Will there be any issue with just using extract() method?

ocefpaf commented 3 years ago

Will there be any issue with just using extract() method?

I believe that the extract_cube is the equivalent. I sent a PR to fix that b/c that is "on me" and the tests must run properly before students start coding.