Skip to content

Commit

Permalink
deploy documentation to static sites (#83)
Browse files Browse the repository at this point in the history
* add build docs

* debugging

* debugging

* arm?

* continue debugging

* deploy docs to gh pages

* change documentation zip structure and artifact name typo

* clean up permissions

* add githubpages extension

* try to mirror what wntr does

* success! update versions?

* upload pages too

* refactor

* resume rtd

* no message

* update readme; cleanup debugging

* re-enable linux tests
  • Loading branch information
shapiromatron authored Nov 26, 2024
1 parent 3c5c0a4 commit 0f232a5
Show file tree
Hide file tree
Showing 4 changed files with 113 additions and 2 deletions.
54 changes: 54 additions & 0 deletions .github/workflows/deploy-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Deploy Documentation

on:
schedule:
- cron: '30 3 1 */1 *' # At 03:30 on the 1st of every month
push:
tags:
- '*'
workflow_dispatch:

jobs:
build:
name: Build Documentation
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: pip
- name: Install dependencies
run: |
source ./tools/linux_ci_setup.sh
- name: Build pybmds
run: |
source ./tools/linux_ci_env.sh
python -m pip install -U pip wheel
python -m pip install -e ".[docs]"
- name: Build documentation
run: |
make docs
- name: Upload Pages
uses: actions/upload-pages-artifact@v3
with:
path: docs/build/html

deploy:
name: Deploy to GitHub Pages
needs: build
runs-on: ubuntu-22.04
permissions:
contents: read
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
31 changes: 31 additions & 0 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# https://docs.readthedocs.io/en/stable/config-file/v2.html
version: 2
build:
os: ubuntu-22.04
tools:
python: "3.12"
apt_packages:
# copied from `tools/linux_ci_setup.sh`
- automake
- build-essential
- libtool
- make
- cmake
- libgslcblas0
- libgsl-dev
- libeigen3-dev
- libnlopt-dev
- libnlopt-cxx-dev
jobs:
pre_install:
# environment variables configured in readthedocs web admin
# variables the same as those in `tools/linux_ci_setup.sh`
- env
sphinx:
configuration: docs/source/conf.py
python:
install:
- method: pip
path: .
extra_requirements:
- docs
28 changes: 27 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,34 @@
# BMDS

<table>
<tbody>
<tr>
<td>Package</td><td>

[![version](https://img.shields.io/pypi/v/pybmds.svg?label=pybmds%20version&maxAge=3600)](https://pypi.org/project/pybmds/)
[![version](https://img.shields.io/pypi/v/bmds-ui.svg?label=bmds-ui%20version&maxAge=3600)](https://pypi.org/project/bmds-ui/)
</td>
</tr>
<tr>
<td>Documentation</td><td>

[![Docs Badge](https://img.shields.io/badge/Latest-online-brightgreen)](https://usepa.github.io/BMDS) [![Read The Docs](https://img.shields.io/badge/Versioned-online-brightgreen)](https://pybmds.readthedocs.io/)
</td>
</tr>
<tr>
<td>Website</td><td>

[![Site Badge](https://img.shields.io/badge/BMDS-online-purple)](https://epa.gov/bmds) [![Site Badge](https://img.shields.io/badge/BMDS&nbsp;Online-online-purple)](https://bmdsonline.epa.gov)
</td>
</tr>

</tbody>
</table>


EPA's Benchmark Dose Software (BMDS) collects and provides easy access to numerous mathematical models that help risk assessors estimate the quantitative relationship between a chemical dose and the test subject’s response. A specific focus of BMDS is estimating a statistical benchmark dose (BMD). The BMD is a chemical dose or concentration that produces a predetermined change in the response rate of an adverse effect, such as weight loss or tumor incidence. The BMD is a range, rather than a fixed number. For example, the benchmark dose (lower confidence limit) (BMDL) can be regarded as a dose where the observable physical effect is less than the predetermined benchmark response (BMR).

![An example dose response plot an and curve fit](tests/test_pybmds/data/mpl/test_dichotomous_plot.png)
![An example dose response plot an and curve fit](https://github.com/USEPA/BMDS/raw/e89f79388dc3021604e1230ac75e721c12c6bf61/tests/test_pybmds/data/mpl/test_dichotomous_plot.png)

Additional information, documentation, and technical guidance for BMDS is available at [https://www.epa.gov/bmds](https://www.epa.gov/bmds).

Expand Down
2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
project = "pybmds"
copyright = "MIT License"

extensions = ["myst_nb", "sphinx_design"]
extensions = ["sphinx.ext.githubpages", "myst_nb", "sphinx_design"]
souce_suffix = {
".md": "markdown",
".rst": "restructuredtext",
Expand Down

0 comments on commit 0f232a5

Please sign in to comment.