Added generator and coroutine support for netcdf streaming

#2 Open

Bitbucket cannot automatically merge this request.

The commits that make up this pull request have been removed.

Bitbucket cannot automatically merge this request due to conflicts.

Review the conflicts on the Overview tab. You can then either decline the request or merge it manually on your local system using the following commands:

hg update default
hg pull -r default
hg merge 9f6569f082f6
hg commit -m 'Merged in hiebert/pupynere_fork (pull request #2)'
  1. hiebert
  • Implemented netcdf_file._write() to use a generator
    • changed self.variables to be stored as an OrderedDict subclass to enforce iteration order on self.variables
    • removed all of the self.fp.write() calls from base functions
    • rewrote all of the metadata generating functions to return the bytes rather than write them
    • rewrote all metadata generating functions to avoid any seek()ing (requires a first pass over the header to calculate offsets)
    • added a __generate__() function which streams the output using yields
  • added helper functions for streaming netcdfs using generators or coroutines
    • When instantiating netcdf_file, added the option to not provide a filename, so that it's essentially just a metadata container
    • added a filesize property which calculates the projected file sizes for metadata only objects
    • added a set_numrecs function to netcdf_file (since the number of records must be set in the header
    • added nc_generator() and nc_coroutine() for setting up a netcdf pipeline and streaming netcdfs

Comments (0)