pyugrid/pyugrid — pull request #39 by brandonmayer (2014-07-16 14:06:04+00:00)
Title: added global attribute Conventions='UGRID-0.9' when saving pyugrid as netcdf file

pyugrid has the ability to save topologies as a netcdf files using pyugrid.UGrid.save_as_netcdf but this function was not saving the global attribute `Convention = 'UGRID-0.9'` guaranteed by the [netcdf ugrid standard](https://github.com/ugrid-conventions/ugrid-conventions).

This modification adds the the `Conventions` global attribute as a hard coded string in the save_as_netcdf function. A more proper approach would be to make a netcdf version string globally available which would be reference within the save_as_netcdf function and a secondary purpose of this pull request is to begin a discussion about where this version string should be stored (if said variable is deemed appropriate by the community). I think it should be a static class variable on ugrid or in the top level __init__.py, i.e., ugrid_netcdf_version='0.9' which could change as pyugrid is adopted to future versions of the ugrid standard.

My use case for this change is for incorporating pyugrid in sci-wms to achieve ugrid conformance and improve modularity asascience-open/sci-wms#120. sci-wms caches grid topologies as netcdf files and it would be most convenient to open all cache topologies using netcdf then determine if the topology is a ugrid by checking the `Conventions` attribute and proceed to build the topology using pyugrid.UGrid.from_nc_dataset if appropriate.

@rsignell-usgs Please review at your convenience.

@brianmckenna @daf @kknee