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

more tutorial refactoring #5074

Merged
merged 24 commits into from
Apr 25, 2021
Merged

more tutorial refactoring #5074

merged 24 commits into from
Apr 25, 2021

Conversation

keewis
Copy link
Collaborator

@keewis keewis commented Mar 24, 2021

follow-up to #4102. This reverts the combination of tutorial.open_dataset and tutorial.open_rasterio (the concept of tutorial.open_* is "cached download+open_*"), and updates the tests to not depend on a environment variable (which makes the tests also run on macos and windows).

In #4102 I added a list of available datasets, but it would be good to add a small description. I still need descriptions for:

  • air_temperature
  • rasm
  • ROMS_example
  • era5-2mt-2019-03-uk.grib
  • RGB.byte (the readme says "derived from USGS Landsat 7 ETM imagery")

  • Passes pre-commit run --all-files
  • User visible changes (including notable bug fixes) are documented in whats-new.rst

xarray/backends/rasterio_.py Outdated Show resolved Hide resolved
@pydata pydata deleted a comment from pep8speaks Mar 25, 2021
xarray/backends/rasterio_.py Outdated Show resolved Hide resolved
@keewis
Copy link
Collaborator Author

keewis commented Mar 27, 2021

I decided to also make "shade.tif" from rasterio's test data available through tutorial.open_rasterio (doesn't have to be this file, though, I just wanted to make sure tutorial.open_rasterio can open more than one file).

This should be ready to merge as is (once the tests pass) but the dataset descriptions still need to be done.

Copy link
Collaborator Author

@keewis keewis left a comment

Choose a reason for hiding this comment

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

I dug through the history of xarray-data and tried to add a description for all datasets but I'm not sure I got everything right. If I did this should be ready for a final review and then merging.

xarray/tutorial.py Show resolved Hide resolved
@keewis
Copy link
Collaborator Author

keewis commented Apr 17, 2021

ping. Should we try to silence the

Use this value as the 'known_hash' argument of 'pooch.retrieve' to ensure that the file hasn't changed if it is downloaded again in the future.

warning? Otherwise this should be ready for merging (but please do check the dataset descriptions, I'm really not sure about those).

@shoyer
Copy link
Member

shoyer commented Apr 18, 2021 via email

@keewis
Copy link
Collaborator Author

keewis commented Apr 18, 2021

how, exactly? I can probably add a warnings filter, but we could also add tags to xarray-data and hard-code that together with the hash sums in xarray.tutorial (I think we talked about that in #4102). Thoughts, @andersy005?

@shoyer
Copy link
Member

shoyer commented Apr 18, 2021

how, exactly? I can probably add a warnings filter, but we could also add tags to xarray-data and hard-code that together with the hash sums in xarray.tutorial (I think we talked about that in #4102). Thoughts, @andersy005?

see here for an example: https://docs.python.org/3/library/warnings.html#temporarily-suppressing-warnings

@keewis
Copy link
Collaborator Author

keewis commented Apr 18, 2021

oh, sorry. I actually meant to ask whether I should use the way recommend by pooch or simply suppress the warning. I guess that still answers that question, though.

Edit: actually, that's not a warning: it seems that's a logging.info message, so I would have to filter the logs (or adjust the default log level). Not sure if that's easy to do?

@max-sixty
Copy link
Collaborator

We could do something like, which is a bit overbearing, but would solve this until it's unblocked by pooch:

logging.getLogger("google.cloud.bigquery.opentelemetry_tracing").setLevel(
    logging.CRITICAL
)

(there may well be ways of doing this only within our execution, which we could do if this is a long-term solution)

@shoyer
Copy link
Member

shoyer commented Apr 18, 2021

Pooch really shouldn't be registering it's own logger, since it's a library not an application: fatiando/pooch#232

That said, for now I agree with @max-sixty's recommendation. It's recommended in the Pooch docs, too:
https://www.fatiando.org/pooch/dev/advanced.html#adjusting-the-logging-level

@keewis
Copy link
Collaborator Author

keewis commented Apr 18, 2021

I didn't see that part of the documentation, this should be fixed now. Thanks for the hints, @max-sixty, @shoyer.

@keewis
Copy link
Collaborator Author

keewis commented Apr 25, 2021

we have to make sure to deprecate / remove xr.tutorial.open_rasterio along with xr.open_rasterio, but otherwise this is ready.

@keewis keewis merged commit 6bfbaed into pydata:master Apr 25, 2021
@keewis keewis deleted the refactor-tutorial branch April 25, 2021 10:54
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.

3 participants