diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 80daa20..560fefe 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,8 +21,10 @@ jobs: - name: Install dependencies run: | + sudo apt-get install pandoc python -m pip install --upgrade pip - pip install flake8 pytest pytest-cov + pip install flake8 pytest pytest-cov sphinx + pip install -r docs/requirements.txt pip install -r requirements.txt pip install . @@ -33,6 +35,13 @@ jobs: # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics + - name: Build documentation + run: | + make docs + - name: Run pytest run: | make test + + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v2 diff --git a/.gitignore b/.gitignore index 22e4c93..f0737f7 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ *.pyc .DS_Store .coverage +coverage.xml .pytest_cache/ docs/_build docs/api diff --git a/Makefile b/Makefile index cc9d940..a12536b 100644 --- a/Makefile +++ b/Makefile @@ -28,7 +28,7 @@ coverage: coverage report -m test: - pytest --cov=diskmap/ + pytest --cov=diskmap/ --cov-report=xml clean: find . -name '*.pyc' -exec rm -f {} + @@ -43,3 +43,4 @@ clean: rm -rf diskmap.egg-info/ rm -rf .pytest_cache/ rm -f .coverage + rm -f coverage.xml diff --git a/README.rst b/README.rst index 9e2531f..6b777ee 100644 --- a/README.rst +++ b/README.rst @@ -13,8 +13,8 @@ .. image:: https://img.shields.io/readthedocs/diskmap :target: http://diskmap.readthedocs.io -.. image:: https://img.shields.io/coveralls/github/tomasstolker/diskmap - :target: https://coveralls.io/github/tomasstolker/diskmap +.. image:: https://codecov.io/gh/tomasstolker/diskmap/branch/main/graph/badge.svg?token=UZ7OS5WR9C + :target: https://codecov.io/gh/tomasstolker/diskmap .. image:: https://img.shields.io/codefactor/grade/github/tomasstolker/diskmap :target: https://www.codefactor.io/repository/github/tomasstolker/diskmap @@ -23,7 +23,7 @@ :target: https://github.com/tomasstolker/diskmap/blob/main/LICENSE .. image:: https://mybinder.org/badge_logo.svg - :target: https://mybinder.org/v2/gh/tomasstolker/diskmap/HEAD + :target: https://mybinder.org/v2/gh/tomasstolker/diskmap/HEAD *diskmap* is a tool for scattered light mapping of protoplanetary disks. The disk surface is parameterized with a power law profile or read from an input file. The projected radius and scattering angle are then calculated at each pixel. From this, a 3D deprojected image and a stellar irradiation corrected image are computed. Also a polarized scattering phase function is extracted and an total intensity phase function is estimated. diff --git a/tests/__init__.py b/tests/__init__.py new file mode 100644 index 0000000..e69de29