Skip to content

Explicitly use netcdf4 engine in xarray.open_dataarray to read grd files#1264

Merged
weiji14 merged 1 commit intomasterfrom
xarray_engine_netcdf4
May 7, 2021
Merged

Explicitly use netcdf4 engine in xarray.open_dataarray to read grd files#1264
weiji14 merged 1 commit intomasterfrom
xarray_engine_netcdf4

Conversation

@weiji14
Copy link
Member

@weiji14 weiji14 commented May 7, 2021

Description of proposed changes

Using xr.open_datarray(..., engine="netcdf4") to read *.grd files, especially for the load_earth_relief function. Needed for xarray v0.18 due to backend API changes.

Fixes #1262

Reminders

  • Run make format and make check to make sure the code follows the style guide.
  • Add tests for new features or tests that would have caught the bug that you're fixing.
  • Add new public functions/methods/classes to doc/api/index.rst.
  • Write detailed docstrings for all functions/methods.
  • If adding new functionality, add an example to docstrings or tutorials.

Slash Commands

You can write slash commands (/command) in the first line of a comment to perform
specific operations. Supported slash commands are:

  • /format: automatically format and lint the code
  • /test-gmt-dev: run full tests on the latest GMT development version

@weiji14 weiji14 added the bug Something isn't working label May 7, 2021
@weiji14 weiji14 added this to the 0.4.0 milestone May 7, 2021
@weiji14 weiji14 self-assigned this May 7, 2021
@weiji14 weiji14 marked this pull request as ready for review May 7, 2021 03:17
@weiji14 weiji14 merged commit 53b4e74 into master May 7, 2021
@weiji14 weiji14 deleted the xarray_engine_netcdf4 branch May 7, 2021 03:40
sixy6e pushed a commit to sixy6e/pygmt that referenced this pull request Dec 21, 2022
…les (GenericMappingTools#1264)

Using xr.open_datarray(..., engine="netcdf4") to read
*.grd files, especially for the load_earth_relief function.
Needed for xarray v0.18 due to backend API changes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PyGMT load_earth_relief breaks with xarray 0.18.0 (ValueError: cannot guess the engine)

2 participants