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

Fix mac tests with conda #4946

Merged
merged 6 commits into from
Nov 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion .github/workflows/basic-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
run: |
sudo apt-get -o Acquire::Retries=3 update
sudo apt-get -o Acquire::Retries=3 install *fftw3* mpi intel-mkl* git-lfs graphviz
pip install "tox<4.0.0" pip setuptools --upgrade
pip install tox pip setuptools --upgrade
- name: installing auxiliary data files
run: |
GIT_LFS_SKIP_SMUDGE=1 git clone https://git.ligo.org/lscsoft/lalsuite-extra
Expand Down
44 changes: 37 additions & 7 deletions .github/workflows/mac-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,46 @@ jobs:
max-parallel: 4
matrix:
os: [macos-latest]
python-version: ['3.10', '3.11', '3.12']
python-version:
- '3.10'
- '3.11'
- '3.12'

# this is needed for conda environments to activate automatically
defaults:
run:
shell: bash -el {0}

steps:
- uses: actions/checkout@v1
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5

- name: Cache conda packages
uses: actions/cache@v4
env:
# increment to reset cache
CACHE_NUMBER: 0
with:
path: ~/conda_pkgs_dir
key: ${{ runner.os }}-conda-${{ matrix.python-version}}-${{ env.CACHE_NUMBER }}

- name: Configure conda
uses: conda-incubator/setup-miniconda@v3
with:
activate-environment: test
channels: conda-forge
miniforge-version: latest
python-version: ${{ matrix.python-version }}
- run: |
brew install fftw openssl gsl
pip install --upgrade pip setuptools "tox<4.0.0"
- name: run basic pycbc test suite

- name: Conda info
run: conda info --all

- name: Install tox
run: |
conda install \
pip \
setuptools \
tox

- name: Run basic pycbc test suite
run: |
tox -e py-unittest
8 changes: 4 additions & 4 deletions test/validation_code/old_coinc.py
Original file line number Diff line number Diff line change
Expand Up @@ -361,8 +361,8 @@ def cluster_coincs(stat, time1, time2, timeslide_id, slide, window, argmax=numpy
else:
time = 0.5 * (time2 + time1)

tslide = timeslide_id.astype(numpy.float128)
time = time.astype(numpy.float128)
tslide = timeslide_id.astype(numpy.longdouble)
time = time.astype(numpy.longdouble)

span = (time.max() - time.min()) + window * 10
time = time + span * tslide
Expand Down Expand Up @@ -411,8 +411,8 @@ def cluster_coincs_multiifo(stat, time_coincs, timeslide_id, slide, window, argm
nifos_minusone = (num_ifos - numpy.ones_like(num_ifos))
time_avg = time_avg + (nifos_minusone * timeslide_id * slide)/num_ifos

tslide = timeslide_id.astype(numpy.float128)
time_avg = time_avg.astype(numpy.float128)
tslide = timeslide_id.astype(numpy.longdouble)
time_avg = time_avg.astype(numpy.longdouble)

span = (time_avg.max() - time_avg.min()) + window * 10
time_avg = time_avg + span * tslide
Expand Down
79 changes: 33 additions & 46 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -11,38 +11,45 @@ deps =
:preinstall: -rrequirements.txt
-rcompanion.txt
mkl;'arm' not in platform_machine
conda_deps =
c-compiler
cxx-compiler
gsl
mysqlclient
; these packages don't install cleanly with pip, conda has patches
ligo-segments
python-ligo-lw

[testenv]
allowlist_externals = bash
passenv=LAL_DATA_PATH
conda_deps=openssl
conda_channels=conda-forge
platform = lin: linux
mac: darwin

# This test should run on almost anybody's environment
[testenv:py-unittest]
[bbhx]
deps =
{[base]deps}
pytest
; Needed for `BBHx` package to work with PyCBC
git+https://github.com/titodalcanton/BBHx.git@py39-and-cleanup; sys_platform == 'linux'
git+https://github.com/gwastro/BBHX-waveform-model.git; sys_platform == 'linux'
conda_deps=
mysqlclient
lin: gcc_linux-64>=12.2.0
lin: gxx_linux-64>=12.2.0
; mac doesn't work, need fix
; mac: clang_osx-64
; mac: clangxx_osx-64
gsl
lapack==3.6.1
conda_deps =
liblapacke
openblas

[testenv]
allowlist_externals =
bash
conda
conda_channels=conda-forge
setenv =
; Tell the linker to look for shared libs inside the temporary Conda env.
; Needed to build BBHx's wheel, whick links to LAPACK.
LIBRARY_PATH={envdir}/lib:{env:LIBRARY_PATH:}
conda_deps =
{[base]conda_deps}
{[bbhx]conda_deps}
commands_pre =
conda list
commands = pytest
deps =
{[base]deps}
{[bbhx]deps}
pytest
passenv=LAL_DATA_PATH
platform =
lin: linux
mac: darwin

# This test should run on almost anybody's environment
[testenv:py-unittest]

# The following are long running or may require
# some extra system-level dependencies or static files.
Expand All @@ -68,26 +75,6 @@ setenv = PYCBC_TEST_TYPE=inference
commands = bash tools/pycbc_test_suite.sh

[testenv:py-docs]
deps =
{[base]deps}
; Needed for `BBHx` package to work with PyCBC
git+https://github.com/titodalcanton/BBHx.git@py39-and-cleanup; sys_platform == 'linux'
git+https://github.com/gwastro/BBHX-waveform-model.git; sys_platform == 'linux'
conda_deps=
mysqlclient
lin: gcc_linux-64>=12.2.0
lin: gxx_linux-64>=12.2.0
; mac doesn't work, need fix
; mac: clang_osx-64
; mac: clangxx_osx-64
binutils_linux-64>=2.39
gsl
lapack==3.6.1
openmpi
conda_channels=conda-forge
setenv =
PYCBC_TEST_TYPE=docs
; Tell the linker to look for shared libs inside the temporary Conda env.
; Needed to build BBHx's wheel, whick links to LAPACK.
LIBRARY_PATH={envdir}/lib:{env:LIBRARY_PATH:}
commands = bash tools/pycbc_test_suite.sh
Loading