Skip to content

Commit

Permalink
Merge pull request #173 from damar-wicaksono/dev
Browse files Browse the repository at this point in the history
Merge `dev` to `main` prior to v0.1.0 release
  • Loading branch information
damar-wicaksono committed Mar 7, 2023
2 parents aa95838 + bc4bebc commit 5d71ba2
Show file tree
Hide file tree
Showing 9 changed files with 190 additions and 134 deletions.
225 changes: 123 additions & 102 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,107 +1,128 @@
name: Packaging

on:
- push
- push

jobs:
format:
name: Check code formatting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4.0.0
with:
python-version: "3.10"
- name: Install tox
run: python -m pip install tox
- name: Run black
run: tox -e format
lint:
name: Check code linting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4.0.0
with:
python-version: "3.10"
- name: Install tox
run: python -m pip install tox
- name: Run flake8
run: tox -e lint
typecheck:
name: Static type checking
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4.0.0
with:
python-version: "3.10"
- name: Install tox
run: python -m pip install tox
- name: Run mypy
run: tox -e typecheck
test:
name: Test
runs-on: ubuntu-latest
strategy:
matrix:
python:
- version: "3.7"
toxenv: "py37"
- version: "3.8"
toxenv: "py38"
- version: "3.9"
toxenv: "py39"
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4.0.0
with:
python-version: ${{ matrix.python.version }}
- name: Install tox
run: python -m pip install tox
- name: Run pytest
run: tox -e ${{ matrix.python.toxenv }}
coverage:
name: Test (on Python 3.10) w/ coverage to CodeCov
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4.0.0
with:
python-version: "3.10"
- name: Install tox
run: python -m pip install tox
- name: Run pytest
run: tox -e "py310" -- --cov-report=xml --cov-report=term
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
build_wheels:
name: Build wheels on Ubuntu 20.04
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4.0.0
with:
python-version: "3.10"
- name: Install build
run: python -m pip install build
- name: Build wheels
run: python -m build --wheel
- uses: actions/upload-artifact@v3
with:
path: ./dist/*.whl
build_sdist:
name: Build source distribution on Ubuntu 20.04
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4.0.0
with:
python-version: "3.10"
- name: Install build
run: python -m pip install build
- name: Build wheels
run: python -m build --sdist
- uses: actions/upload-artifact@v3
with:
path: ./dist/*.tar.gz
format:
name: Check code formatting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4.0.0
with:
python-version: "3.10"
- name: Install tox
run: python -m pip install tox
- name: Run black
run: tox -e format
lint:
name: Check code linting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4.0.0
with:
python-version: "3.10"
- name: Install tox
run: python -m pip install tox
- name: Run flake8
run: tox -e lint
typecheck:
name: Static type checking
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4.0.0
with:
python-version: "3.10"
- name: Install tox
run: python -m pip install tox
- name: Run mypy
run: tox -e typecheck
test:
name: Test
runs-on: ubuntu-latest
strategy:
matrix:
python:
- version: "3.7"
toxenv: "py37"
- version: "3.8"
toxenv: "py38"
- version: "3.9"
toxenv: "py39"
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4.0.0
with:
python-version: ${{ matrix.python.version }}
- name: Install tox
run: python -m pip install tox
- name: Run pytest
run: tox -e ${{ matrix.python.toxenv }}
coverage:
name: Test (on Python 3.10) w/ coverage to CodeCov
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4.0.0
with:
python-version: "3.10"
- name: Install tox
run: python -m pip install tox
- name: Run pytest
run: tox -e "py310" -- --cov-report=xml --cov-report=term
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
build_wheels:
name: Build wheels on Ubuntu 20.04
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4.0.0
with:
python-version: "3.10"
- name: Install build
run: python -m pip install build
- name: Build wheels
run: python -m build --wheel
- uses: actions/upload-artifact@v3
with:
path: ./dist/*.whl
build_sdist:
name: Build source distribution on Ubuntu 20.04
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4.0.0
with:
python-version: "3.10"
- name: Install build
run: python -m pip install build
- name: Build wheels
run: python -m build --sdist
- uses: actions/upload-artifact@v3
with:
path: ./dist/*.tar.gz
publish:
name: Publish package
if: startsWith(github.event.ref, 'refs/tags/v')
needs:
- format
- lint
- typecheck
- test
- coverage
- build_wheels
- build_sdist
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v3
with:
name: artifact
path: ./dist/
- uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
2 changes: 1 addition & 1 deletion .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ version: 2
build:
os: ubuntu-22.04
tools:
python: "3.8"
python: "3.9"
jobs:
pre_build:
- "jupyter-book config sphinx docs/"
Expand Down
21 changes: 21 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,27 @@ All notable changes to the UQTestFuns project is documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.1.0] - 2023-07-03

### Added

- Publishing to PyPI is now automated
once a tagged (with semantic version) release is carried out via GitHub
- Add a few additional classifiers in `setup.cfg` for the PyPI record
- DOI from Zenodo in README.md

### Fixed

- Wrong classifier specification in `setup.cfg` causing upload to PyPI to fail
- Issue with RTD document built crashing from time to time;
probably due to a problematic matplotlib version

### Changed

- The HTML representation of `ProbInput` instances now takes less space
- Relax the numerical tolerance of a test (i.e., univariate beta distribution)
- Minor edit in the docs

## [0.0.1] - 2023-06-03

First public release of UQTestFuns.
Expand Down
15 changes: 8 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
# UQTestFuns
[![DOI](http://img.shields.io/badge/DOI-10.5281/zenodo.7701904-blue.svg?style=flat-square)](https://doi.org/10.5281/zenodo.7701904)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg?style=flat-square)](https://github.com/psf/black)
[![Python 3.8](https://img.shields.io/badge/python-3.7-blue.svg?style=flat-square)](https://www.python.org/downloads/release/python-370/)
[![License](https://img.shields.io/github/license/damar-wicaksono/uqtestfuns?style=flat-square)](https://choosealicense.com/licenses/mit/)

| Branches | |
| Branches | Status |
|:--------------------------------------------------------------------------:|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [`main`](https://github.com/damar-wicaksono/uqtestfuns/tree/main) (stable) | ![build](https://img.shields.io/github/actions/workflow/status/damar-wicaksono/uqtestfuns/main.yml?branch=main&style=flat-square) [![codecov](https://img.shields.io/codecov/c/github/damar-wicaksono/uqtestfuns/main?logo=CodeCov&style=flat-square&token=Y6YQEPJ1TT)](https://app.codecov.io/gh/damar-wicaksono/uqtestfuns/tree/main) [![Docs](https://readthedocs.org/projects/uqtestfuns/badge/?version=stable&style=flat-square)](https://uqtestfuns.readthedocs.io/en/latest/?badge=stable) |
| [`dev`](https://github.com/damar-wicaksono/uqtestfuns/tree/dev) (latest) | ![build](https://img.shields.io/github/actions/workflow/status/damar-wicaksono/uqtestfuns/main.yml?branch=dev&style=flat-square) [![codecov](https://img.shields.io/codecov/c/github/damar-wicaksono/uqtestfuns/dev?logo=CodeCov&style=flat-square&token=Y6YQEPJ1TT)](https://app.codecov.io/gh/damar-wicaksono/uqtestfuns/tree/dev) [![Docs](https://readthedocs.org/projects/uqtestfuns/badge/?version=latest&style=flat-square)](https://uqtestfuns.readthedocs.io/en/latest/?badge=latest) |
| [`dev`](https://github.com/damar-wicaksono/uqtestfuns/tree/dev) (latest) | ![build](https://img.shields.io/github/actions/workflow/status/damar-wicaksono/uqtestfuns/main.yml?branch=dev&style=flat-square) [![codecov](https://img.shields.io/codecov/c/github/damar-wicaksono/uqtestfuns/dev?logo=CodeCov&style=flat-square&token=Y6YQEPJ1TT)](https://app.codecov.io/gh/damar-wicaksono/uqtestfuns/tree/dev) [![Docs](https://readthedocs.org/projects/uqtestfuns/badge/?version=latest&style=flat-square)](https://uqtestfuns.readthedocs.io/en/latest/?badge=latest) |

<!--One paragraph description-->
UQTestFuns is an open-source Python3 library of test functions commonly used
Expand All @@ -28,7 +29,7 @@ to the [Virtual Library of Simulation Experiments (VLSE)](https://www.sfu.ca/~ss
UQTestFuns includes several commonly used test functions in the UQ community.
To list the available functions:

```python
```python-repl
>>> import uqtestfuns as uqtf
>>> uqtf.list_functions()
No. Constructor Spatial Dimension Application Description
Expand All @@ -44,7 +45,7 @@ To list the available functions:
Consider the Borehole function, a test function commonly used for metamodeling
and sensitivity analysis purposes; to create an instance of this test function:

```python
```python-repl
>>> my_testfun = uqtf.Borehole()
>>> print(my_testfun)
Name : Borehole
Expand All @@ -54,7 +55,7 @@ Description : Borehole function from Harper and Gupta (1983)

The probabilistic input specification of this test function is built-in:

```python
```python-repl
>>> print(my_testfun.prob_input)
Name : Borehole-Harper-1983
Spatial Dim. : 8
Expand All @@ -78,7 +79,7 @@ Marginals :

A sample of input values can be generated from the input model:

```python
```python-repl
>>> xx = my_testfun.prob_input.get_sample(10)
array([[8.40623544e-02, 2.43926544e+03, 8.12290909e+04, 1.06612711e+03,
7.24216436e+01, 7.78916695e+02, 1.13125867e+03, 1.02170796e+04],
Expand All @@ -93,7 +94,7 @@ array([[8.40623544e-02, 2.43926544e+03, 8.12290909e+04, 1.06612711e+03,

...and used to evaluate the test function:

```python
```python-repl
>>> yy = my_testfun(xx)
array([ 57.32635774, 110.12229548, 53.10585812, 96.15822154,
58.51714875, 89.40068404, 52.61710076, 61.47419171,
Expand Down
7 changes: 5 additions & 2 deletions docs/getting-started/obtaining-and-installing.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ Alternatively, you can also install the latest version from the source:
pip install git+https://github.com/damar-wicaksono/uqtestfuns.git
```

> **NOTE**: UQTestFuns is currently work in progress,
> therefore interfaces are subject to change.
```{important}
UQTestFuns is currently a work in progress,
therefore the interfaces are subject to change, at least until v1.0.0
is finally released.
```

It's a good idea to install the package in an isolated virtual environment.
15 changes: 13 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,17 @@ platform = ANY
license = MIT
license_files = LICENSE
classifiers =
LICENSE :: OSI Approved :: MIT License
License :: OSI Approved :: MIT License
Programming Language :: Python :: 3
Programming Language :: Python :: 3 :: Only
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Topic :: Scientific/Engineering
Topic :: Scientific/Engineering :: Mathematics
Topic :: Software Development :: Libraries :: Python Modules
Intended Audience :: Science/Research

[options]
package_dir =
Expand Down Expand Up @@ -40,7 +50,8 @@ dev =
types-setuptools
docs =
jupyter-book==0.13.2
matplotlib>=3.4.2
sphinx==4.5.0
matplotlib>=3.7.0
all =
uqtestfuns[dev]
uqtestfuns[docs]
Expand Down
Loading

0 comments on commit 5d71ba2

Please sign in to comment.