Skip to content

Commit 94b120a

Browse files
authored
Merge pull request #15 from sandialabs/12-adding-readme-badges-and-coveralls
12 adding readme badges and coveralls
2 parents 40e5a4d + 8d9e70c commit 94b120a

File tree

6 files changed

+63
-11
lines changed

6 files changed

+63
-11
lines changed

.github/workflows/documentation.yml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: documentation
1+
name: Deploy to GitHub Pages
22

33
on: [push, pull_request, workflow_dispatch]
44

@@ -13,16 +13,30 @@ jobs:
1313
- uses: actions/setup-python@v5
1414
with:
1515
python-version: '3.9'
16+
1617
- name: Install dependencies
1718
run: |
1819
pip install sphinx sphinx_rtd_theme myst_parser sphinx-autoapi ipython
1920
pip install .[dev]
21+
2022
- name: List files
2123
run: |
2224
ls -R
25+
2326
- name: Sphinx build
2427
run: |
2528
sphinx-build -b html docs docs/_build/html
29+
30+
- name: Generating coverage report for coveralls
31+
run: |
32+
coverage run --source=pytuq -m pytest tests/
33+
coverage report -m
34+
35+
- name: Coveralls GitHub Action
36+
uses: coverallsapp/[email protected]
37+
with:
38+
github-token: ${{ secrets.GITHUB_TOKEN }}
39+
2640
- name: Deploy to GitHub Pages
2741
uses: peaceiris/actions-gh-pages@v3
2842
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}

.github/workflows/python-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,4 @@ jobs:
2828
2929
- name: Run tests
3030
run: |
31-
python3 examples/surrogates/ex_pce.py
31+
pytest tests/

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22

33
#### Khachik Sargsyan, Bert Debusschere, Emilie Grace Baillo
44

5+
6+
[![Deploy to GitHub Pages](https://github.com/sandialabs/pytuq/actions/workflows/documentation.yml/badge.svg)](https://github.com/sandialabs/pytuq/actions/workflows/documentation.yml)
7+
[![Run Tests](https://github.com/sandialabs/pytuq/actions/workflows/python-test.yml/badge.svg)](https://github.com/sandialabs/pytuq/actions/workflows/python-test.yml)
8+
[![Coverage Status](https://coveralls.io/repos/github/sandialabs/pytuq/badge.svg?branch=main)](https://coveralls.io/github/sandialabs/pytuq?branch=main)
9+
10+
11+
512
## Overview
613

714
The Python Toolkit for Uncertainty Quantification (PyTUQ) is a Python-only collection of libraries and tools designed for quantifying uncertainty in computational models. PyTUQ offers a range of UQ functionalities, including Bayesian inference and linear regression methods, polynomial chaos expansions, and global sensitivity analysis methods. PyTUQ features advanced techniques for dimensionality reduction, such as SVD and Karhunen-Loeve expansions, along with various MCMC methods for calibration and inference. The toolkit also includes robust classes for multivariate random variables and integration techniques, making it a versatile resource for researchers and practitioners seeking to quantify uncertainty in their numerical predictions. To explore the PyTUQ documentation and learn more, visit our website [here](https://sandialabs.github.io/pytuq/).

docs/conf.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,14 @@
2323

2424
source_suffix = ".rst"
2525
master_doc = "index"
26+
27+
from pkg_resources import get_distribution, DistributionNotFound
28+
2629
try:
27-
from pkg_resources import get_distribution
28-
version = release = get_distribution("pytuq").version
29-
except Exception:
30-
import traceback
31-
traceback.print_exc()
30+
version = get_distribution("package-name").version
31+
except DistributionNotFound:
3232
version = release = "1.0.0"
33+
pass
3334

3435
# -- General configuration ---------------------------------------------------
3536
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration

docs/index.rst

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,38 @@
77
PyTUQ Documentation
88
============================================
99

10-
.. _PyTUQ: https://github.com/sandialabs/pytuq
1110

12-
**Last Updated**: |today| **Version**: |version|
11+
.. start-badges
1312
14-
Hello, :ref:`PyTUQ <PyTUQ>` is a Python-only toolkit for uncertainty quantification in computational models.
13+
.. list-table::
14+
:stub-columns: 1
15+
16+
* - tests
17+
- |python-tests| |deployment| |coveralls|
18+
19+
.. |python-tests| image:: https://github.com/sandialabs/pytuq/actions/workflows/python-test.yml/badge.svg
20+
:alt: Python Tests Build Status
21+
:target: https://github.com/sandialabs/pytuq/actions/workflows/python-test.yml
22+
23+
.. |deployment| image:: https://github.com/sandialabs/pytuq/actions/workflows/documentation.yml/badge.svg
24+
:alt: Deployment Status
25+
:target: https://github.com/sandialabs/pytuq/actions/workflows/documentation.yml
26+
27+
.. |coveralls| image:: https://coveralls.io/repos/github/sandialabs/pytuq/badge.svg?branch=main
28+
:target: https://coveralls.io/github/sandialabs/pytuq?branch=main
29+
:alt: Coverage Status
30+
31+
.. end-badges
32+
33+
34+
**Last Updated**: |today|
35+
36+
**Version**: |version|
37+
38+
Hello, `PyTUQ <https://github.com/sandialabs/pytuq>`__ is a Python-only toolkit for uncertainty quantification in computational models.
1539
To explore the modules offered by PyTUQ, use the navigation panel on the left or below.
1640

17-
Check out the :doc:`Getting Started <about>` section for further information, including how to
41+
Check out the :ref:`Getting Started <about>` section for further information, including how to
1842
:ref:`install <installation>` the project.
1943

2044
.. toctree::

pyproject.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,12 @@ dependencies = [
3737
"matplotlib",
3838
]
3939

40+
[project.optional-dependencies]
41+
dev = [
42+
"pytest>=7.0",
43+
"pytest-cov"
44+
]
45+
4046
[tool.setuptools.packages.find]
4147
where = ["src"]
4248
namespaces = false

0 commit comments

Comments
 (0)