Skip to content

Commit

Permalink
Merge pull request #55 from HERA-Team/progress
Browse files Browse the repository at this point in the history
Progress
  • Loading branch information
steven-murray authored May 8, 2023
2 parents 58b25a2 + fb8d198 commit 7050d19
Show file tree
Hide file tree
Showing 24 changed files with 311 additions and 212 deletions.
63 changes: 34 additions & 29 deletions .github/workflows/run_notebooks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,46 +15,51 @@ jobs:
notebooks:
name: Running Docs Notebooks
runs-on: ubuntu-latest
defaults:
run:
# Adding -l {0} ensures conda can be found properly in each step
shell: bash -l {0}
# defaults:
# run:
# # Adding -l {0} ensures conda can be found properly in each step
# shell: bash -l {0}
steps:
- uses: actions/checkout@main
with:
fetch-depth: 1

- name: Cache conda
uses: actions/cache@v2
env:
# Increase this value to reset cache if ci/test-env.yml has not changed
CACHE_NUMBER: 0
- uses: mpi4py/setup-mpi@v1
- name: Setup Python
uses: actions/setup-python@v4
with:
path: ~/conda_pkgs_dir
key:
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{ matrix.python-version }}-${{ hashFiles('ci/test-env.yml', 'setup.cfg') }}
python-version: ${{ matrix.python-version }}

- name: Setup Miniconda
uses: conda-incubator/setup-miniconda@v2.1.1
with:
# auto-update-conda: true
miniconda-version: "latest"
python-version: '3.10'
environment-file: ci/notebook-env.yml
activate-environment: viscpu
channels: conda-forge,defaults
channel-priority: strict
use-only-tar-bz2: true
# - name: Cache conda
# uses: actions/cache@v2
# env:
# # Increase this value to reset cache if ci/test-env.yml has not changed
# CACHE_NUMBER: 0
# with:
# path: ~/conda_pkgs_dir
# key:
# ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{ matrix.python-version }}-${{ hashFiles('ci/test-env.yml', 'setup.cfg') }}

- name: Conda Info
run: |
conda info -a
conda list
# - name: Setup Miniconda
# uses: conda-incubator/setup-miniconda@v2.1.1
# with:
# # auto-update-conda: true
# miniconda-version: "latest"
# python-version: '3.10'
# environment-file: ci/notebook-env.yml
# activate-environment: viscpu
# channels: conda-forge,defaults
# channel-priority: strict
# use-only-tar-bz2: true

# - name: Conda Info
# run: |
# conda info -a
# conda list

- name: Install
run: |
echo $(which pip)
pip install .[test]
pip install .[test] papermill jupyter ipykernel
- name: Install ipykernel
run: python -m ipykernel install --user --name viscpu --display-name "viscpu"
Expand Down
91 changes: 58 additions & 33 deletions .github/workflows/test_suite.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,63 +12,88 @@ on:
- 'main'

jobs:
tests:
cpu_tests:
env:
ENV_NAME: tests
PYTHON: ${{ matrix.python-version }}
OS: ${{ matrix.os }}
LOG_LEVEL: ${{ (matrix.os == 'macos-latest' && 'WARNING') || 'INFO' }} # Suppress logging on macOS
name: Testing
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
python-version: [3.8, 3.9, "3.10"]
defaults:
run:
# Adding -l {0} ensures conda can be found properly in each step
shell: bash -l {0}
python-version: [3.9, "3.10", "3.11"]
steps:
- uses: actions/checkout@main
with:
fetch-depth: 1
- uses: mpi4py/setup-mpi@v1
- uses: FedericoCarboni/setup-ffmpeg@v2

- name: Cache conda
uses: actions/cache@v2
env:
# Increase this value to reset cache if ci/test-env.yml has not changed
CACHE_NUMBER: 0
- name: Setup Python
uses: actions/setup-python@v4
with:
path: ~/conda_pkgs_dir
key:
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{ matrix.python-version }}-${{ hashFiles('ci/test-env.yml', 'setup.cfg') }}
python-version: ${{ matrix.python-version }}

- name: Install
run: |
pip install .[test]
- name: Run Tests
run: |
python -m pytest --ignore tests/test_plot.py --cov=vis_cpu --cov-config=.coveragerc --cov-report xml:./coverage.xml --durations=25 --log-cli-level=${{ env.LOG_LEVEL}}
- name: Run Plotting Tests
if: matrix.python-version != '3.9' || matrix.os == 'macos-latest'
run: |
python -m pytest tests/test_plot.py --cov=vis_cpu --cov-config=.coveragerc --cov-append --cov-report xml:./coverage.xml --durations=25 --log-cli-level=INFO
- name: Setup Miniconda
uses: conda-incubator/setup-miniconda@v2.1.1
- name: Upload coverage report
uses: codecov/codecov-action@v3.1.3
with:
# auto-update-conda: true
miniconda-version: "latest"
python-version: ${{ matrix.python-version }}
environment-file: ci/test-env.yml
activate-environment: tests
channels: conda-forge,defaults
channel-priority: strict
use-only-tar-bz2: true
file: ./coverage.xml
flags: unittests
name: codecov-umbrella
fail_ci_if_error: true

- name: Conda Info
gpu_tests:
env:
ENV_NAME: tests
PYTHON: "3.10"
OS: Ubuntu
name: Self-Hosted Tests (GPU)
runs-on: [self-hosted, gpu]

steps:
- name: Add Home to PATH
run: |
conda info -a
conda list
PYVER=`python -c "import sys; print('{:d}.{:d}'.format(sys.version_info.major, sys.version_info.minor))"`
if [[ $PYVER != $PYTHON ]]; then
exit 1;
fi
echo "/home/locoadmin/bin" >> $GITHUB_PATH
echo "/usr/local/cuda/bin" >> $GITHUB_PATH
- uses: actions/checkout@main
with:
fetch-depth: 0

- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: ${{ env.PYTHON }}

- name: Install
run: |
echo $(which pip)
pip install .[test]
pip install .[test,gpu]
- name: Run Tests
run: |
python -m pytest --cov=vis_cpu --cov-config=.coveragerc --cov-report xml:./coverage.xml --durations=25
python -m pytest -k "gpu" --cov=vis_cpu --cov-config=.coveragerc --cov-report xml:./coverage.xml --durations=25 --log-cli-level=INFO
- name: Upload coverage report
uses: codecov/codecov-action@v3.1.3
with:
file: ./coverage.xml
flags: unittests
name: codecov-umbrella
fail_ci_if_error: true
82 changes: 0 additions & 82 deletions .github/workflows/test_suite_gpu.yaml

This file was deleted.

16 changes: 8 additions & 8 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ exclude: '^docs/conf.py|^src/vis_cpu/data/'

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
rev: v4.4.0
hooks:
- id: trailing-whitespace
- id: check-added-large-files
Expand All @@ -18,7 +18,7 @@ repos:
args: ['--fix=no']

- repo: https://github.com/PyCQA/flake8
rev: 4.0.1
rev: 6.0.0
hooks:
- id: flake8
additional_dependencies:
Expand All @@ -33,27 +33,27 @@ repos:
- flake8-print

- repo: https://github.com/psf/black
rev: 22.6.0
rev: 23.3.0
hooks:
- id: black

- repo: https://github.com/pre-commit/pygrep-hooks
rev: v1.9.0
rev: v1.10.0
hooks:
- id: rst-backticks

- repo: https://github.com/PyCQA/isort
rev: 5.10.1
rev: 5.12.0
hooks:
- id: isort

- repo: https://github.com/asottile/pyupgrade
rev: v2.37.1
rev: v3.3.2
hooks:
- id: pyupgrade
args: [--py38-plus]
args: [--py39-plus]

- repo: https://github.com/asottile/setup-cfg-fmt
rev: v1.20.2
rev: v2.2.0
hooks:
- id: setup-cfg-fmt
12 changes: 8 additions & 4 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,16 @@ version: 2
sphinx:
configuration: docs/conf.py

conda:
environment: docs/environment.yaml
# conda:
# environment: docs/environment.yaml
build:
os: ubuntu-22.04
tools:
python: "3.11"

python:
version: 3.7
install:
- method: pip
path: .
system_packages: true
extra_requirements:
- docs
20 changes: 10 additions & 10 deletions ci/test-env.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@ channels:
- conda-forge
- defaults
dependencies:
- mpi4py>=3.0,<4 # Required here so that we get
- astropy>=4,<5
- numpy>=1.20,<2.0
- scipy>=1.6,<2.0
- pip>=21.1,<22
- mpi4py>=3.0
- astropy>=4
- numpy>=1.20
- scipy>=1.6
- pip>=21.1
- pytest>=6.2.4
- pytest-cov>=2.11.1
- matplotlib>=3.3.4,<4
- ipython>=7.22,<8
- h5py>=3.2,<4
- matplotlib>=3.3.4
- ipython>=7.22
- h5py>=3.2
- ffmpeg
- pyuvdata # For testing when using UVBeam object
- pip:
- pyuvsim[sim]>=1.2,<1.4
- pyradiosky>=0.1.1,<0.3
- pyuvsim[sim]>=1.2
- pyradiosky>=0.1.1
2 changes: 2 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
fixes:
- "/home/runner/work/vis_cpu/::"
codecov:
token: f1912835-f0e2-4153-891b-f68eb359207f
Loading

0 comments on commit 7050d19

Please sign in to comment.