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

Load nonindex coords ahead of concat() #1551

Merged
merged 13 commits into from
Oct 9, 2017

Conversation

crusaderky
Copy link
Contributor

@crusaderky crusaderky commented Sep 2, 2017

@@ -208,6 +219,8 @@ def _dataset_concat(datasets, dim, data_vars, coords, compat, positions):
dim, coord = _calc_concat_dim_coord(dim)
datasets = [as_dataset(ds) for ds in datasets]
datasets = align(*datasets, join='outer', copy=False, exclude=[dim])
# TODO: compute dask coords with a single invocation of dask.compute()
datasets = [_load_coords(ds) for ds in datasets]
Copy link
Member

@shoyer shoyer Sep 4, 2017

Choose a reason for hiding this comment

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

We only need this if the argument coords='different' is set. Otherwise we don't load coords to determine if they are equal or not.

@@ -208,6 +219,8 @@ def _dataset_concat(datasets, dim, data_vars, coords, compat, positions):
dim, coord = _calc_concat_dim_coord(dim)
datasets = [as_dataset(ds) for ds in datasets]
datasets = align(*datasets, join='outer', copy=False, exclude=[dim])
# TODO: compute dask coords with a single invocation of dask.compute()
Copy link
Member

@shoyer shoyer Sep 4, 2017

Choose a reason for hiding this comment

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

Yes, this would be even better :).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I didn't bother as it would be a considerable complication and it would not do any good in the most common case where the "dask" variable is just a lazy load from disk

@shoyer
Copy link
Member

shoyer commented Sep 4, 2017 via email

@jhamman jhamman modified the milestone: 0.10 Sep 5, 2017
@rabernat
Copy link
Contributor

rabernat commented Sep 6, 2017

I think this should help with #1385.

@crusaderky
Copy link
Contributor Author

New, much better version.
There's one test failure but that's actually because now it triggers #1586.
combine.py should be final; need to add more unit tests.

Fix loads when vars are found different halfway through
@crusaderky
Copy link
Contributor Author

Finished. One more test failure, as it now triggers #1588 too.

@crusaderky
Copy link
Contributor Author

Should be ready to be merged immediately after #1589 and #1590

@crusaderky
Copy link
Contributor Author

@shoyer ready to merge if there's no outstanding critiques

Copy link
Member

@shoyer shoyer left a comment

Choose a reason for hiding this comment

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

Looks great. Let's merge after syncing the latest changes from master.

There is still room for improving the logic in concat but this is a clear step forward.

@@ -268,6 +269,7 @@ def test_concat(self):
with self.assertRaisesRegexp(ValueError, 'not a valid argument'):
concat([foo, bar], dim='w', data_vars='minimal')

@pytest.mark.xfail(reason='https://github.com/pydata/xarray/issues/1586')
Copy link
Member

Choose a reason for hiding this comment

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

I just merged your other PR -- can you remove this now?

@crusaderky
Copy link
Contributor Author

@shoyer ready for merge

@jhamman jhamman merged commit 14b5f1c into pydata:master Oct 9, 2017
@crusaderky crusaderky deleted the load_nonindex_coords branch October 9, 2017 23:32
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.

5 participants