forked from gwastro/pycbc
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add python 3.12 to the build and drop python 3.8 (gwastro#4716)
* drop python3.7, 3.8, 3.9 * add missing quotes * banish distutils * banish p39 in more places * tox needs some things early * move here * maybe? * try el9 * must use 311 for el9 * this might be the right name * updates * try this * more stuff * update * do not use imp module * more places where imp was used * bring back 39 * more reverts * update * update * fixes * this should be here * cc * fix web url * add back 3.9 to basic tests * centralize python12 backwards compatibility function * cc * simplify setup.py, ensure math is linked * cc
- Loading branch information
Showing
17 changed files
with
62 additions
and
113 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,7 +22,6 @@ a set of injection files. The *order* of the injection files *must* match the | |
bank files, and the number of injections in each must correspond one-to-one. | ||
""" | ||
|
||
import imp | ||
import argparse | ||
import numpy as np | ||
|
||
|
@@ -33,7 +32,7 @@ from pycbc import pnutils | |
from pycbc.waveform import TemplateBank | ||
from pycbc.io.ligolw import LIGOLWContentHandler | ||
from pycbc.io.hdf import HFile | ||
|
||
from pycbc import load_source | ||
|
||
__author__ = "Ian Harry <[email protected]>" | ||
__version__ = pycbc.version.git_verbose_msg | ||
|
@@ -137,7 +136,7 @@ for val in trig_par_list: | |
f['trig_params/{}'.format(val)] = trig_params[val] | ||
|
||
if options.filter_func_file: | ||
modl = imp.load_source('filter_func', options.filter_func_file) | ||
modl = load_source('filter_func', options.filter_func_file) | ||
func = modl.filter_injections | ||
bool_arr = func(inj_params['mass1'], inj_params['mass2'], | ||
inj_params['spin1z'], inj_params['spin2z']) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,6 @@ | ||
[build-system] | ||
requires = ["setuptools", | ||
"wheel", | ||
"cython>=3.0.0", | ||
"numpy==1.16.0; python_version <= '3.7'", | ||
"numpy==1.17.3; python_version == '3.8'", | ||
"numpy==1.19.3; python_version == '3.9'", | ||
"numpy==1.21.4; python_version =='3.10'", | ||
"numpy==1.23.4; python_version=='3.11'", | ||
"numpy; python_version >= '3.12'", | ||
"cython>=0.29.21", | ||
"numpy>=2.0.0", | ||
] | ||
|
||
# To ensure the best compatibility, try to match the numpy reqs | ||
# where possible to the following used by scipy and the minimum | ||
# of our normal numpy requirements in setup.py | ||
# https://github.com/scipy/oldest-supported-numpy/blob/master/setup.cfg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
# For LDG service access | ||
ligo-proxy-utils | ||
ciecplib[kerberos] >= 0.7.0 | ||
dqsegdb2 >= 1.1.4 | ||
amqplib | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,11 +20,9 @@ | |
""" | ||
|
||
import sys | ||
import os, subprocess, shutil | ||
import os, subprocess | ||
import platform | ||
|
||
from distutils.command.clean import clean as _clean | ||
|
||
from setuptools import Extension, setup, Command | ||
from setuptools.command.build_ext import build_ext as _build_ext | ||
from setuptools import find_packages | ||
|
@@ -83,27 +81,6 @@ def run(self): | |
|
||
_build_ext.run(self) | ||
|
||
|
||
# Add swig-generated files to the list of things to clean, so they | ||
# get regenerated each time. | ||
class clean(_clean): | ||
def finalize_options (self): | ||
_clean.finalize_options(self) | ||
self.clean_files = [] | ||
self.clean_folders = ['docs/_build'] | ||
def run(self): | ||
_clean.run(self) | ||
for f in self.clean_files: | ||
try: | ||
os.unlink(f) | ||
print('removed ' + f) | ||
except: | ||
pass | ||
|
||
for fol in self.clean_folders: | ||
shutil.rmtree(fol, ignore_errors=True) | ||
print('removed ' + fol) | ||
|
||
def get_version_info(): | ||
"""Get VCS info and write version info to version.py. | ||
""" | ||
|
@@ -192,7 +169,6 @@ def run(self): | |
cmdclass = { | ||
'build_docs': build_docs, | ||
'build_gh_pages': build_gh_pages, | ||
'clean': clean, | ||
'build_ext': cbuild_ext | ||
} | ||
|
||
|
@@ -209,12 +185,21 @@ def run(self): | |
# do the actual work of building the package | ||
VERSION = get_version_info() | ||
|
||
cythonext = ['waveform.spa_tmplt', | ||
'waveform.utils', | ||
'types.array', | ||
'filter.matchedfilter', | ||
'vetoes.chisq'] | ||
cythonext = ['pycbc.waveform.spa_tmplt_cpu', | ||
'pycbc.waveform.utils_cpu', | ||
'pycbc.types.array_cpu', | ||
'pycbc.filter.matchedfilter_cpu', | ||
'pycbc.vetoes.chisq_cpu', | ||
"pycbc.fft.fftw_pruned_cython", | ||
"pycbc.events.eventmgr_cython", | ||
"pycbc.events.simd_threshold_cython", | ||
"pycbc.filter.simd_correlate_cython", | ||
"pycbc.waveform.decompress_cpu_cython", | ||
"pycbc.inference.models.relbin_cpu", | ||
] | ||
ext = [] | ||
|
||
libraries = ['m'] # Some platforms / toolchains don't implicitly link this | ||
cython_compile_args = ['-O3', '-w', '-ffast-math', | ||
'-ffinite-math-only'] | ||
|
||
|
@@ -233,57 +218,18 @@ def run(self): | |
cython_compile_args += ["-stdlib=libc++"] | ||
cython_link_args += ["-stdlib=libc++"] | ||
|
||
|
||
for name in cythonext: | ||
e = Extension("pycbc.%s_cpu" % name, | ||
["pycbc/%s_cpu.pyx" % name.replace('.', '/')], | ||
fname = name.replace('.', '/') | ||
e = Extension(name, | ||
[f"{fname}.pyx"], | ||
language='c++', | ||
extra_compile_args=cython_compile_args, | ||
extra_link_args=cython_link_args, | ||
libraries=libraries, | ||
compiler_directives={'embedsignature': True}) | ||
ext.append(e) | ||
|
||
# Not all modules work like this: | ||
e = Extension("pycbc.fft.fftw_pruned_cython", | ||
["pycbc/fft/fftw_pruned_cython.pyx"], | ||
extra_compile_args=cython_compile_args, | ||
extra_link_args=cython_link_args, | ||
compiler_directives={'embedsignature': True}) | ||
ext.append(e) | ||
e = Extension("pycbc.events.eventmgr_cython", | ||
["pycbc/events/eventmgr_cython.pyx"], | ||
extra_compile_args=cython_compile_args, | ||
extra_link_args=cython_link_args, | ||
compiler_directives={'embedsignature': True}) | ||
ext.append(e) | ||
e = Extension("pycbc.events.simd_threshold_cython", | ||
["pycbc/events/simd_threshold_cython.pyx"], | ||
language='c++', | ||
extra_compile_args=cython_compile_args, | ||
extra_link_args=cython_link_args, | ||
compiler_directives={'embedsignature': True}) | ||
ext.append(e) | ||
e = Extension("pycbc.filter.simd_correlate_cython", | ||
["pycbc/filter/simd_correlate_cython.pyx"], | ||
language='c++', | ||
extra_compile_args=cython_compile_args, | ||
extra_link_args=cython_link_args, | ||
compiler_directives={'embedsignature': True}) | ||
ext.append(e) | ||
e = Extension("pycbc.waveform.decompress_cpu_cython", | ||
["pycbc/waveform/decompress_cpu_cython.pyx"], | ||
language='c++', | ||
extra_compile_args=cython_compile_args, | ||
extra_link_args=cython_link_args, | ||
compiler_directives={'embedsignature': True}) | ||
ext.append(e) | ||
e = Extension("pycbc.inference.models.relbin_cpu", | ||
["pycbc/inference/models/relbin_cpu.pyx"], | ||
language='c++', | ||
extra_compile_args=cython_compile_args, | ||
extra_link_args=cython_link_args, | ||
compiler_directives={'embedsignature': True}) | ||
ext.append(e) | ||
|
||
|
||
setup( | ||
name = 'PyCBC', | ||
version = VERSION, | ||
|
@@ -292,7 +238,7 @@ def run(self): | |
long_description_content_type='text/markdown', | ||
author = 'The PyCBC team', | ||
author_email = '[email protected]', | ||
url = 'http://www.pycbc.org/', | ||
url = 'http://pycbc.org/', | ||
download_url = f'https://github.com/gwastro/pycbc/tarball/v{VERSION}', | ||
keywords = [ | ||
'ligo', | ||
|
@@ -313,14 +259,13 @@ def run(self): | |
'pycbc.neutron_stars': find_files('pycbc/neutron_stars') | ||
}, | ||
ext_modules = ext, | ||
python_requires='>=3.7', | ||
python_requires='>=3.9', | ||
classifiers=[ | ||
'Programming Language :: Python', | ||
'Programming Language :: Python :: 3.7', | ||
'Programming Language :: Python :: 3.8', | ||
'Programming Language :: Python :: 3.9', | ||
'Programming Language :: Python :: 3.10', | ||
'Programming Language :: Python :: 3.11', | ||
'Programming Language :: Python :: 3.12', | ||
'Intended Audience :: Science/Research', | ||
'Natural Language :: English', | ||
'Topic :: Scientific/Engineering', | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.