Skip to content

Commit

Permalink
Stop using git, change directory to the base in the script
Browse files Browse the repository at this point in the history
  • Loading branch information
GarethCabournDavies committed Jun 10, 2024
1 parent 03d6b8e commit adee622
Showing 1 changed file with 17 additions and 15 deletions.
32 changes: 17 additions & 15 deletions tools/pycbc_test_suite.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,16 @@ PYTHON_MINOR_VERSION=`python -c 'import sys; print(sys.version_info.minor)'`
echo -e "\\n>> [`date`] Python Minor Version:" $PYTHON_MINOR_VERSION

# This will work from anywhere within the pycbc directory
PYCBC_BASE_DIR=`git rev-parse --show-toplevel`
this_script_dir=`dirname -- "$( readlink -f -- "$0"; )"`
cd $this_script_dir
cd ..

LOG_FILE=$(mktemp -t pycbc-test-log.XXXXXXXXXX)

RESULT=0

if [ "$PYCBC_TEST_TYPE" = "unittest" ] || [ -z ${PYCBC_TEST_TYPE+x} ]; then
for prog in `find $PYCBC_BASE_DIR/test -name '*.py' -print | egrep -v '(long|lalsim|test_waveform)'`
for prog in `find test -name '*.py' -print | egrep -v '(long|lalsim|test_waveform)'`
do
prog_short=`echo $prog | rev | cut -d"/" -f1 | rev`
echo -e ">> [`date`] running unit test for $prog_short"
Expand Down Expand Up @@ -65,7 +67,7 @@ fi

if [ "$PYCBC_TEST_TYPE" = "search" ] || [ -z ${PYCBC_TEST_TYPE+x} ]; then
# run pycbc inspiral test
pushd $PYCBC_BASE_DIR/examples/inspiral
pushd examples/inspiral
bash -e run.sh
if test $? -ne 0 ; then
RESULT=1
Expand All @@ -77,7 +79,7 @@ if [ "$PYCBC_TEST_TYPE" = "search" ] || [ -z ${PYCBC_TEST_TYPE+x} ]; then
popd

# run a quick bank placement example
pushd $PYCBC_BASE_DIR/examples/tmpltbank
pushd examples/tmpltbank
bash -e testNonspin2.sh
if test $? -ne 0 ; then
RESULT=1
Expand All @@ -92,7 +94,7 @@ if [ "$PYCBC_TEST_TYPE" = "search" ] || [ -z ${PYCBC_TEST_TYPE+x} ]; then
if ((${PYTHON_MINOR_VERSION} > 7)); then
# ligo.skymap is only supporting python3.8+, and older releases are
# broken by a new release of python-ligo-lw
pushd $PYCBC_BASE_DIR/examples/live
pushd examples/live
bash -e run.sh
if test $? -ne 0 ; then
RESULT=1
Expand All @@ -105,7 +107,7 @@ if [ "$PYCBC_TEST_TYPE" = "search" ] || [ -z ${PYCBC_TEST_TYPE+x} ]; then
fi

# run pycbc_multi_inspiral (PyGRB) test
pushd $PYCBC_BASE_DIR/examples/multi_inspiral
pushd examples/multi_inspiral
bash -e run.sh
if test $? -ne 0 ; then
RESULT=1
Expand All @@ -120,7 +122,7 @@ fi
if [ "$PYCBC_TEST_TYPE" = "inference" ] || [ -z ${PYCBC_TEST_TYPE+x} ]; then
# Run Inference Scripts
## Run inference on 2D-normal analytic likelihood function
pushd $PYCBC_BASE_DIR/examples/inference/analytic-normal2d
pushd examples/inference/analytic-normal2d
bash -e run.sh
if test $? -ne 0 ; then
RESULT=1
Expand All @@ -133,7 +135,7 @@ if [ "$PYCBC_TEST_TYPE" = "inference" ] || [ -z ${PYCBC_TEST_TYPE+x} ]; then

## Run inference on BBH example; this will also run
## a test of create_injections
pushd $PYCBC_BASE_DIR/examples/inference/bbh-injection
pushd examples/inference/bbh-injection
bash -e make_injection.sh
if test $? -ne 0 ; then
RESULT=1
Expand All @@ -154,7 +156,7 @@ if [ "$PYCBC_TEST_TYPE" = "inference" ] || [ -z ${PYCBC_TEST_TYPE+x} ]; then
popd

## Run inference on GW150914 data
pushd $PYCBC_BASE_DIR/examples/inference/gw150914
pushd examples/inference/gw150914
bash -e run_test.sh
if test $? -ne 0 ; then
RESULT=1
Expand All @@ -166,7 +168,7 @@ if [ "$PYCBC_TEST_TYPE" = "inference" ] || [ -z ${PYCBC_TEST_TYPE+x} ]; then
popd

## Run inference using single template model
pushd $PYCBC_BASE_DIR/examples/inference/single
pushd examples/inference/single
bash -e get.sh
bash -e run.sh
if test $? -ne 0 ; then
Expand All @@ -179,7 +181,7 @@ if [ "$PYCBC_TEST_TYPE" = "inference" ] || [ -z ${PYCBC_TEST_TYPE+x} ]; then
popd

## Run inference using relative model
pushd $PYCBC_BASE_DIR/examples/inference/relative
pushd examples/inference/relative
bash -e get.sh
bash -e run.sh
if test $? -ne 0 ; then
Expand All @@ -192,7 +194,7 @@ if [ "$PYCBC_TEST_TYPE" = "inference" ] || [ -z ${PYCBC_TEST_TYPE+x} ]; then
popd

## Run inference using the hierarchical model
pushd $PYCBC_BASE_DIR/examples/inference/hierarchical
pushd examples/inference/hierarchical
bash -e run_test.sh
if test $? -ne 0 ; then
RESULT=1
Expand All @@ -204,7 +206,7 @@ if [ "$PYCBC_TEST_TYPE" = "inference" ] || [ -z ${PYCBC_TEST_TYPE+x} ]; then
popd

## Run inference samplers
pushd $PYCBC_BASE_DIR/examples/inference/samplers
pushd examples/inference/samplers
bash -e run.sh
if test $? -ne 0 ; then
RESULT=1
Expand All @@ -219,7 +221,7 @@ if [ "$PYCBC_TEST_TYPE" = "inference" ] || [ -z ${PYCBC_TEST_TYPE+x} ]; then
if ((${PYTHON_MINOR_VERSION} > 7)); then
# ligo.skymap is only supporting python3.8+, and older releases are
# broken by a new release of python-ligo-lw
pushd $PYCBC_BASE_DIR/examples/make_skymap
pushd examples/make_skymap
bash -e simulated_data.sh
if test $? -ne 0 ; then
RESULT=1
Expand All @@ -235,7 +237,7 @@ fi
if [ "$PYCBC_TEST_TYPE" = "docs" ] || [ -z ${PYCBC_TEST_TYPE+x} ]; then
echo -e "\\n>> [`date`] Building documentation"

python $PYCBC_BASE_DIR/setup.py build_gh_pages
python setup.py build_gh_pages
if test $? -ne 0 ; then
echo -e " FAILED!"
echo -e "---------------------------------------------------------"
Expand Down

0 comments on commit adee622

Please sign in to comment.