Skip to content

Commit

Permalink
Merge pull request #557 from eqcorrscan/develop
Browse files Browse the repository at this point in the history
Merge for new release
  • Loading branch information
calum-chamberlain authored Dec 11, 2023
2 parents 886aa38 + 137690c commit acf20c3
Show file tree
Hide file tree
Showing 71 changed files with 6,727 additions and 3,459 deletions.
1 change: 1 addition & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[run]
branch = True
source = eqcorrscan
concurrency = multiprocessing,thread
omit =
eqcorrscan/__init__.py
eqcorrscan/*/__init__.py
Expand Down
10 changes: 4 additions & 6 deletions .github/test_conda_env.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ channels:
dependencies:
- numpy>=1.12
- matplotlib>=1.3.0
- scipy>=0.18,<1.9.0 # Pinned due to scipy/obspy hanning renaming
- scipy
- mock
- obspy>=1.3.0
- obspy>=1.4.0
- h5py
- pyyaml
- bottleneck
Expand All @@ -17,8 +17,6 @@ dependencies:
- pytest-pep8
- pytest-xdist
- pytest-rerunfailures
- pytest-mpl<0.16.0
- pytest-mpl
- codecov
- pip
- pip:
- pyfftw
- boto3
31 changes: 17 additions & 14 deletions .github/test_conda_env_macOS.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,28 @@
name: eqcorrscan-test
channels:
- conda-forge
- defaults
dependencies:
- clangdev>=4
- openmp>=4
- libcxx>=4
- cctools
- clang
# Compiler bits to match conda-forge build env
- cctools_osx-64
- clang=14
- clang-14
- clang_osx-64
- llvm-openmp
- clangxx=14
- compiler-rt
- libcxx
- llvm-openmp>=4.0.1
- compiler-rt_osx-64
- ld64_osx-64
- libclang-cpp14
- libcxx=14
- libllvm14
- llvm-tools
# Normal requirements
- numpy>=1.12
- matplotlib>=1.3.0
- scipy>=0.18,<1.9.0 # Pinned due to scipy/obspy hanning renaming
- scipy
- mock
- obspy>=1.3.0
- h5py<3.2 # Issue with dep resolution: https://github.com/conda-forge/h5py-feedstock/issues/92
- obspy>=1.4.0
- h5py>3.3 # Issue with dep resolution: https://github.com/conda-forge/h5py-feedstock/issues/92
- pyyaml
- bottleneck
- fftw
Expand All @@ -28,6 +33,4 @@ dependencies:
- pytest-rerunfailures
- pytest-mpl<0.16.0
- codecov
- pip
- pip:
- pyfftw
- boto3
17 changes: 17 additions & 0 deletions .github/workflows/flake8-linter-matcher.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"problemMatcher": [
{
"owner": "flake8-linter-error",
"severity": "error",
"pattern": [
{
"regexp": "^([^:]+):(\\d+):(\\d+):\\s+([EWCNF]\\d+\\s+.+)$",
"file": 1,
"line": 2,
"column": 3,
"message": 4
}
]
}
]
}
27 changes: 27 additions & 0 deletions .github/workflows/flake8.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Flake8 Linter
on:
pull_request:
jobs:
flake8-linter:
runs-on: ubuntu-latest
steps:
- name: Checkout source
uses: actions/checkout@v3
- name: Install Python 3.10
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install Flake8 5.0.4 linter
run: pip install flake8==5.0.4 # use this version for --diff option
- name: Setup Flake8 output matcher for PR annotations
run: echo '::add-matcher::.github/workflows/flake8-linter-matcher.json'
- name: Fetch pull request target branch
run: |
git remote add upstream https://github.com/eqcorrscan/EQcorrscan.git
git fetch upstream $GITHUB_BASE_REF
- name: Run Flake8 linter
run: git diff upstream/$GITHUB_BASE_REF HEAD | flake8
--exclude eqcorrscan/doc
--ignore W605,W504,W503
--max-line-length 80
--diff
99 changes: 36 additions & 63 deletions .github/workflows/runtest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ['3.7', '3.8', '3.9']
python-version: ['3.8', '3.9', '3.10', '3.11']
fail-fast: false
# continue-on-error: true

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Get conda env file
shell: bash -l {0}
Expand All @@ -22,31 +22,22 @@ jobs:
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
uses: conda-incubator/setup-miniconda@v2.1.1
with:
miniconda-version: 'latest'
miniforge-variant: Mambaforge
miniforge-version: latest
python-version: ${{ matrix.python-version }}
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
use-mamba: true

- name: Update Env
run: mamba env update -n eqcorrscan-test -f .github/test_conda_env.yml

- name: install eqcorrscan
shell: bash -l {0}
run: |
pip install -e .
pip install -v -e . --no-deps
- name: print package info
shell: bash -l {0}
Expand All @@ -65,7 +56,7 @@ jobs:
- name: run main test suite
shell: bash -l {0}
run: |
py.test -n 2 -m "not serial and not network and not superslow" --cov-report=xml --dist loadscope
py.test -n 2 -m "not serial and not network and not superslow and not slow" --cov-report=xml --dist loadscope
- name: run serial test
if: always()
Expand All @@ -81,7 +72,7 @@ jobs:
py.test -v -m "slow and not serial and not network" --cov-report=xml --cov-append
- name: upload coverage
uses: codecov/codecov-action@v1
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.xml
Expand All @@ -95,37 +86,28 @@ jobs:
runs-on: "ubuntu-latest"
strategy:
matrix:
python-version: [3.8]
python-version: ['3.10']
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') }}
- uses: actions/checkout@v3

- name: Setup conda
uses: conda-incubator/setup-miniconda@v2
uses: conda-incubator/setup-miniconda@v2.1.1
with:
miniconda-version: 'latest'
miniforge-variant: Mambaforge
miniforge-version: latest
python-version: ${{ matrix.python-version }}
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
use-mamba: true

- name: Update Env
run: mamba env update -n eqcorrscan-test -f .github/test_conda_env.yml

- name: install eqcorrscan
shell: bash -l {0}
run: |
pip install -e .
pip install -e . --no-deps
- name: print package info
shell: bash -l {0}
Expand All @@ -136,7 +118,7 @@ jobs:
- name: run network tests
shell: bash -l {0}
run: |
py.test -n 2 -m "network" --cov-report=xml
py.test -n 2 -m "network and not superslow" --cov-report=xml
- name: run tutorials
if: always()
shell: bash -l {0}
Expand All @@ -149,7 +131,7 @@ jobs:
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
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.xml
Expand All @@ -162,40 +144,31 @@ jobs:
runs-on: "ubuntu-latest"
strategy:
matrix:
python-version: [3.8]
python-version: ['3.9']
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') }}

- uses: actions/checkout@v3

- name: Setup conda
uses: conda-incubator/setup-miniconda@v2
uses: conda-incubator/setup-miniconda@v2.1.1
with:
miniconda-version: 'latest'
miniforge-variant: Mambaforge
miniforge-version: latest
python-version: ${{ matrix.python-version }}
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
use-mamba: true

- name: Update Env
run: mamba env update -n eqcorrscan-test -f .github/test_conda_env.yml

- name: install fmf
shell: bash -l {0}
run: |
cd ..
git clone https://github.com/beridel/fast_matched_filter.git
cd fast_matched_filter
pip install -e .
pip install -e . --no-deps
cd ../EQcorrscan
- name: install eqcorrscan
Expand All @@ -216,7 +189,7 @@ jobs:
py.test eqcorrscan/tests/correlate_test.py --cov-report=xml
- name: upload coverage
uses: codecov/codecov-action@v1
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.xml
Expand Down
3 changes: 2 additions & 1 deletion .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ sphinx:
configuration: eqcorrscan/doc/conf.py

# Optionally build your docs in additional formats such as PDF and ePub
formats: all
# See https://docs.readthedocs.io/en/stable/config-file/v2.html#formats
formats: []

# Optionally set the version of Python and requirements required to build your docs
python:
Expand Down
7 changes: 0 additions & 7 deletions .stickler.yml

This file was deleted.

Loading

0 comments on commit acf20c3

Please sign in to comment.