Skip to content

Commit

Permalink
Merge branch 'gwastro:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
GarethCabournDavies authored Aug 6, 2024
2 parents ae19af7 + f0da4e9 commit ba4c13f
Show file tree
Hide file tree
Showing 42 changed files with 1,136 additions and 999 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/basic-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
max-parallel: 60
matrix:
os: [ubuntu-20.04]
python-version: [3.8, 3.9, '3.10', '3.11']
python-version: ['3.9', '3.10', '3.11', '3.12']
test-type: [unittest, search, docs]
steps:
- uses: actions/checkout@v3
Expand Down Expand Up @@ -50,7 +50,7 @@ jobs:
export LAL_DATA_PATH=$PWD
tox -e py-inference
- name: store documentation page
if: matrix.test-type == 'docs' && matrix.python-version == '3.8'
if: matrix.test-type == 'docs' && matrix.python-version == '3.12'
uses: actions/upload-artifact@v2
with:
name: documentation-page
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/distribution.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ jobs:
fetch-depth: 0
- uses: actions/setup-python@v4
with:
python-version: 3.8
python-version: '3.10'
- name: Install cibuildwheel
run: python -m pip install cibuildwheel
- name: Build wheels
run: python -m cibuildwheel --output-dir wheelhouse
env:
CIBW_BUILD: cp38-* cp39-* cp310-* cp311-*
CIBW_BUILD: cp39-* cp310-* cp311-* cp312-*
CIBW_SKIP: "*musllinux*"
CIBW_ARCHS_MACOS: x86_64 arm64
- uses: actions/upload-artifact@v2
Expand All @@ -40,10 +40,10 @@ jobs:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Python 3.8
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: 3.8
python-version: '3.10'
- uses: actions/download-artifact@v2
with:
path: ./
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/inference-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.8
python-version: '3.10'
- name: install condor
run: |
wget -qO - https://research.cs.wisc.edu/htcondor/ubuntu/HTCondor-Release.gpg.key | sudo apt-key add -
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/mac-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
max-parallel: 4
matrix:
os: [macos-12]
python-version: [3.8, 3.9, '3.10', '3.11']
python-version: ['3.10', '3.11', '3.12']
steps:
- uses: actions/checkout@v1
- name: Set up Python ${{ matrix.python-version }}
Expand All @@ -25,5 +25,4 @@ jobs:
pip install --upgrade pip setuptools "tox<4.0.0"
- name: run basic pycbc test suite
run: |
sudo chmod -R 777 /usr/local/miniconda/
tox -e py-unittest
2 changes: 1 addition & 1 deletion .github/workflows/search-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.8
python-version: '3.10'
- name: install condor
run: |
wget -qO - https://research.cs.wisc.edu/htcondor/ubuntu/HTCondor-Release.gpg.key | sudo apt-key add -
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tmpltbank-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.8
python-version: '3.10'
- name: install condor
run: |
wget -qO - https://research.cs.wisc.edu/htcondor/ubuntu/HTCondor-Release.gpg.key | sudo apt-key add -
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tut-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
max-parallel: 60
matrix:
os: [ubuntu-20.04]
python-version: [3.8, 3.9, '3.10', '3.11']
python-version: ['3.10', '3.11', '3.12']
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/workflow-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.8
python-version: '3.10'
- name: install condor
run: |
wget -qO - https://research.cs.wisc.edu/htcondor/ubuntu/HTCondor-Release.gpg.key | sudo apt-key add -
Expand Down
4 changes: 2 additions & 2 deletions bin/all_sky_search/pycbc_cut_merge_triggers_to_tmpltbank
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ Reduce a MERGE triggers file to a reduced template bank
"""

import logging
import imp
import argparse
import numpy
import h5py
import pycbc
from pycbc.io import HFile
from pycbc import load_source

parser = argparse.ArgumentParser(description=__doc__)
pycbc.add_common_pycbc_options(parser)
Expand All @@ -50,7 +50,7 @@ pycbc.init_logging(opt.verbose)

bank_fd = HFile(opt.full_template_bank, 'r')

modl = imp.load_source('filter_func', opt.filter_func_file)
modl = load_source('filter_func', opt.filter_func_file)
func = modl.filter_tmpltbank
bool_arr = func(bank_fd)

Expand Down
3 changes: 3 additions & 0 deletions bin/all_sky_search/pycbc_fit_sngls_by_template
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,9 @@ sigma_regions = trigf[args.ifo + '/sigmasq_template'][:]
median_sigma = []
for reg in sigma_regions:
strigs = trigf[args.ifo + '/sigmasq'][reg]
if len(strigs) == 0:
median_sigma.append(np.nan)
continue
median_sigma.append(np.median(strigs) ** 0.5)

outfile = HFile(args.output, 'w')
Expand Down
10 changes: 8 additions & 2 deletions bin/all_sky_search/pycbc_fit_sngls_over_multiparam
Original file line number Diff line number Diff line change
Expand Up @@ -342,14 +342,20 @@ if len(args.template_fit_file) > 1:
nasum = nabove[tidsort].cumsum()
invsum = invalphan[tidsort].cumsum()
ntsum = ntotal[tidsort].cumsum()
mssum = median_sigma[tidsort].cumsum()
num = right - left

tid = tid_unique
nabove = (nasum[right] - nasum[left]) / num
invalphan = (invsum[right] - invsum[left]) / num
ntotal = (ntsum[right] - ntsum[left]) / num
median_sigma = (mssum[right] - mssum[left]) / num
if median_sigma is not None:
# Median sigma is a special one - we need to make sure that
# we do not mess things up when nan values are given, so we
# can't use the special cumsum fast option
median_sigma = [
numpy.nanmean(median_sigma[tidsort[l:r]])
for l, r in zip(left, right)
]

if args.output_fits_by_template:
# Store fit_by_template values for output file
Expand Down
4 changes: 2 additions & 2 deletions bin/all_sky_search/pycbc_reduce_template_bank
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ Reduce a template bank using some input parameter cuts

import numpy
import logging
import imp
import argparse
import pycbc
from pycbc.io import HFile
from pycbc import load_source

parser = argparse.ArgumentParser(description=__doc__)
pycbc.add_common_pycbc_options(parser)
Expand All @@ -48,7 +48,7 @@ pycbc.init_logging(opt.verbose)

bank_fd = HFile(opt.input_bank, 'r')

modl = imp.load_source('filter_func', opt.filter_func_file)
modl = load_source('filter_func', opt.filter_func_file)
func = modl.filter_tmpltbank
bool_arr = func(bank_fd)

Expand Down
4 changes: 2 additions & 2 deletions bin/live/pycbc_live_plot_single_significance_fits
Original file line number Diff line number Diff line change
Expand Up @@ -131,10 +131,10 @@ for ifo in all_ifos:
continue

# Keep track of some maxima for use in setting the plot limits
maxstat = stats[ifo].max()
maxstat = np.nanmax(stats[ifo])
max_rate = 0

statrange = maxstat - max(stats[ifo].min(), fit_threshold[ifo])
statrange = maxstat - max(np.nanmin(stats[ifo]), fit_threshold[ifo])
plotmax = maxstat + statrange * 0.05

plotbins = np.linspace(fit_threshold[ifo], plotmax, 400)
Expand Down
7 changes: 0 additions & 7 deletions bin/live/pycbc_live_single_significance_fits
Original file line number Diff line number Diff line change
Expand Up @@ -98,13 +98,6 @@ args.trigger_cuts = args.trigger_cuts or []
args.trigger_cuts.append(f"end_time:{args.gps_start_time}:lower_inc")
args.trigger_cuts.append(f"end_time:{args.gps_end_time}:upper_inc")

# Efficiency saving: add SNR cut before any others as sngl_ranking can
# only be less than SNR.
args.trigger_cuts.insert(0, f"snr:{args.fit_threshold}:lower_inc")

# Cut triggers with sngl-ranking below threshold
args.trigger_cuts.append(f"{args.sngl_ranking}:{args.fit_threshold}:lower_inc")

trigger_cut_dict, template_cut_dict = cuts.ingest_cuts_option_group(args)

logging.info("Setting up duration bins")
Expand Down
Loading

0 comments on commit ba4c13f

Please sign in to comment.