Skip to content

Commit

Permalink
Bumped to version 1.5.1 and updated numpy dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
philippkraft committed Feb 9, 2020
1 parent 13a16ca commit 10436a0
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 29 deletions.
2 changes: 1 addition & 1 deletion cmf/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@


__version__ = '1.5.1'
__compiletime__ = 'Sat Feb 8 21:43:15 2020'
__compiletime__ = 'Sun Feb 9 13:39:18 2020'

from .cmf_core import connect_cells_with_flux as __ccwf

Expand Down
60 changes: 32 additions & 28 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,6 @@

print('cmf', branchversion)

# Try to import numpy, if it fails we have a problem
try:
# Import a function to get a path to the include directories of numpy
# noinspection PyPackageRequirements
from numpy import get_include as get_numpy_include
except ImportError:
raise RuntimeError("For building and running of cmf an installation of numpy is needed")


swig = False
openmp = False

Expand Down Expand Up @@ -96,12 +87,27 @@ def clean_static_methods(cmf_core_py):
print(count, 'old style static methods removed from', len(classes), 'classes')
return cmf_core_py

def add_numpy_include(self):
# Try to import numpy, if it fails we have a problem
try:
# Import a function to get a path to the include directories of numpy
# noinspection PyPackageRequirements
from numpy import get_include as get_numpy_include
except ImportError:
raise RuntimeError("For building and running of cmf an installation of numpy is needed")

for ext in self.extensions:
ext.include_dirs += [get_numpy_include()]

def build_extensions(self):
customize_compiler(self.compiler)
try:
self.compiler.compiler_so.remove("-Wstrict-prototypes")
except (AttributeError, ValueError):
pass

self.add_numpy_include()

build_ext.build_extensions(self)

if swig:
Expand Down Expand Up @@ -210,8 +216,6 @@ def make_cmf_core():
libraries = None
# Include CVODE
include_dirs = [os.path.join(*'cmf/cmf_core_src/math/integrators/sundials_cvode/include'.split('/'))]
# Include numpy
include_dirs += [get_numpy_include()]

# Platform specific stuff, alternative is to subclass build_ext command as in:
# https://stackoverflow.com/a/5192738/3032680
Expand Down Expand Up @@ -295,21 +299,21 @@ def make_cmf_core():
'Topic :: Scientific/Engineering',
'Topic :: Software Development :: Libraries :: Python Modules',
]

setup(name='cmf',
version=version,
license='GPLv3+',
ext_modules=ext,
packages=['cmf', 'cmf.draw', 'cmf.geometry'],
python_requires='>=2.7',
keywords='hydrology catchment simulation toolbox',
author='Philipp Kraft',
author_email="philipp.kraft@umwelt.uni-giessen.de",
url="https://www.uni-giessen.de/hydro/download",
description=description,
long_description=long_description,
classifiers=classifiers,
cmdclass=dict(build_py=build_py,
build_ext=CmfBuildExt),
)
setup(name='cmf',
version=version,
license='GPLv3+',
ext_modules=ext,
packages=['cmf', 'cmf.draw', 'cmf.geometry'],
python_requires='>=2.7',
install_requires='numpy>=1.11.1',
keywords='hydrology catchment simulation toolbox',
author='Philipp Kraft',
author_email="philipp.kraft@umwelt.uni-giessen.de",
url="https://philippkraft.github.io/cmf",
description=description,
long_description=long_description,
classifiers=classifiers,
cmdclass=dict(build_py=build_py,
build_ext=CmfBuildExt),
)

0 comments on commit 10436a0

Please sign in to comment.