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

Add tokens to the collections #33

Open
mgrover1 opened this issue Dec 20, 2021 · 4 comments
Open

Add tokens to the collections #33

mgrover1 opened this issue Dec 20, 2021 · 4 comments

Comments

@mgrover1
Copy link
Contributor

It would be helpful, especially when cacheing datasets, to have a list of corresponding tokens for each dataset in a collection.

These could be auto-generated by dask.base.tokenize

@andersy005
Copy link
Member

These could be auto-generated by dask.base.tokenize

I'm afraid dask.base.tokenize isn't deterministic for xarray objects:

In [2]: import dask, xarray as xr, xcollection as xc

In [3]: ds = xr.tutorial.open_dataset('rasm')

In [4]: dask.base.tokenize(ds) == dask.base.tokenize(ds)
Out[4]: False

In [5]: dask.base.tokenize(ds) == dask.base.tokenize(ds)
Out[5]: False

The issue appears to be caused by the coordinates:

In [8]: dask.base.tokenize(ds.Tair.data) == dask.base.tokenize(ds.Tair.data)
Out[8]: True
In [16]: dask.base.tokenize(ds.Tair._coords) == dask.base.tokenize(ds.Tair._coords)
Out[16]: False

@mgrover1
Copy link
Contributor Author

Hmmm... I wonder if there would be any other options?

@andersy005
Copy link
Member

Hmmm... I wonder if there would be any other options?

I just re-run the example above, and things seem to work just fine: I have no idea what's going on.. pydata/xarray#4738 (comment)

@mgrover1
Copy link
Contributor Author

That is quite odd... glad it's running okay now?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 🛑 Blocked
Development

Successfully merging a pull request may close this issue.

2 participants