-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #38 from cbcunc/fixargs
Add __main__ namespaces to all packages and add complete distribution te...
- Loading branch information
Showing
16 changed files
with
467 additions
and
87 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,7 @@ | ||
Ugrid2Shp | ||
UgridShp | ||
old | ||
*.{prj,cpg,shx,shp,dbf} | ||
*~ | ||
README.txt | ||
test_* | ||
*.pyc | ||
*.zip | ||
*.egg-info | ||
*.egg-info |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
Copyright 2015 University of North Carolina. ALL RIGHTS RESERVED. | ||
Use of this software is authorized pursuant to the terms of | ||
the accompanying LICENSE.txt. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
Brian Blanton ([email protected]) | ||
Lisa Stillwell ([email protected]) | ||
Chris Calloway ([email protected]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
Version 1.0 2015-04-23 | ||
------------------------------- | ||
- Initial release. (cbc) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
$ pip install ugrid2shp | ||
|
||
or | ||
|
||
$ python setup.py install |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
include *.txt | ||
include *.rst |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
Convert CF-UGRID netCDF files to GIS shapefiles | ||
=============================================== | ||
|
||
This package computes a GIS shapefile from a CF-UGRID compliant netCDF file. | ||
Contours are generated with matplotlib and then output using shapely and fiona. | ||
|
||
To use as a package (using a list of default arguments): | ||
|
||
>>> from ugrid2shp import ugrid2shp, defaults | ||
>>> ugrid2shp(defaults) | ||
|
||
To use as a script: | ||
|
||
usage: ugrid2shp [-h] [-d] [-s] [-w] [-x] [-z] [-n NC_FILE_NAME] | ||
[-o OUTPUT_FILE_NAME] [-v NC_VAR_NAME] [-a MIN_VAL] | ||
[-b MAX_VAL] [-c NUM_LEVELS] [-l X0 Y0 X1 Y1] | ||
[-p PROJECTION_STRING] | ||
|
||
optional arguments: | ||
-h, --help show this help message and exit | ||
-d, --debug Display diagnostics. (default: False) | ||
-s, --silent No screen diagnostic output. (default: False) | ||
-w, --writeimage Write matplotlib image to a file <outfile>.png. | ||
(default: False) | ||
-x, --showimage Display matplotlib image, user must close before | ||
continuing. (default: False) | ||
-z, --nozip No zip file output. (default: False) | ||
-n NC_FILE_NAME, --ncfilename NC_FILE_NAME | ||
Path to NetCDF file to read, or a URL to an OPeNDAP | ||
resource. (default: maxele.63.nc) | ||
-o OUTPUT_FILE_NAME, --outfilename OUTPUT_FILE_NAME | ||
Filename to write as shapefile. (default: outShape) | ||
-v NC_VAR_NAME, --ncvarname NC_VAR_NAME | ||
NetCDF variable name to render. (default: zeta_max) | ||
-a MIN_VAL, --minval MIN_VAL | ||
Smallest scalar value to render. (default: 0) | ||
-b MAX_VAL, --maxval MAX_VAL | ||
Largest scalar value to render. (default: 10) | ||
-c NUM_LEVELS, --numlevels NUM_LEVELS | ||
Number of contour levels. (default: 11) | ||
-l X0 Y0 X1 Y1, --axislimits X0 Y0 X1 Y1 | ||
Bounding box list of coordinates. (default: []) | ||
-p PROJECTION_STRING, --proj PROJECTION_STRING | ||
Projection string as Well Known Text (WKT). (default: | ||
GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS | ||
_1984",6378137.0,298.257223563]],PRIMEM["Greenwich",0. | ||
0],UNIT["Degree",0.0174532925199433]]) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
1.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[sdist] | ||
formats=zip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,44 @@ | ||
from setuptools import setup, \ | ||
find_packages | ||
from setuptools import setup | ||
from setuptools import find_packages | ||
|
||
setup(name='pyugrid', | ||
version='1.0', | ||
|
||
def version(): | ||
"""Get the version number.""" | ||
|
||
with open("VERSION.txt") as v: | ||
_version = v.read() | ||
return _version.strip() | ||
|
||
|
||
__version__ = version() | ||
|
||
|
||
def long_description(): | ||
"""Construct the long description text.""" | ||
|
||
with open("README.rst") as r: | ||
long_description_1 = r.read() | ||
with open("HISTORY.txt") as h: | ||
long_description_2 = h.read() | ||
return "\n".join([long_description_1, long_description_2, ]) | ||
|
||
|
||
setup(name='ugrid2shp', | ||
version=__version__, | ||
license="GPL2", | ||
packages=find_packages(), | ||
author='Brian O. Blanton', | ||
author_email='[email protected]', | ||
description='Compute GIS shapefiles ' | ||
description='Compute a GIS shapefile ' | ||
'from a CF-UGRID compliant netCDF file.', | ||
keywords="UGRID CF NetCDF shapefile", | ||
long_description=long_description(), | ||
url="https://github.com/renci-unc/ugrid2shp", | ||
keywords="UGRID CF NetCDF shapefile", | ||
classifiers=["Development Status :: 5 - Production/Stable", | ||
"License :: OSI Approved :: " | ||
"GNU General Public License v2 (GPLv2)", | ||
"Programming Language :: Python :: 2.7", | ||
"Topic :: Scientific/Engineering :: Atmospheric Science", | ||
"Topic :: Scientific/Engineering :: GIS", ], | ||
zip_safe=False, | ||
test_suite="ugrid2shp.tests") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#! /usr/bin/env python | ||
|
||
""" | ||
A __main__ namespace for the ugrid2shp package. | ||
""" | ||
|
||
import sys | ||
from ugrid2shp import ugrid2shp | ||
|
||
if __name__ == '__main__': | ||
ugrid2shp(sys.argv[1:]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#! /usr/bin/env python | ||
|
||
""" | ||
A __main__ namespace for the ugrid2shp package. | ||
""" | ||
|
||
import unittest | ||
from ugrid2shp.tests import test_parse_args | ||
|
||
if __name__ == '__main__': | ||
unittest.main(test_parse_args) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters