Deltares / xugrid

Xarray and unstructured grids
https://deltares.github.io/xugrid/
MIT License
64 stars 8 forks source link

Broken download of adh_san_diego #83

Closed hboisgon closed 3 months ago

hboisgon commented 1 year ago

I see that ADH_SanDiego.nc was updated two weeks ago but this results in a temporary failing of downloading with the following error message (see linked issue in hydromt https://github.com/Deltares/hydromt/issues/332 ):

ValueError: SHA256 hash of downloaded file (ADH_SanDiego.nc) does not match the known hash: expected 50f595d4a2ab84a42b22ccfa4e3a0c88a3fa6a059ad408444eeed76143a9e17b but got c09eb694a0951f5d718179ebb167d1e7c2fdb8234ba8a5bb588dae3a3610b76a. Deleted download for safety. The downloaded file may have been corrupted or the known hash may be outdated.

I am guessing this may be due to the fact that registry.txt is linked to the installed xugrid version, while dowloading download from the latest main branch rather than a branch corresponding to the installed release (in my case 0.3.0).

Maybe updating the base_url or version property here would work? https://github.com/Deltares/xugrid/blob/abb4e21a36f39369f6736ace2dd757923d4d58e8/xugrid/data/sample_data.py#L11-L17

Huite commented 1 year ago

Yes, this is what pooch suggests: https://www.fatiando.org/pooch/latest/registry-files.html#registry-files


POOCH = pooch.create(
    path=pooch.os_cache("plumbus"),
    base_url="https://github.com/rick/plumbus/raw/{version}/data/",
    version=version,
    version_dev="main",
    # We'll load it from a file later
    registry=None,
)

I guess we should do so for the entire registry.