Skip to content

importing rioxarray instead of xarray to open rasterio file#474

Merged
fneum merged 4 commits intomasterfrom
rioxarray-to-envs
Apr 21, 2023
Merged

importing rioxarray instead of xarray to open rasterio file#474
fneum merged 4 commits intomasterfrom
rioxarray-to-envs

Conversation

@virio-andreyana
Copy link
Copy Markdown
Collaborator

@virio-andreyana virio-andreyana commented Feb 15, 2023

closes #644
closes #476

Importing rioxarray instead of xarray to open rasterio file. This is to fix the warning in rule build_ship_raster: open_rasterio is Deprecated in favor of rioxarray. For information about transitioning, see: https://corteva.github.io/rioxarray/stable/getting_started/getting_started.html

changes had been made in the environment and environment.fixed to add rioxarray

Checklist

  • I tested my contribution locally and it seems to work fine.
  • Code and workflow changes are sufficiently documented.
  • Newly introduced dependencies are added to envs/environment.yaml and envs/environment.docs.yaml.
  • Changes in configuration options are added in all of config.default.yaml, config.tutorial.yaml, and test/config.test1.yaml.
  • Changes in configuration options are also documented in doc/configtables/*.csv and line references are adjusted in doc/configuration.rst and doc/tutorial.rst.
  • A note for the release notes doc/release_notes.rst is amended in the format of previous release notes.

Copy link
Copy Markdown
Member

@fneum fneum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I remember @p-glaum tested this and had some problems as well.

@p-glaum
Copy link
Copy Markdown
Contributor

p-glaum commented Feb 15, 2023

I remember @p-glaum tested this and had some problems as well.

yes, I wanted to use rioxarray as well because I already got the deprecation warning at the time I wrote the shipping raster script. But somehow with rioxarray I could not open the raster data and I think it always crashed. So I switched back to xarray. But if it works now with rioxarray I would also change it as you did @virio-andreyana

@FabianHofmann
Copy link
Copy Markdown
Contributor

@p-glaum do you remember the reason why we you did not choose to convert the tif to a netcdf file in the first place?

@p-glaum
Copy link
Copy Markdown
Contributor

p-glaum commented Feb 16, 2023

No sorry. I remember I took that detour because the direct way was not working due to some error. If I remember correctly, Python was always crashing with the tif file

@FabianHofmann FabianHofmann marked this pull request as ready for review April 20, 2023 18:03
@FabianHofmann FabianHofmann requested a review from fneum April 21, 2023 08:01
@FabianHofmann
Copy link
Copy Markdown
Contributor

@fneum I can fix the pre-commit CI in separate PR

@fneum
Copy link
Copy Markdown
Member

fneum commented Apr 21, 2023

Looks good!

@fneum fneum merged commit 0c3868b into master Apr 21, 2023
@fneum fneum deleted the rioxarray-to-envs branch April 21, 2023 08:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Restore compatibility with newest xarray

4 participants