Skip to content
Snippets Groups Projects
Commit 43ce20b9 authored by Markus Holzer's avatar Markus Holzer Committed by Michael Kuron
Browse files

Fix package requires

parent 65b2fd79
Branches
Tags
No related merge requests found
......@@ -16,3 +16,5 @@ _local_tmp
doc/bibtex.json
RELEASE-VERSION
/db
/lbmpy/phasefield/simplex_projection.*.so
/lbmpy/phasefield/simplex_projection.c
\ No newline at end of file
import pyximport
try:
import pyximport
pyximport.install(language_level=3)
from lbmpy.phasefield.simplex_projection import simplex_projection_2d # NOQA
except ImportError:
try:
from lbmpy.phasefield.simplex_projection import simplex_projection_2d # NOQA
except ImportError:
raise ImportError("neither pyximport nor binary module simplex_projection_2d available.")
import sympy as sp
from lbmpy.creationfunctions import create_lb_update_rule
from lbmpy.macroscopic_value_kernels import pdf_initialization_assignments
from lbmpy.phasefield.analytical import chemical_potentials_from_free_energy, force_from_phi_and_mu
from lbmpy.phasefield.cahn_hilliard_lbm import cahn_hilliard_lb_method
from lbmpy.phasefield.simplex_projection import simplex_projection_2d # NOQA
from lbmpy.stencils import get_stencil
from pystencils import Assignment, create_data_handling, create_kernel
from pystencils.fd import Diff, discretize_spatial, expand_diff_full
from pystencils.fd.derivation import FiniteDifferenceStencilDerivation
pyximport.install(language_level=3)
def forth_order_isotropic_discretize(field):
second_neighbor_stencil = [(i, j)
......
......@@ -8,12 +8,17 @@ from importlib import import_module
sys.path.insert(0, os.path.abspath('doc'))
try:
import cython # noqa
USE_CYTHON = True
except ImportError:
USE_CYTHON = False
quick_tests = [
# 'test_serial_scenarios.test_ldc_mrt',
'test_serial_scenarios.test_ldc_mrt',
'test_serial_scenarios.test_channel_srt',
]
class SimpleTestRunner(distutils.cmd.Command):
"""A custom command to run selected tests"""
......@@ -43,7 +48,6 @@ class SimpleTestRunner(distutils.cmd.Command):
for test in quick_tests:
self._run_tests_in_module(test)
try:
sys.path.insert(0, os.path.abspath('doc'))
from version_from_git import version_number_from_git
......@@ -54,6 +58,14 @@ try:
except ImportError:
version = open('RELEASE-VERSION', 'r').read()
def cython_extensions(*extensions):
from distutils.extension import Extension
ext = '.pyx' if USE_CYTHON else '.c'
result = [Extension(e, [e.replace('.', '/') + ext]) for e in extensions]
if USE_CYTHON:
from Cython.Build import cythonize
result = cythonize(result, language_level=3)
return result
def readme():
with open('README.md') as f:
......@@ -71,6 +83,9 @@ setup(name='lbmpy',
url='https://i10git.cs.fau.de/pycodegen/lbmpy/',
packages=['lbmpy'] + ['lbmpy.' + s for s in find_packages('lbmpy')],
install_requires=['pystencils', 'sympy>=1.2', 'numpy>=1.11.0'],
package_data={'lbmpy': ['phasefield/simplex_projection.pyx',
'phasefield/simplex_projection.c']},
ext_modules=cython_extensions("lbmpy.phasefield.simplex_projection"),
classifiers=[
'Development Status :: 4 - Beta',
'Framework :: Jupyter',
......@@ -89,6 +104,7 @@ setup(name='lbmpy',
'ipy_table', 'imageio', 'jupyter', 'pyevtk'],
'doc': ['sphinx', 'sphinx_rtd_theme', 'nbsphinx',
'sphinxcontrib-bibtex', 'sphinx_autodoc_typehints', 'pandoc'],
'phasefield': ['Cython']
},
cmdclass={
'quicktest': SimpleTestRunner
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment