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

Added encoding options for netCDF4 variables #50

Merged
merged 1 commit into from
Mar 7, 2014
Merged

Conversation

shoyer
Copy link
Member

@shoyer shoyer commented Mar 6, 2014

This now allows for variable specific compression.

@@ -151,7 +151,23 @@ def convert_variable(var):
data = np.asscalar(var[...])
attributes = OrderedDict((k, var.getncattr(k))
for k in var.ncattrs())
return xarray.XArray(dimensions, data, attributes,
# netCDF4 specific encoding; save _FillValue for later
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a way to throw warnings across the board for those encoding variables found but not expected by the given data store?

Copy link
Member Author

Choose a reason for hiding this comment

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

We could do that, but are we sure that's a good thing? I can see that popping up a lot of warnings when serializing a dataset from netCDF4 to netCDF3, for example...

Copy link
Contributor

Choose a reason for hiding this comment

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

Is that unreasonable? Maybe you're right. If at some point it's
worthwhile to have different logging levels as part of the package, this is
something that could be brought back in.

On Wed, Mar 5, 2014 at 4:36 PM, Stephan Hoyer notifications@github.comwrote:

In src/xray/backends.py:

@@ -151,7 +151,23 @@ def convert_variable(var):
data = np.asscalar(var[...])
attributes = OrderedDict((k, var.getncattr(k))
for k in var.ncattrs())

  •        return xarray.XArray(dimensions, data, attributes,
    
  •        # netCDF4 specific encoding; save _FillValue for later
    

We could do that, but are we sure that's a good thing? I can see that
popping up a lot of warnings when serializing a dataset from netCDF4 to
netCDF3, for example...

Reply to this email directly or view it on GitHubhttps://github.com/akleeman/xray/pull/50/files#r10326856
.

akleeman added a commit that referenced this pull request Mar 7, 2014
Added encoding options for netCDF4 variables
@akleeman akleeman merged commit b69bf8c into master Mar 7, 2014
@shoyer shoyer deleted the encoding-options branch March 19, 2014 01:13
keewis pushed a commit to keewis/xarray that referenced this pull request Jan 17, 2024
* added assert functions

* pseudocode for printing differences between trees - need tests

* equals->identical fix

* refactored to use same diff function for asserts and to check isomorphism internally

* added tests of tree diff formatting

* added option to check trees from the root

* fix bugs with assert functions
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.

3 participants