home / github / issues

Menu
  • GraphQL API
  • Search all tables

issues: 603497896

This data as json

id node_id number title user state locked assignee milestone comments created_at updated_at closed_at author_association active_lock_reason draft pull_request body reactions performed_via_github_app state_reason repo type
603497896 MDU6SXNzdWU2MDM0OTc4OTY= 3986 building the visualization gallery is slow 14808389 closed 0     2 2020-04-20T20:00:51Z 2021-03-24T17:56:49Z 2021-03-24T17:56:49Z MEMBER      

When running sphinx to build the documentation, it frequently times out when trying to build the visualization gallery. Running bash /usr/bin/time -v python -c 'import xarray as xr; xr.open_rasterio("https://github.com/mapbox/rasterio/raw/master/tests/data/RGB.byte.tif")' reports that it takes at least 5 minutes (or time out after 10 minutes) if opened from the url. Subsequent calls use the cache, so the second rasterio example is fast.

If instead I download the file manually and then load from disk, the whole notebook completes in about 10 seconds. Also, directly calling rasterio.open completes in a few seconds, so the bug should be in open_rasterio.

I do think we should try to fix this in the backend, but maybe we could also cache RGB.byte.tif in the same directory as the xarray.tutorial data and open the cached file in the gallery?

Edit: this is really flaky, I can't reliably reproduce this.

Edit2: for now, I'm using a extra cell containing ```python import pathlib import shutil import requests

cache_dir = pathlib.Path.home() / ".xarray_tutorial_data" path = cache_dir / "RGB.byte.tif" url = "https://github.com/mapbox/rasterio/raw/master/tests/data/RGB.byte.tif"

if not path.exists() or path.stat().st_size == 0: with requests.get(url) as r, path.open(mode="wb") as f: if r.status_code == requests.codes.ok: shutil.copyfileobj(r.raw, f) else: print("download failed: {r.status_code}") r.raise_for_status()

url = path ``` and modify both examples to use the new url

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/3986/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  completed 13221727 issue

Links from other tables

  • 0 rows from issues_id in issues_labels
  • 2 rows from issue in issue_comments
Powered by Datasette · Queries took 0.82ms · About: xarray-datasette