-
Notifications
You must be signed in to change notification settings - Fork 7
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
Allow concat_dim_kwargs
in THREDDSMergedSource
#34
Changes from 8 commits
ef07890
f5977bd
3f026e1
0321b7c
7d1441e
8281f82
c1265d1
af818e6
82c3d11
27e09c4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,3 +19,4 @@ dependencies: | |
- siphon | ||
- tqdm | ||
- xarray | ||
- cfgrib |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -89,14 +89,21 @@ def _open_dataset(self): | |
else: | ||
break | ||
path = self.path[i:] | ||
if 'concat_dim' in self.xarray_kwargs: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should we maybe allow more args from http://xarray.pydata.org/en/stable/generated/xarray.open_mfdataset.html? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I like the idea of doing dataset concatenation. I think it would be beneficial not to expose the What do you think? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I see two ways here: I like your implementation suggestion. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. so concat_dim=... and xarray_kwargs for all other kwargs of open_mfdataset |
||
concat_dim = self.xarray_kwargs.pop('concat_dim') | ||
else: | ||
concat_dim = None | ||
if self.progressbar: | ||
data = [ | ||
ds(xarray_kwargs=self.xarray_kwargs).to_dask() | ||
for ds in tqdm(_match(cat, path), desc='Dataset(s)', ncols=79) | ||
] | ||
else: | ||
data = [ds(xarray_kwargs=self.xarray_kwargs).to_dask() for ds in _match(cat, path)] | ||
self._ds = xr.combine_by_coords(data, combine_attrs='override') | ||
if concat_dim: | ||
self._ds = xr.concat(data, concat_dim) | ||
else: | ||
self._ds = xr.combine_by_coords(data, combine_attrs='override') | ||
|
||
|
||
def _match(cat, patterns): | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how do I get the xr docs linked here?