From b60dc947757caf1ca86cd21f77bd29908f619bc5 Mon Sep 17 00:00:00 2001 From: Patrick Avery Date: Tue, 17 Oct 2023 14:13:00 -0500 Subject: [PATCH 1/3] Add TBB as a dependency to HEXRD If TBB is installed, numba will use TBB instead of OpenMP. In my brief testing, it appears that having TBB makes some of the workflows run a little faster. It also fixes some warnings we have been seeing about OpenMP. Signed-off-by: Patrick Avery --- conda.recipe/meta.yaml | 3 +++ setup.py | 1 + 2 files changed, 4 insertions(+) diff --git a/conda.recipe/meta.yaml b/conda.recipe/meta.yaml index 8a1b54ec7..229760264 100644 --- a/conda.recipe/meta.yaml +++ b/conda.recipe/meta.yaml @@ -39,6 +39,9 @@ requirements: - scikit-image - scikit-learn - scipy + # TBB seems to be a little faster than OpenMP for the cases I've tried. + # Installing TBB means numba will use it instead of OpenMP. + - tbb - tqdm test: diff --git a/setup.py b/setup.py index 337bb54f8..aa137b7db 100644 --- a/setup.py +++ b/setup.py @@ -20,6 +20,7 @@ 'pyyaml', 'scikit-learn', 'scipy', + 'tbb', 'tqdm', 'xxhash', ] From f47aa1e95e823c45ba81e93c42f4ad7dd13a2c46 Mon Sep 17 00:00:00 2001 From: Patrick Avery Date: Wed, 18 Oct 2023 13:06:10 -0500 Subject: [PATCH 2/3] Perform a little cleanup on setup.py We don't need the `CONDA_BUILD` flags anymore. Signed-off-by: Patrick Avery --- setup.py | 22 +++------------------- 1 file changed, 3 insertions(+), 19 deletions(-) diff --git a/setup.py b/setup.py index aa137b7db..155469d11 100644 --- a/setup.py +++ b/setup.py @@ -9,6 +9,7 @@ np_include_dir = numpy.get_include() install_reqs = [ + 'appdirs', 'fabio>=0.11', 'fast-histogram', 'h5py', @@ -18,6 +19,7 @@ 'psutil', 'pycifrw', 'pyyaml', + 'scikit-image', 'scikit-learn', 'scipy', 'tbb', @@ -34,15 +36,6 @@ else: compiler_optimize_flags = [] -# This a hack to get around the fact that scikit-image on conda-forge doesn't install -# dist info so setuptools can't find it, even though its there, which results in -# pkg_resources.DistributionNotFound, even though the package is available. So we -# only added it if we aren't building with conda. -# appdirs has the same issue. -if os.environ.get('CONDA_BUILD') != '1': - install_reqs.append('scikit-image') - install_reqs.append('appdirs') - # extension for convolution from astropy def get_convolution_extensions(): @@ -103,7 +96,7 @@ def get_extension_modules(): # use entry_points, not scripts: entry_points = { 'console_scripts': ["hexrd = hexrd.cli.main:main"] - } +} setup( name='hexrd', @@ -135,12 +128,3 @@ def get_extension_modules(): python_requires='>=3.8', install_requires=install_reqs ) - -# ext_modules = get_extension_modulesf() -# setupF( -# name='hexrd', -# url='https://github.com/cryos/hexrd', -# license='BSD', -# ext_modules=ext_modules, -# packages=find_packages(), -# ) From 1642747cfb2453c0f06f1da80907a0198374e4c4 Mon Sep 17 00:00:00 2001 From: Patrick Avery Date: Wed, 18 Oct 2023 13:08:46 -0500 Subject: [PATCH 3/3] Bump numpy version to the latest numba supports Signed-off-by: Patrick Avery --- pyproject.toml | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 46e6a3155..dc9d6a44b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,2 +1,2 @@ [build-system] -requires = ["setuptools", "wheel", "numpy<1.25", "setuptools_scm[toml]"] +requires = ["setuptools", "wheel", "numpy<1.27", "setuptools_scm[toml]"] diff --git a/setup.py b/setup.py index 155469d11..5c7967216 100644 --- a/setup.py +++ b/setup.py @@ -15,7 +15,7 @@ 'h5py', 'lmfit', 'numba', - 'numpy<1.25', # NOTE: bump this to support the latest version numba supports + 'numpy<1.27', # NOTE: bump this to support the latest version numba supports 'psutil', 'pycifrw', 'pyyaml',