-
Notifications
You must be signed in to change notification settings - Fork 35
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
Addressed feedback. #1
Conversation
intake_netcdf/__init__.py
Outdated
|
||
def read_chunked(self): | ||
raise Exception('read_chunked not supported for xarray containers.') | ||
self._load_metadata() | ||
return self._ds | ||
|
||
def read_partition(self, i): | ||
raise Exception('read_partition not supported for xarray containers.') |
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.
@martindurant read_partition is not implemented yet. I'm wondering if we need to support it.
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.
Right. To my mind, it should be implemented at some point, but the input is a tuple. I would keep an exception for now (but should be NotImplemented, because we may do it later).
|
||
def __init__(self, urlpath, xarray_kwargs=None, metadata=None): | ||
def __init__(self, urlpath, chunks, xarray_kwargs=None, metadata=None): |
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.
Added chunks to signature and doc string.
@@ -70,17 +77,17 @@ def _get_schema(self): | |||
|
|||
def read(self): | |||
self._load_metadata() | |||
return self._ds | |||
return self._ds.load() |
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.
Loads all the data.
|
||
def read_partition(self, i): | ||
raise Exception('read_partition not supported for xarray containers.') | ||
|
||
def to_dask(self): | ||
self._load_metadata() | ||
return self._ds.to_dask_dataframe() | ||
return self.read_chunked() |
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.
read_chunked
is will return the dataset as a lazy container, which I believe is also what we want for the to_dask
case.
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.
Agree, this should just return the xarray directly (which points to dask arrays); this would be self._ds
if you agree that read_chunked should be an exception.
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.
I like what I see here.
I feel some other members of the team should think about the issues around xarray in general.
You should enable Travis on this repo.
self._ds = None | ||
super(NetCDFSource, self).__init__( | ||
container=self.container, | ||
container=None, |
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.
Not xarray?
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.
The container is not used since we are overloading the read*
methods (Intake plugins the "hard" way). I'd rather give no information rather than false information.
|
||
def read_chunked(self): | ||
raise Exception('read_chunked not supported for xarray containers.') | ||
self._load_metadata() | ||
return self._ds |
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.
Yeah, so this is approximately correct, but it doesn't give something you can iterate over. I'm not sure whether this should be an exception just like get_partition.
|
||
def read_partition(self, i): | ||
raise Exception('read_partition not supported for xarray containers.') | ||
|
||
def to_dask(self): | ||
self._load_metadata() | ||
return self._ds.to_dask_dataframe() | ||
return self.read_chunked() |
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.
Agree, this should just return the xarray directly (which points to dask arrays); this would be self._ds
if you agree that read_chunked should be an exception.
The travis script seems to be missing install dependencies. |
Yeah. I’m still working on it but I’m on vacation with limited
connectivity. I’ll get back to it next week.
On Sat, Mar 31, 2018 at 9:09 AM Martin Durant ***@***.***> wrote:
The travis script seems to be missing install dependencies.
—
You are receiving this because you were assigned.
Reply to this email directly, view it on GitHub
<#1 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAmNGmwkloj73sW66QIielJQlWn5pa36ks5tj3_7gaJpZM4S9ooN>
.
--
Mike McCarty
Senior Software Engineer
571-317-1628 <(571)%20317-1628> | anaconda.com
<https://anaconda.com/>
<https://twitter.com/anacondainc>
<https://www.linkedin.com/company-beta/2636430/>
<https://www.facebook.com/anacondainc/>
<https://www.slideshare.net/continuumio>
|
That's fine, enjoy your relaxation |
Notes on our conversation about the future of this PR/repo (cc @jbcrail , but note that @mmccarty will presumably return to work on this when he has time). I believe the following is a reasonable course of action.
|
Thanks @martindurant I'll try to find spare cycles to make progress. I went ahead an renamed this GH repo. We should probably go ahead and merge this PR and create issues to follow up. For tracking, I moved this bullet list to an issue and created an issue for fixing CI. |
Merging to allow further progress in subsequent PRs. |
No description provided.