-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Dataset.encoding and unlimited dimensions for to_netcdf #1170
Changes from all commits
271a751
bedad43
c797511
affac00
ca60729
3d24610
e794165
2ba6688
b7bd0b8
fdbd55d
47442e6
2df224c
eead3e4
fac2f89
33dd062
65df346
b076c15
db964a1
cb22ba1
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 |
---|---|---|
|
@@ -57,5 +57,11 @@ def get_attrs(self): | |
def get_dimensions(self): | ||
return Frozen(self.ds.dimensions) | ||
|
||
def get_encoding(self): | ||
encoding = {} | ||
encoding['unlimited_dims'] = set( | ||
[k for k in self.ds.dimensions if self.ds.unlimited(k)]) | ||
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 don't think dap can represent unlimited dimensions: 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. Agreed, but this is pynio which does: https://www.pyngl.ucar.edu/whatsnew.shtml#Version1.4.1 |
||
return encoding | ||
|
||
def close(self): | ||
self.ds.close() |
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 would lean slightly toward just creating a
get_unlimited_dims
method rather thanget_encoding
, unless we can think of other Dataset wide encodings we might possibly add in the future.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 other encoding value that comes to mind is the dataset format (e.g. NETCDF4 vs. NETCDF3). Maybe there are others as well but nothing is mind.