-
Notifications
You must be signed in to change notification settings - Fork 35
/
setup.py
116 lines (100 loc) · 3.65 KB
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
from __future__ import print_function
try:
from setuptools import setup
except Exception:
from distutils.core import setup
import os
import sys
join = os.path.join
def find_packages():
import os
packages = []
walker = os.walk('src')
prefix = join(os.path.curdir, 'src')
for thisdir, itsdirs, itsfiles in walker:
if '__init__.py' in itsfiles:
packages.append(thisdir[len(prefix) - 1:])
return packages
def find_data():
import os
import re
suffixes = ['yaml', 'nc', 'net', 'irr', 'phy', 'ptb',
'sum', 'voc', 'txt', 'xls', 'graffle']
data_pattern = re.compile(
r'.*(.|_)(' + '|'.join(suffixes) + ')$')
data = []
prefix = join(os.path.curdir, 'src', 'PseudoNetCDF')
walker = os.walk('src')
for thisdir, itsdirs, itsfiles in walker:
if thisdir != os.path.join('src',
'PseudoNetCDF.egg-info'):
data.extend([join(thisdir[len(prefix) - 1:], f)
for f in itsfiles
if data_pattern.match(f) is not None])
return data
packages = find_packages()
data = find_data()
long_desc = """NetCDF, NCO, and CDO are fantastic softwares that I use,
emulate, and admire. The primary drawbacks are restrictions on which
scientific data sources they will and won't work with, and what types
of operations they will and won't do. PseudoNetCDF was originally just
a NetCDF-like interface for many data formats, but has grown to include
many functionalities from NCO and CDO. This is a platform independent,
easy to install software to make scientific data manipulation easy."""
script_list = [
'scripts/pncmadis2pnceval.py', 'scripts/pncaqsraw4pnceval.py',
'scripts/pncaqsrest4pnceval.py', 'scripts/pncasos4pnceval.py',
'scripts/pnc1d.py', 'scripts/pnc2d.py',
'scripts/pncboundaries.py', 'scripts/pncdiurnal.py',
'scripts/pncdump', 'scripts/pncdump.py', 'scripts/pnceval',
'scripts/pnceval.py', 'scripts/pncgen', 'scripts/pncgen.py',
'scripts/pncglobal2cmaq.py', 'scripts/pncload',
'scripts/pncmap.py', 'scripts/pncqq.py',
'scripts/pncscatter.py', 'scripts/pncts.py',
'scripts/pncvertprofile.py', 'scripts/pncview',
'scripts/pncview.py', 'scripts/pncwindrose.py'
]
requires_list = [
'numpy>=1.2', 'netCDF4', 'scipy', 'matplotlib', 'pyyaml', 'pandas',
]
if sys.version_info.major == 3:
if sys.version_info.minor < 8:
requires_list.append('importlib_metadata')
extra_requires_dict = {
'textfiles': ['pandas'],
'projections': ['pyproj'],
'mapping': ['basemap'],
}
setup(
name='PseudoNetCDF',
version='3.4.0',
author='Barron Henderson',
author_email='[email protected]',
maintainer='Barron Henderson',
maintainer_email='[email protected]',
description=(
'Like NetCDF and NCO, but works with NetCDF and other ' +
'scientific formats.'
),
long_description=long_desc,
packages=packages,
package_dir={'': 'src'},
include_package_data=True,
package_data={'PseudoNetCDF': data},
scripts=script_list,
install_requires=requires_list,
extras_require=extra_requires_dict,
entry_points={
"xarray.backends": ["pseudonetcdf=PseudoNetCDF.xarray_plugin:PseudoNetCDFBackend"],
},
url='http://github.com/barronh/pseudonetcdf/',
classifiers=[
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Operating System :: MacOS',
'Operating System :: Microsoft :: Windows',
'Operating System :: POSIX',
'Topic :: Scientific/Engineering',
'Topic :: Scientific/Engineering :: Atmospheric Science',
]
)