Skip to content

Commit

Permalink
Merge pull request #457 from eqcorrscan/develop
Browse files Browse the repository at this point in the history
Merge for 0.4.3 release
  • Loading branch information
calum-chamberlain authored Apr 20, 2021
2 parents c3c2d44 + 84595cb commit d3f2e97
Show file tree
Hide file tree
Showing 33 changed files with 1,327 additions and 437 deletions.
69 changes: 0 additions & 69 deletions .circleci/config.yml

This file was deleted.

80 changes: 63 additions & 17 deletions .github/workflows/runtest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,45 @@ on: [pull_request] #, push]

jobs:
# Runs the tests on combinations of the supported python/os matrix.
test-code-macOS:
runs-on: "macos-latest"
test-code:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: [3.7, 3.8]
fail-fast: false
# continue-on-error: true

steps:
- uses: actions/checkout@v2

- name: Get conda env file
shell: bash -l {0}
run: |
if [ "$RUNNER_OS" == "macOS" ]; then
cp .github/test_conda_env_macOS.yml .github/test_conda_env.yml
fi
- name: Cache conda
uses: actions/cache@v2
env:
# Increase this value to reset cache if needed by env file has not changed
CACHE_NUMBER: 0
with:
path: ~/conda_pkgs_dir
key:
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{
hashFiles('.github/test_conda_env.yml') }}

- name: Setup conda
uses: conda-incubator/setup-miniconda@v2
with:
miniconda-version: 'latest'
python-version: ${{ matrix.python-version }}
activate-environment: eqcorrscan-test
environment-file: .github/test_conda_env_macOS.yml
environment-file: .github/test_conda_env.yml
condarc-file: .github/test_condarc.yml
use-only-tar-bz2: true # Must be set for caching to work properly

- name: install eqcorrscan
shell: bash -l {0}
Expand All @@ -33,21 +54,32 @@ jobs:
conda info -a
conda list
# - name: run all tests
# shell: bash -l {0}
# run: |
# py.test -n 2 -m "not serial and not network and not superslow" --cov-report=xml
# export OMP_NUM_THREADS=2
# py.test -m "serial and not network" --cov-report=xml --cov-append
# py.test -v -m "slow and not serial and not network" --cov-report=xml --cov-append

- name: run main test suite
shell: bash -l {0}
continue-on-error: true
run: |
py.test -n 2 -m "not serial and not network and not superslow" --cov-report=xml
- name: run slow tests
shell: bash -l {0}
run: |
py.test -v -m "slow and not serial and not network" --cov-report=xml --cov-append
- name: run serial test
if: always()
shell: bash -l {0}
run: |
export OMP_NUM_THREADS=2
py.test -m "serial and not network" --cov-report=xml --cov-append
- name: run slow tests
if: always()
shell: bash -l {0}
run: |
py.test -v -m "slow and not serial and not network" --cov-report=xml --cov-append
- name: upload coverage
uses: codecov/codecov-action@v1
with:
Expand All @@ -58,16 +90,28 @@ jobs:
yml: ./codecov.yml
fail_ci_if_error: true

test-code-ubuntu:

test-code-slow:
runs-on: "ubuntu-latest"
strategy:
matrix:
python-version: [3.7, 3.8]
python-version: [3.8]
fail-fast: false

steps:
- uses: actions/checkout@v2

- name: Cache conda
uses: actions/cache@v2
env:
# Increase this value to reset cache if needed by env file has not changed
CACHE_NUMBER: 0
with:
path: ~/conda_pkgs_dir
key:
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{
hashFiles('.github/test_conda_env.yml') }}

- name: Setup conda
uses: conda-incubator/setup-miniconda@v2
with:
Expand All @@ -76,6 +120,7 @@ jobs:
activate-environment: eqcorrscan-test
environment-file: .github/test_conda_env.yml
condarc-file: .github/test_condarc.yml
use-only-tar-bz2: true # Must be set for caching to work properly

- name: install eqcorrscan
shell: bash -l {0}
Expand All @@ -88,19 +133,20 @@ jobs:
conda info -a
conda list
- name: run main test suite
- name: run network tests
shell: bash -l {0}
run: |
py.test -n 2 -m "not serial and not network and not superslow" --cov-report=xml
- name: run slow tests
py.test -n 2 -m "network" --cov-report=xml
- name: run tutorials
if: always()
shell: bash -l {0}
run: |
py.test -v -m "slow and not serial and not network" --cov-report=xml --cov-append
- name: run serial test
py.test eqcorrscan/doc/tutorials/*.rst eqcorrscan/doc/submodules/*.rst --cov-report=xml --cov-append
- name: run superslow tests
if: always()
shell: bash -l {0}
run: |
export OMP_NUM_THREADS=2
py.test -m "serial and not network" --cov-report=xml --cov-append
py.test -m "superslow" -s eqcorrscan/tests/tutorials_test.py eqcorrscan/tests/subspace_test.py --cov-report=xml --cov-append
- name: upload coverage
uses: codecov/codecov-action@v1
Expand Down
56 changes: 54 additions & 2 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,57 @@
## Current

## 0.4.3
* core.match_filter
- match_filter:
- Provide option of exporting the cross-correlation sums for additional later
analysis.
* core.match_filter.party.write
- BUG-FIX: When `format='tar'` is selected, added a check for .tgz-file
suffix before checking the filename against an existing file. Previously,
when a filename without '.tgz'-suffix was supplied, then the file was
overwritten against the function's intention.
- Add option `overwrite=True` to allow overwriting of existing files.
* core.match_filter.party.read
- BUG-FIX: Ensure wildcard reading works as expected: #453
* core.match_filter.party.rethreshold:
- added option to rethreshold based on absolute values to keep relevant
detections with large negative detect_val.
* core.lag_calc:
- Added option to set minimum CC threshold individually for detections based
on: min(detect_val / n_chans * min_cc_from_mean_cc_factor, min_cc).
- Added the ability of saving correlation data of the lag_calc.
* core.template_gen:
- Added support for generating templates from any object with a
get_waveforms method. See #459.
* utils.mag_calc.calc_b_value:
- Added useful information to doc-string regarding method and meaning of
residuals
- Changed the number of magnitudes used to an int (from a string!?)
* utils.mag_calc.relative_magnitude:
- Refactor so that `min_cc` is used regardless of whether
`weight_by_correlation` is set. See issue #455.
* utils.archive_read
- Add support for wildcard-comparisons in the list of requested stations and
channels.
- New option `arctype='SDS'` to read from a SeisComp Data Structure (SDS).
This option is also available in `utils.clustering.extract_detections` and
in `utils.archive_read._check_available_data`.
* utils.catalog_to_dd
- Bug-fixes in #424:
- only P and S phases are used now (previously spurious amplitude picks
were included in correlations);
- Checks for length are done prior to correlations and more helpful error
outputs are provided.
- Progress is not reported within dt.cc computation
- `write_station` now supports writing elevations: #424.
* utils.clustering
- For `cluster`, `distance_matrix` and `cross_chan_correlation`, implemented
full support for `shift_len != 0`. The latter two functions now return, in
addition to the distance-matrix, a shift-matrix (both functions) and a
shift-dictionary (for `distance_matrix`). New option for shifting streams
as a whole or letting traces shift individually
(`allow_individual_trace_shifts=True`).
* utils.plotting
- Function added (twoD_seismplot) for plotting seismicity (#365).

## 0.4.2
* Add seed-ids to the _spike_test's message.
* utils.correlation
Expand Down
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,8 @@ Note that tests for travis and appveyor are run daily on master as cron jobs, an

| Service tests | Badge |
|---------------|-------|
| MacOS & Linux | ![test](https://github.com/eqcorrscan/EQcorrscan/workflows/test/badge.svg)
| Windows | [![Build status](https://ci.appveyor.com/api/projects/status/6pp6jdop14hj4e63/branch/master?svg=true)](https://ci.appveyor.com/project/EQcorrscan/eqcorrscan/branch/master)
| CI checks | ![test](https://github.com/eqcorrscan/EQcorrscan/workflows/test/badge.svg)
| Code coverage | [![codecov](https://codecov.io/gh/eqcorrscan/EQcorrscan/branch/master/graph/badge.svg)](https://codecov.io/gh/eqcorrscan/EQcorrscan)
| Network tests | [![CircleCI](https://circleci.com/gh/eqcorrscan/EQcorrscan/tree/master.svg?style=svg)](https://circleci.com/gh/eqcorrscan/EQcorrscan/tree/master)

# Licence

Expand Down
65 changes: 0 additions & 65 deletions appveyor.yml

This file was deleted.

2 changes: 2 additions & 0 deletions conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ def clean_up_test_files():
'test_waveforms.ms',
'mag_calc.out',
'station.dat',
'station_elev.dat',
'test_waveform.ms',
'01-0410-35L.S201309',
'04-0007-55R.S201601',
Expand Down Expand Up @@ -83,6 +84,7 @@ def clean_up_test_directories():
'test_party_out',
'test_tar_write',
'tmp1',
'cc_exported',
]

yield
Expand Down
2 changes: 1 addition & 1 deletion eqcorrscan/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

__all__ = ['core', 'utils', 'tutorials', 'tests']

__version__ = '0.4.2'
__version__ = '0.4.3'

# Cope with changes to name-space to remove most of the camel-case
_import_map = {}
Expand Down
Loading

0 comments on commit d3f2e97

Please sign in to comment.