Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve exception handling in method to_iris #268

Merged
merged 3 commits into from
Sep 20, 2022

Conversation

vinisalazar
Copy link
Contributor

Hi,

this is a fix to the problem mentioned in #267.

On the ERDDAP.to_iris() method, when the cubes.realise_data() method doesn't work, it realises the data by calling cube.data. The new versions of Iris prevent creating a CubeList object using cube.data objects (as they are Numpy Arrays and not cubes), so that behaviour was modified.

Summary of changes:

  • Realise data by creating placeholder variable _
  • Don't use iris.cube.CubeList for placeholder variable

Thanks,
Vini

  - Realise data by creating placeholder variable '_'
  - Don't use CubeList for placeholder variable
@ocefpaf
Copy link
Member

ocefpaf commented Sep 19, 2022

@vinisalazar let's just constrain our minimum iris version to the latest so we can remove the rest of the try-except.

  - In environment.yaml, pin iris version as >=3.3.0
  This prevents errors in the `to_iris` methods
@vinisalazar
Copy link
Contributor Author

Thank you for the review @ocefpaf

I added the minimum version to environment.yaml, are there any other files that must be updated? e.g. requirements.txt, or even the conda-forge feedstock?

@ocefpaf
Copy link
Member

ocefpaf commented Sep 19, 2022

Can you try pinning netcdf4<1.6.1. I believe we are hitting Unidata/netcdf4-python#1192

vinisalazar added a commit to vinisalazar/erddapy that referenced this pull request Sep 19, 2022
  - Pin older version of netCDF4 to avoid Unidata/netcdf4-python#1192
  - See ioos#268 for discussion
  - Pin older version of netCDF4 to avoid Unidata/netcdf4-python#1192
  - See ioos#268 for discussion
@vinisalazar
Copy link
Contributor Author

I force-pushed a new commit that adds the netcdf4 pin to requirements-dev.txt as well.

@ocefpaf ocefpaf merged commit 6057872 into ioos:main Sep 20, 2022
@ocefpaf ocefpaf added the GSoC22 label Nov 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants