From 0688765ef8461821ab03201b9ddea9fa4d543e88 Mon Sep 17 00:00:00 2001 From: Bill Ladwig Date: Mon, 22 Aug 2016 11:42:49 -0600 Subject: [PATCH] Added version information. Added more distribution boiler plate. Removed unused squeeze for the algorithm metadata --- MANIFEST.in | 10 ++++++++++ README | 0 requirements.txt | 2 ++ setup.py | 41 +++++++++++++++++++++++++++------------ src/wrf/api.py | 2 ++ src/wrf/metadecorators.py | 5 +---- src/wrf/version.py | 2 ++ 7 files changed, 46 insertions(+), 16 deletions(-) create mode 100644 MANIFEST.in create mode 100644 README create mode 100644 requirements.txt create mode 100644 src/wrf/version.py diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 0000000..d9e3f28 --- /dev/null +++ b/MANIFEST.in @@ -0,0 +1,10 @@ +include README + +include fortran/*.f90 +include fortran/*.pyf +include setup.py + +recursive-include doc * +include doc/make.bat +include doc/Makefile + diff --git a/README b/README new file mode 100644 index 0000000..e69de29 diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..1d4123e --- /dev/null +++ b/requirements.txt @@ -0,0 +1,2 @@ +numpy>=1.9.0 +wrapt>=1.10 diff --git a/setup.py b/setup.py index 25634cc..116e06e 100755 --- a/setup.py +++ b/setup.py @@ -1,17 +1,6 @@ import setuptools import numpy.distutils.core -#ext1 = numpy.distutils.core.Extension( -# name = "wrf._wrfext", -# sources = ["src/wrf/wrfext.f90", -# "src/wrf/wrfext.pyf"] -# ) - -#ext2 = numpy.distutils.core.Extension( -# name = "wrf._wrfcape", -# sources = ["src/wrf/wrfcape.f90", -# "src/wrf/wrfcape.pyf"] -# ) ext1 = numpy.distutils.core.Extension( name = "wrf._wrffortran", @@ -33,9 +22,37 @@ ext1 = numpy.distutils.core.Extension( "fortran/wrffortran.pyf"] ) +exec(open("src/wrf/version.py").read()) + +requirements = [ + "numpy>=1.9.0", + "wrapt>=1.10" + ] + numpy.distutils.core.setup( + author = "Bill Ladwig", + author_email = "ladwig@ucar.edu", + description = "Diagnostic and interpolation routines for WRF-ARW data", + long_description = """ + A collection of diagnostics and interpolation routines to be used with + WRF-ARW data. + """, + url = "https://github.com/NCAR/wrf-python", + keywords = ["python", "wrf-python", "wrf", "forecast", "model", + "weather research and forecasting", "interpolation", + "plotting", "plots", "meteorology", "nwp", + "numerical weather predication", "diagnostic"], + install_requires = requirements, + classifiers = ["Development Status :: 3 - Alpha", + "Intended Audience :: Science/Research", + "License :: OSI Approved", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Topic :: Scientific/Engineering :: Atmospheric Science", + "Topic :: Software Development :: Libraries :: Python Modules", + "Operating System :: OS Independent"], name = "wrf", - version = "0.0.1", + version = __version__, packages = setuptools.find_packages("src"), ext_modules = [ext1], package_dir={"" : "src"}, diff --git a/src/wrf/api.py b/src/wrf/api.py index c247da4..f0e22f2 100644 --- a/src/wrf/api.py +++ b/src/wrf/api.py @@ -17,6 +17,7 @@ from .util import (npvalues, extract_global_attrs, extract_dim, extract_vars, extract_times, combine_files, is_staggered, get_left_indexes, iter_left_indexes, get_right_slices, get_proj_params) +from .version import __version__ __all__ = [] __all__ += ["xarray_enabled", "disable_xarray", "enable_xarray", @@ -38,4 +39,5 @@ __all__ += ["npvalues", "extract_global_attrs", "extract_dim", "extract_vars", "extract_times", "combine_files", "is_staggered", "get_left_indexes", "iter_left_indexes", "get_right_slices", "get_proj_params"] +__all__ += ["__version__"] diff --git a/src/wrf/metadecorators.py b/src/wrf/metadecorators.py index 4fe0acc..4062aaf 100644 --- a/src/wrf/metadecorators.py +++ b/src/wrf/metadecorators.py @@ -1091,7 +1091,7 @@ def set_interp_metadata(interp_type): def set_alg_metadata(alg_ndims, refvarname, refvarndims=None, missingarg=None, stagdim=None, stagsubvar=None, - units=None, description=None, squeeze=False): + units=None, description=None): """ alg_ndims: number of dimensions returned by the algorithm refvarndims: number of right dimensions for the refernce var, used @@ -1201,9 +1201,6 @@ def set_alg_metadata(alg_ndims, refvarname, out = DataArray(result, name=outname, dims=outdims, attrs=outattrs) - if squeeze: - return out.squeeze() - return out return func_wrapper diff --git a/src/wrf/version.py b/src/wrf/version.py new file mode 100644 index 0000000..4ed9075 --- /dev/null +++ b/src/wrf/version.py @@ -0,0 +1,2 @@ +__version__ = "1.0a1" +