Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes to issue #48 #60

Open
wants to merge 32 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
a07f6dc
Update setup.py
nr1118 Nov 6, 2024
ef2a330
Update ci_tests.yml
nr1118 Nov 6, 2024
11e5480
Update ci_tests.yml
nr1118 Nov 6, 2024
478afa0
Update ci_tests.yml
nr1118 Nov 6, 2024
e4a7030
Update ci_tests.yml
nr1118 Nov 6, 2024
e2850dd
Update setup.py
nr1118 Nov 6, 2024
4c79987
Update ci_tests.yml
nr1118 Nov 7, 2024
a3a262a
Add files via upload
nr1118 Nov 7, 2024
a9ce8f6
Merge pull request #56 from xpsi-group/main
nr1118 Nov 13, 2024
fc2fea5
Update ci_tests.yml
nr1118 Nov 15, 2024
326d0c6
Update ci_tests.yml
nr1118 Nov 15, 2024
974ec29
using Axel's fix for setup.py
nr1118 Nov 15, 2024
2017d72
Update ci_tests.yml
nr1118 Nov 15, 2024
660aac6
Update setup.py
nr1118 Dec 5, 2024
98f1685
Update ci_tests.yml
nr1118 Dec 5, 2024
a32ebe3
Update ci_tests.yml
nr1118 Dec 5, 2024
48ab4e0
Update ci_tests.yml
nr1118 Dec 5, 2024
743d28f
Update ci_tests.yml
nr1118 Dec 5, 2024
259f305
Update ci_tests.yml
nr1118 Dec 5, 2024
501e5aa
Update setup.py
nr1118 Dec 5, 2024
524193a
Update setup.py
nr1118 Dec 5, 2024
67bfedd
Update setup.py
nr1118 Dec 5, 2024
a8a588e
Update test_likelihood.py
nr1118 Dec 5, 2024
fe00b80
Update test_likelihood.py
nr1118 Dec 5, 2024
7ef068c
Update test_likelihood.py
nr1118 Dec 5, 2024
dc74067
indentation issue
nr1118 Dec 5, 2024
222d40d
Update test_likelihood.py
nr1118 Dec 5, 2024
dfba80f
Update test_likelihood.py
nr1118 Dec 5, 2024
bc6af45
Update ci_tests.yml
nr1118 Dec 6, 2024
424b2be
Update environment_mac.yml
nr1118 Dec 6, 2024
31b931c
Update setup.py to match main
nr1118 Dec 6, 2024
da4c924
Update ci_tests.yml to install cython w/ pip
nr1118 Dec 6, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 58 additions & 1 deletion .github/workflows/ci_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,61 @@ jobs:

- name: Test with pytest
run: |
pytest
pytest

tests-mac:
runs-on: macos-latest
defaults:
run:
shell: bash -l {0}
strategy:
fail-fast: false
max-parallel: 5
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v3
- name: Install Conda environment with Micromamba
uses: mamba-org/setup-micromamba@v1
with:
environment-file: environment_mac.yml
cache-env: true
cache-env-key: env-envkey-${{ github.sha }}-${{ github.run_attempt }}
environment-name: neost
- name: pymultinest & Cython install and neost activation
run: |
micromamba activate neost
pip install cython
pip install pymultinest

- name: mamba installs
run: |
brew install flake8 pytest

- name: Python version check
run: |
echo $PATH
python --version
which python
shell: bash -l {0}

- name: install gsl
run: |
brew install gsl

- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
#flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: install neost package
run: |
pip install .

shell: bash -l {0}

- name: Test with pytest
run: |
python -m pytest
16 changes: 16 additions & 0 deletions environment_mac.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: neost
channels:
- defaults
- conda-forge
dependencies:
- python # Just to ensure we're not using system-wide python. See PEP 668
- numpy
- matplotlib
- scipy
- pytest
- numba
- seaborn
- corner
- gsl
- kalepy
- jupyter # Optional, only required for running the example notebooks in docs/source/
10 changes: 5 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,19 @@

# Common includes, linker arguments, compiler arguments
include_dirs = [np.get_include(), gsl_prefix+'/include', '.']
extra_link_args = ['-fopenmp']
extra_compile_args = ['-fopenmp', '-Wno-unused-function', '-Wno-uninitialized']
extra_link_args = []
extra_compile_args = ['-Wno-unused-function', '-Wno-uninitialized']

# OS-specific settings
if 'darwin' in OS:
# Using compiler of clang with llvm installed
os.environ["CC"] = "/usr/local/opt/llvm/bin/clang"
os.environ["CXX"] = "/usr/local/opt/llvm/bin/clang++"
# os.environ["CC"] = "/usr/local/opt/llvm/bin/clang"
# os.environ["CXX"] = "/usr/local/opt/llvm/bin/clang++"
library_dirs.append('/usr/local/opt/llvm/lib')
library_dirs.append('/opt/local/lib')
extra_compile_args.append('-Wno-#warnings')
extra_compile_args.append('-Wno-error=format-security')
include_dirs.append(['/usr/local/include', '/usr/local/opt/llvm/include', './neost'])
include_dirs.extend(['/usr/local/include', '/usr/local/opt/llvm/include', './neost/tovsolvers/'])

else:
# point to shared library at compile time so runtime resolution
Expand Down
6 changes: 5 additions & 1 deletion tests/test_likelihood.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,9 @@ def test_likelihood_is_correct(self):
par = prior.inverse_sample(cube)
ll = likelihood.call(par)
print(ll)
assert np.isclose(-4.187612429216115, ll, rtol=1.0e-5)
if (np.isclose(-4.187612429216115, ll, rtol=1.0e-5) is False):
print('C TOV solvers either not installed or broken, using Python TOV solver instead')
assert np.isclose(-4.192614304543445, ll, rtol=1.0e-5)
else:
assert np.isclose(-4.187612429216115, ll, rtol=1.0e-5)

Loading