Skip to content

Commit

Permalink
threading library as dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicholaswogan committed Oct 25, 2024
1 parent 52dcfa2 commit bc6e952
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
7 changes: 4 additions & 3 deletions photochem/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import os
os.environ['OMP_NUM_THREADS'] = '1'

from ._photochem import EvoAtmosphere, Atmosphere, PhotoException, __version__
from photochem_clima_data import DATA_DIR

# Limits OpenMP threads to 1
from threadpoolctl import threadpool_limits
_ = threadpool_limits(limits=1, user_api='openmp')

zahnle_earth = DATA_DIR+'/reaction_mechanisms/zahnle_earth.yaml'
9 changes: 5 additions & 4 deletions photochem/clima.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import os
os.environ['OMP_NUM_THREADS'] = '1'

from ._clima import AdiabatClimate, ClimaException
from ._clima import rebin # rebin routine from futils
from ._clima import __version__
from ._clima import __version__

# Limits OpenMP threads to 1
from threadpoolctl import threadpool_limits
_ = threadpool_limits(limits=1, user_api='openmp')
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
python_requires='>=3.6',
version=version,
license="GNU General Public License v3.0",
install_requires=['numpy','scipy','pyyaml', 'numba', 'h5py', 'astropy'],
install_requires=['numpy','scipy','pyyaml', 'numba', 'h5py', 'astropy', 'threadpoolctl'],
author='Nicholas Wogan',
author_email = '[email protected]',
description = "Photochemical model of planet's atmospheres.",
Expand Down

0 comments on commit bc6e952

Please sign in to comment.