Skip to content

[ci] add h5py dependencies #10

[ci] add h5py dependencies

[ci] add h5py dependencies #10

Workflow file for this run

# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: build
on:
push:
pull_request:
schedule:
- cron: '42 4 5,20 * *'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@main
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@main
with:
python-version: 3
- name: Install test dependencies
run: python -m pip install matplotlib "numpy<2" setuptools scipy astropy lightrayrider flake8 pycodestyle pydocstyle pytest coverage coverage_lcov[extras]
- name: Install package
run: python -m pip install .
- name: Lint with flake8
run: flake8 xars/*.py xars/*/*.py
- name: Check code style
run: pycodestyle xars/*.py xars/*/*.py
#- name: Check doc style
# run: pydocstyle lightrayrider/*.py lightrayrider/*.pyx
- name: Test with pytest
run: python3 -m coverage run -a -m pytest xars/binning/__init__.py xars/xsects/__init__.py xars/geometries/layeredconetorus.py xars/geometries/conetorus.py xars/geometries/wedgetorus.py xars/coordtrans.py
- name: Test package
run: |
cd scripts
python3 -m coverage run vizfek2.py
python3 -m coverage run -m xars.xsects
cd ..
- name: Test package
run: |
cd examples
python3 -m coverage run torus2.py --log10nh=24.2 --opening-angle=0 --nevents=100 --output=myoutput
python3 -m coverage run disk.py --nevents=100 --output=output-disk
- name: Test on blobs
run: |
cd example-blobs
echo "backend: Agg" > matplotlibrc
python3 -m coverage run -a generate_blobs.py
python3 -m coverage run -a ../torusC.py --geometry=torusblob23.0.hdf5 --nevents=1000
OMP_NUM_THREADS=3 python3 -m coverage run -a ../torusC.py --geometry=torusblob23.0.hdf5 --nevents=1000
cd ..
- name: Test on grid
run: |
cd example-grid
echo "backend: Agg" > matplotlibrc
python3 -m coverage run -a generate_warpeddisk.py
python3 -m coverage run -a ../torusG.py --geometry=warpeddisk_1.hdf5 --nevents=100
OMP_NUM_THREADS=3 python3 -m coverage run -a ../torusG.py --geometry=warpeddisk_1.hdf5 --nevents=100
cd ..
- name: Run entire BNTorus geometry
run: |
bash runtorus.sh 100
- name: Convert coverage output to lcov for coveralls
run: |
cd ..
coverage combine .coverage examples/.coverage examples/example-*/.coverage
coverage-lcov
# make paths relative
sed -i s,$PWD/,,g lcov.info
- name: prepare coveralls partial upload
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.github_token }}
path-to-lcov: lcov.info
flag-name: run-${{ matrix.python-version }}
parallel: true
finish:
needs: build
if: ${{ always() }}
runs-on: ubuntu-latest
steps:
- name: Coveralls Finished
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.github_token }}
parallel-finished: true
carryforward: "run-1,run-2"