Skip to content

Gaussian filter and smoothing recipe #299

Gaussian filter and smoothing recipe

Gaussian filter and smoothing recipe #299

# Run minimum dependency tests without conda
name: TestCodeMinDeps
on:
push:
branches:
- master
pull_request:
branches:
- master
paths:
- 'pyproject.toml'
- '**.py'
- '.github/workflows/runtests.yml'
env:
# used to manually trigger cache reset. Just increment if needed.
CACHE_NUMBER: 1
# Cancel previous runs when this one starts.
concurrency:
group: TestCodeMinDeps-${{ github.event.pull_request.number || github.run_id }}
cancel-in-progress: true
jobs:
# Runs the tests on combinations of the supported python/os matrix.
test_code_min_deps:
timeout-minutes: 25
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ['3.12']
# only run if CI isn't turned off
if: github.event_name == 'push' || !contains(github.event.pull_request.labels.*.name, 'no_ci')
env:
# set path of test environment for caching
prefix: ${{ startsWith(matrix.os, 'ubuntu') && '/usr/share/miniconda3/envs/dascore'
|| startsWith(matrix.os, 'macos') && '/Users/runner/miniconda3/envs/dascore'
|| startsWith(matrix.os, 'windows') && 'C:\Miniconda3\envs\dascore' }}
# set individual cache key (only the start of it)
cache_key: ${{ matrix.os }}-py${{ matrix.python-version }}
# set conda environment file with dependencies
env_file: "environment.yml"
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: install dascore
shell: bash -l {0}
run: |
export PATH="$pythonLocation:$PATH"
python -m pip install -e .[test]
- name: set data cache path
shell: bash -l {0}
run: |
export PATH="$pythonLocation:$PATH"
echo "DATA_CACHE_PATH=$(python -c "import pooch; print(pooch.os_cache('dascore'))")" >> $GITHUB_ENV
- name: cache test data
uses: actions/cache@v3
with:
enableCrossOsArchive: true
path: ${{ env.DATA_CACHE_PATH }}
key: DATA_${{ env.CACHE_NUMBER }}
- name: run test suite
shell: bash -l {0}
run: ./.github/test_code.sh
# Runs examples in docstrings
- name: test docstrings
shell: bash -l {0}
run: ./.github/test_code.sh doctest