Pull requests

#2 Open
Repository
hiebert/Pupynere_fork Pupynere_fork
Branch
default
Repository
robertodealmeida/Pupynere Pupynere
Branch
default

Added generator and coroutine support for netcdf streaming

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 https://bitbucket.org/hiebert/pupynere_fork
hg merge 2d75df3b5b6e
hg commit -m 'Merged in hiebert/pupynere_fork (pull request #2)'
Author
  1. hiebert
Reviewers
Description
  • 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)