Skip to content

Commit d3f2e97

Browse files
Merge pull request #457 from eqcorrscan/develop
Merge for 0.4.3 release
2 parents c3c2d44 + 84595cb commit d3f2e97

33 files changed

+1327
-437
lines changed

.circleci/config.yml

Lines changed: 0 additions & 69 deletions
This file was deleted.

.github/workflows/runtest.yml

Lines changed: 63 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,45 @@ on: [pull_request] #, push]
33

44
jobs:
55
# Runs the tests on combinations of the supported python/os matrix.
6-
test-code-macOS:
7-
runs-on: "macos-latest"
6+
test-code:
7+
runs-on: ${{ matrix.os }}
88
strategy:
99
matrix:
10+
os: [ubuntu-latest, macos-latest, windows-latest]
1011
python-version: [3.7, 3.8]
1112
fail-fast: false
13+
# continue-on-error: true
1214

1315
steps:
1416
- uses: actions/checkout@v2
1517

18+
- name: Get conda env file
19+
shell: bash -l {0}
20+
run: |
21+
if [ "$RUNNER_OS" == "macOS" ]; then
22+
cp .github/test_conda_env_macOS.yml .github/test_conda_env.yml
23+
fi
24+
25+
- name: Cache conda
26+
uses: actions/cache@v2
27+
env:
28+
# Increase this value to reset cache if needed by env file has not changed
29+
CACHE_NUMBER: 0
30+
with:
31+
path: ~/conda_pkgs_dir
32+
key:
33+
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{
34+
hashFiles('.github/test_conda_env.yml') }}
35+
1636
- name: Setup conda
1737
uses: conda-incubator/setup-miniconda@v2
1838
with:
1939
miniconda-version: 'latest'
2040
python-version: ${{ matrix.python-version }}
2141
activate-environment: eqcorrscan-test
22-
environment-file: .github/test_conda_env_macOS.yml
42+
environment-file: .github/test_conda_env.yml
2343
condarc-file: .github/test_condarc.yml
44+
use-only-tar-bz2: true # Must be set for caching to work properly
2445

2546
- name: install eqcorrscan
2647
shell: bash -l {0}
@@ -33,21 +54,32 @@ jobs:
3354
conda info -a
3455
conda list
3556
57+
# - name: run all tests
58+
# shell: bash -l {0}
59+
# run: |
60+
# py.test -n 2 -m "not serial and not network and not superslow" --cov-report=xml
61+
# export OMP_NUM_THREADS=2
62+
# py.test -m "serial and not network" --cov-report=xml --cov-append
63+
# py.test -v -m "slow and not serial and not network" --cov-report=xml --cov-append
64+
3665
- name: run main test suite
3766
shell: bash -l {0}
38-
continue-on-error: true
3967
run: |
4068
py.test -n 2 -m "not serial and not network and not superslow" --cov-report=xml
41-
- name: run slow tests
42-
shell: bash -l {0}
43-
run: |
44-
py.test -v -m "slow and not serial and not network" --cov-report=xml --cov-append
69+
4570
- name: run serial test
71+
if: always()
4672
shell: bash -l {0}
4773
run: |
4874
export OMP_NUM_THREADS=2
4975
py.test -m "serial and not network" --cov-report=xml --cov-append
5076
77+
- name: run slow tests
78+
if: always()
79+
shell: bash -l {0}
80+
run: |
81+
py.test -v -m "slow and not serial and not network" --cov-report=xml --cov-append
82+
5183
- name: upload coverage
5284
uses: codecov/codecov-action@v1
5385
with:
@@ -58,16 +90,28 @@ jobs:
5890
yml: ./codecov.yml
5991
fail_ci_if_error: true
6092

61-
test-code-ubuntu:
93+
94+
test-code-slow:
6295
runs-on: "ubuntu-latest"
6396
strategy:
6497
matrix:
65-
python-version: [3.7, 3.8]
98+
python-version: [3.8]
6699
fail-fast: false
67100

68101
steps:
69102
- uses: actions/checkout@v2
70103

104+
- name: Cache conda
105+
uses: actions/cache@v2
106+
env:
107+
# Increase this value to reset cache if needed by env file has not changed
108+
CACHE_NUMBER: 0
109+
with:
110+
path: ~/conda_pkgs_dir
111+
key:
112+
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{
113+
hashFiles('.github/test_conda_env.yml') }}
114+
71115
- name: Setup conda
72116
uses: conda-incubator/setup-miniconda@v2
73117
with:
@@ -76,6 +120,7 @@ jobs:
76120
activate-environment: eqcorrscan-test
77121
environment-file: .github/test_conda_env.yml
78122
condarc-file: .github/test_condarc.yml
123+
use-only-tar-bz2: true # Must be set for caching to work properly
79124

80125
- name: install eqcorrscan
81126
shell: bash -l {0}
@@ -88,19 +133,20 @@ jobs:
88133
conda info -a
89134
conda list
90135
91-
- name: run main test suite
136+
- name: run network tests
92137
shell: bash -l {0}
93138
run: |
94-
py.test -n 2 -m "not serial and not network and not superslow" --cov-report=xml
95-
- name: run slow tests
139+
py.test -n 2 -m "network" --cov-report=xml
140+
- name: run tutorials
141+
if: always()
96142
shell: bash -l {0}
97143
run: |
98-
py.test -v -m "slow and not serial and not network" --cov-report=xml --cov-append
99-
- name: run serial test
144+
py.test eqcorrscan/doc/tutorials/*.rst eqcorrscan/doc/submodules/*.rst --cov-report=xml --cov-append
145+
- name: run superslow tests
146+
if: always()
100147
shell: bash -l {0}
101148
run: |
102-
export OMP_NUM_THREADS=2
103-
py.test -m "serial and not network" --cov-report=xml --cov-append
149+
py.test -m "superslow" -s eqcorrscan/tests/tutorials_test.py eqcorrscan/tests/subspace_test.py --cov-report=xml --cov-append
104150
105151
- name: upload coverage
106152
uses: codecov/codecov-action@v1

CHANGES.md

Lines changed: 54 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,57 @@
1-
## Current
2-
1+
## 0.4.3
2+
* core.match_filter
3+
- match_filter:
4+
- Provide option of exporting the cross-correlation sums for additional later
5+
analysis.
6+
* core.match_filter.party.write
7+
- BUG-FIX: When `format='tar'` is selected, added a check for .tgz-file
8+
suffix before checking the filename against an existing file. Previously,
9+
when a filename without '.tgz'-suffix was supplied, then the file was
10+
overwritten against the function's intention.
11+
- Add option `overwrite=True` to allow overwriting of existing files.
12+
* core.match_filter.party.read
13+
- BUG-FIX: Ensure wildcard reading works as expected: #453
14+
* core.match_filter.party.rethreshold:
15+
- added option to rethreshold based on absolute values to keep relevant
16+
detections with large negative detect_val.
17+
* core.lag_calc:
18+
- Added option to set minimum CC threshold individually for detections based
19+
on: min(detect_val / n_chans * min_cc_from_mean_cc_factor, min_cc).
20+
- Added the ability of saving correlation data of the lag_calc.
21+
* core.template_gen:
22+
- Added support for generating templates from any object with a
23+
get_waveforms method. See #459.
24+
* utils.mag_calc.calc_b_value:
25+
- Added useful information to doc-string regarding method and meaning of
26+
residuals
27+
- Changed the number of magnitudes used to an int (from a string!?)
28+
* utils.mag_calc.relative_magnitude:
29+
- Refactor so that `min_cc` is used regardless of whether
30+
`weight_by_correlation` is set. See issue #455.
31+
* utils.archive_read
32+
- Add support for wildcard-comparisons in the list of requested stations and
33+
channels.
34+
- New option `arctype='SDS'` to read from a SeisComp Data Structure (SDS).
35+
This option is also available in `utils.clustering.extract_detections` and
36+
in `utils.archive_read._check_available_data`.
37+
* utils.catalog_to_dd
38+
- Bug-fixes in #424:
39+
- only P and S phases are used now (previously spurious amplitude picks
40+
were included in correlations);
41+
- Checks for length are done prior to correlations and more helpful error
42+
outputs are provided.
43+
- Progress is not reported within dt.cc computation
44+
- `write_station` now supports writing elevations: #424.
45+
* utils.clustering
46+
- For `cluster`, `distance_matrix` and `cross_chan_correlation`, implemented
47+
full support for `shift_len != 0`. The latter two functions now return, in
48+
addition to the distance-matrix, a shift-matrix (both functions) and a
49+
shift-dictionary (for `distance_matrix`). New option for shifting streams
50+
as a whole or letting traces shift individually
51+
(`allow_individual_trace_shifts=True`).
52+
* utils.plotting
53+
- Function added (twoD_seismplot) for plotting seismicity (#365).
54+
355
## 0.4.2
456
* Add seed-ids to the _spike_test's message.
557
* utils.correlation

README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,8 @@ Note that tests for travis and appveyor are run daily on master as cron jobs, an
8181

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

8987
# Licence
9088

appveyor.yml

Lines changed: 0 additions & 65 deletions
This file was deleted.

conftest.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ def clean_up_test_files():
4949
'test_waveforms.ms',
5050
'mag_calc.out',
5151
'station.dat',
52+
'station_elev.dat',
5253
'test_waveform.ms',
5354
'01-0410-35L.S201309',
5455
'04-0007-55R.S201601',
@@ -83,6 +84,7 @@ def clean_up_test_directories():
8384
'test_party_out',
8485
'test_tar_write',
8586
'tmp1',
87+
'cc_exported',
8688
]
8789

8890
yield

eqcorrscan/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525

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

28-
__version__ = '0.4.2'
28+
__version__ = '0.4.3'
2929

3030
# Cope with changes to name-space to remove most of the camel-case
3131
_import_map = {}

0 commit comments

Comments
 (0)