Skip to content

refactor: change freq_norm from string to enum #716

refactor: change freq_norm from string to enum

refactor: change freq_norm from string to enum #716

Workflow file for this run

name: Test
on:
pull_request:
push: { branches: [master] }
workflow_dispatch:
env:
python_version: '3.10'
RDMAV_FORK_SAFE: 1
jobs:
unit_tests:
runs-on: ubuntu-22.04
steps:
- name: Checkout Repo
uses: actions/[email protected]
- name: Setup NoisePy
uses: ./.github/actions/setup
with:
python-version: ${{env.python_version}}
- name: pytest
run: PYTHONPATH=src pytest tests/. --cov
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
s0_download:
runs-on: ubuntu-22.04
steps:
- name: Checkout Repo
uses: actions/[email protected]
- name: Setup NoisePy
uses: ./.github/actions/setup
with:
python-version: ${{env.python_version}}
- name: Test Download (S0)
working-directory: ./src
run: noisepy download --start_date 2019-02-01T00:00:00 --end_date 2019-02-01T02:00:00 --stations ARV,BAK --inc_hours 1 --raw_data_path $RUNNER_TEMP/RAW_DATA
- name: Cache data
uses: actions/cache/save@v3
with:
key: download_data-${{ github.sha }}
path: ${{runner.temp}}
s1_s2:
strategy:
fail-fast: true
matrix:
python_version: ['3.9', '3.10']
method: [linear,robust, nroot, selective, auto_covariance, pws]
freq_norm: [rma]
format: [asdf]
substack: [false]
include:
- method: linear
python_version: '3.10'
freq_norm: no
format: zarr
substack: true
- method: all
python_version: '3.9'
freq_norm: phase_only
format: numpy
runs-on: ubuntu-22.04
needs: s0_download
steps:
- name: Checkout Repo
uses: actions/[email protected]
- name: Setup NoisePy
uses: ./.github/actions/setup
with:
python-version: ${{matrix.python_version}}
- name: Cache data
id: cache
uses: actions/cache/restore@v3
with:
key: download_data-${{ github.sha }}
path: ${{runner.temp}}
- name: Check cache hit
if: steps.cache.outputs.cache-hit != 'true'
run: exit 1
- name: Test Cross-Correlation (S1)
working-directory: ./src
run: |
noisepy cross_correlate --raw_data_path $RUNNER_TEMP/RAW_DATA --ccf_path $RUNNER_TEMP/CCF --freq_norm ${{matrix.freq_norm}} --format ${{matrix.format}}
- name: Test Stacking (S2)
working-directory: ./src
run: |
noisepy stack --raw_data_path $RUNNER_TEMP/RAW_DATA --ccf_path $RUNNER_TEMP/CCF --stack_path $RUNNER_TEMP/STACK --stack_method ${{matrix.method}} --format ${{matrix.format}}
s1_s2_mpi:
strategy:
fail-fast: true
matrix:
python_version: ['3.10']
method: [linear]
freq_norm: [rma]
runs-on: ubuntu-22.04
needs: s0_download
steps:
- name: Checkout Repo
uses: actions/[email protected]
- name: Setup NoisePy
uses: ./.github/actions/setup
with:
python-version: ${{matrix.python_version}}
mpi: 'true'
- name: Cache data
id: cache
uses: actions/cache/restore@v3
with:
key: download_data-${{ github.sha }}
path: ${{runner.temp}}
- name: Check cache hit
if: steps.cache.outputs.cache-hit != 'true'
run: exit 1
- name: Test Cross-Correlation (S1)
working-directory: ./src
run: |
mpiexec -n 2 noisepy cross_correlate --mpi --raw_data_path $RUNNER_TEMP/RAW_DATA --ccf_path $RUNNER_TEMP/CCF --freq_norm ${{matrix.freq_norm}}
- name: Test Stacking (S2)
working-directory: ./src
run: |
mpiexec -n 3 noisepy stack --mpi --raw_data_path $RUNNER_TEMP/RAW_DATA --ccf_path $RUNNER_TEMP/CCF --stack_path $RUNNER_TEMP/STACK --stack_method ${{matrix.method}}
s3_dates:
strategy:
fail-fast: true
matrix:
python_version: ['3.9', '3.10']
runs-on: ubuntu-22.04
steps:
- name: Checkout Repo
uses: actions/[email protected]
- name: Setup NoisePy
uses: ./.github/actions/setup
with:
python-version: ${{matrix.python_version}}
- name: Test S3 data for a date range
run: |
noisepy cross_correlate --raw_data_path s3://scedc-pds/continuous_waveforms/ \
--ccf_path $RUNNER_TEMP/CCF_S3 --freq_norm rma \
--xml_path s3://scedc-pds/FDSNstationXML/CI/ \
--stations "SBC,RIO" --start_date 2022-02-02 --end_date 2022-02-04 \
--config configs/s3_anon.yaml
s3_singlepath:
strategy:
fail-fast: true
matrix:
python_version: ['3.9', '3.10']
runs-on: ubuntu-22.04
steps:
- name: Checkout Repo
uses: actions/[email protected]
- name: Setup NoisePy
uses: ./.github/actions/setup
with:
python-version: ${{matrix.python_version}}
- name: Test S3 data with a single path
run: |
noisepy cross_correlate --raw_data_path s3://scedc-pds/continuous_waveforms/2022/2022_002/ \
--ccf_path $RUNNER_TEMP/CCF_S3 --freq_norm rma \
--xml_path s3://scedc-pds/FDSNstationXML/CI/ \
--stations "SBC,RIO" \
--config configs/s3_anon.yaml