setup_cython.py 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. #!/usr/bin/env python
  2. # -*- coding: UTF-8 -*-
  3. #
  4. # Copyright (C) 2009-2015 Ovidio Peña Rodríguez <ovidio@bytesfall.com>
  5. # Copyright (C) 2013-2015 Konstantin Ladutenko <kostyfisik@gmail.com>
  6. #
  7. # This file is part of scattnlay
  8. #
  9. # This program is free software: you can redistribute it and/or modify
  10. # it under the terms of the GNU General Public License as published by
  11. # the Free Software Foundation, either version 3 of the License, or
  12. # (at your option) any later version.
  13. #
  14. # This program is distributed in the hope that it will be useful,
  15. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17. # GNU General Public License for more details.
  18. #
  19. # The only additional remark is that we expect that all publications
  20. # describing work using this software, or all commercial products
  21. # using it, cite the following reference:
  22. # [1] O. Pena and U. Pal, "Scattering of electromagnetic radiation by
  23. # a multilayered sphere," Computer Physics Communications,
  24. # vol. 180, Nov. 2009, pp. 2348-2354.
  25. #
  26. # You should have received a copy of the GNU General Public License
  27. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  28. __version__ = '2.0'
  29. __title__ = 'Calculation of the scattering of EM radiation by a multilayered sphere'
  30. __mod__ = 'python-scattnlay'
  31. __author__ = 'Ovidio Peña Rodríguez'
  32. __email__ = 'ovidio@bytesfall.com'
  33. __url__ = 'http://scattering.sourceforge.net/'
  34. from distutils.core import setup
  35. from distutils.extension import Extension
  36. from Cython.Build import cythonize
  37. import numpy as np
  38. setup(name = __mod__,
  39. version = __version__,
  40. description = __title__,
  41. long_description="""The Python version of scattnlay, a computer implementation of the algorithm for the calculation of electromagnetic \
  42. radiation scattering by a multilayered sphere developed by Yang. It has been shown that the program is effective, \
  43. resulting in very accurate values of scattering efficiencies for a wide range of size parameters, which is a \
  44. considerable improvement over previous implementations of similar algorithms. For details see: \
  45. O. Pena, U. Pal, Comput. Phys. Commun. 180 (2009) 2348-2354.""",
  46. author = __author__,
  47. author_email = __email__,
  48. maintainer = __author__,
  49. maintainer_email = __email__,
  50. keywords = ['Mie scattering', 'Multilayered sphere', 'Efficiency factors', 'Cross-sections'],
  51. url = __url__,
  52. license = 'GPL',
  53. platforms = 'any',
  54. ext_modules = cythonize("scattnlay.pyx", # our Cython source
  55. sources = ["src/nmie.cc", "src/py_nmie.cc", "src/scattnlay.cpp"], # additional source file(s)
  56. language = "c++", # generate C++ code
  57. extra_compile_args = ['-std=c++11'],
  58. include_dirs = [np.get_include()]
  59. )
  60. )