Skip to content

Commit

Permalink
update documentation (#54)
Browse files Browse the repository at this point in the history
* switch to furo?

* remove sphinx docx
  • Loading branch information
shapiromatron authored Jul 31, 2024
1 parent 3a4aa97 commit bb76a92
Show file tree
Hide file tree
Showing 16 changed files with 34 additions and 225 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ build/
/data/
coverage_report/
dist/
docs/site/
node_modules/
scripts/private
/public/
Expand Down
5 changes: 5 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# History

## v24.1 (TBD)

* ...
7 changes: 0 additions & 7 deletions HISTORY.rst

This file was deleted.

25 changes: 1 addition & 24 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.PHONY: build docs docs-clean docs-serve docs-all clean clean-test clean-pyc clean-build loc help lint lint-py lint-js format format-py format-js sync-dev
.PHONY: build clean clean-test clean-pyc clean-build loc help lint lint-py lint-js format format-py format-js sync-dev
.DEFAULT_GOAL := help

define BROWSER_PYSCRIPT
Expand Down Expand Up @@ -60,29 +60,6 @@ coverage: ## Generate test coverage report
coverage html -d coverage_report
$(BROWSER) coverage_report/index.html

docs: ## Build documentation {html}
@$(MAKE) -C docs clean
@$(MAKE) -C docs html
@echo "HTML: \"docs/build/html/index.html\""

docs-clean: ## Clean documentation
@$(MAKE) -C docs clean

docs-serve: ## Realtime documentation preview
sphinx-autobuild -b html docs/source docs/build/html --port 5555

docs-all: ## Build documentation {html, pdf, docx}
@$(MAKE) -C docs clean
@$(MAKE) -C docs html
@$(MAKE) -C docs singlehtml
@$(MAKE) -C docs latexpdf
@mkdir -p docs/build/docx
@cd docs/build/singlehtml; pandoc -s index.html -o ../docx/pybmds.docx
@echo "HTML: \"docs/build/html/index.html\""
@echo "Single Page HTML: \"docs/build/singlehtml/index.html\""
@echo "Microsoft Word: \"docs/build/docx/pybmds.docx\""
@echo "PDF: \"docs/build/latex/pybmds.pdf\""

loc: ## Generate lines of code report
@cloc \
--exclude-dir=build,dist,migrations,node_modules,logs,private,public,scripts,vendor,venv \
Expand Down
33 changes: 2 additions & 31 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,33 +1,4 @@
# BMDS webserver
# BMDS UI

Run a webserver that will batch process dose-response data using the US EPA's
benchmark dose modeling software [BMDS](https://www.epa.gov/bmds). Under the hood, this web application
uses the [BMDS Python interface](https://pypi.python.org/pypi/bmds).
A user interface foe execution of dose-response data using the US EPA's Benchmark Dose Modeling Software [BMDS](https://www.epa.gov/bmds). Under the hood, this web application uses the [BMDS Python interface](https://pypi.python.org/pypi/bmds).

To use the webserver, specify a new BMDS Job using a input file formatted like this.

```json
{
"dataset_type": "D",
"bmds_version": "BMDS2601",
"datasets": [
{
"doses": [0, 1.96, 5.69, 29.75],
"ns": [75, 49, 50, 49],
"incidences": [5, 1, 3, 14]
},
{
"doses": [0, 1.96, 5.69, 29.75],
"ns": [75, 49, 50, 49],
"incidences": [0, 0, 11, 27]
}
]
}
```

You'll receive a Job ID back, and you can check the website to see when the job is complete. Then, results can be downloaded. Results include:

* The dfile created for each model
* The outfile created for each model
* The parsed output file for each model
* A recommended best-fitting model, using guidance from [Wignall et al. 2014](https://dx.doi.org/10.1289/ehp.1307539) (optional)
2 changes: 1 addition & 1 deletion bmds_ui/analysis/fixtures/initial_data.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"content_type": 1,
"subject": "Homepage",
"content": {
"template": "<div class=\"row\">\n <div class=\"col-sm-12\">\n <h1>Welcome to BMDS online.</h1>\n </div>\n</div>\n<div class=\"row\">\n <div class=\"col-md-8\">\n <div class=\"col-lg\">\n <p>\n This web-application executes the US EPA's benchmark dose modeling software (<a href=\"https://www.epa.gov/bmds\">BMDS</a>).\n </p>\n <ul>\n <li>Load example datasets below to view example input files; for more information, see the <a href=\"http://bmds-ui.readthedocs.io/en/latest/\">documentation</a>\n </li>\n <li>Software is designed for automated BMDS execution using a\n programming language such as Python, R, or Java. To take\n advantage of automation, use the <a href=\"/api/v1/\">API</a>,\n and see the <a href=\"http://bmds-ui.readthedocs.io/en/latest/quickstart.html\">quickstart</a> section.\n </li>\n </ul>\n </div>\n </div>\n <div class=\"col-md-4\">\n <form action=\"{% url 'analysis_create' %}\" method=\"post\">\n {% csrf_token %}\n <label for=\"id_id\">Create a new analysis:</label>\n <button type=\"submit\" class=\"btn btn-primary btn-block mb-1\">Create a new BMDS analysis</button>\n <p class=\"text-muted\">Analyses are deleted after {{days_to_keep_analyses}}.</p>\n </form>\n </div>\n</div>\n"
"template": "<div class=\"row\">\n <div class=\"col-sm-12\">\n <h1>Welcome to BMDS online.</h1>\n </div>\n</div>\n<div class=\"row\">\n <div class=\"col-md-8\">\n <div class=\"col-lg\">\n <p>\n This web-application executes the US EPA's benchmark dose modeling software (<a href=\"https://www.epa.gov/bmds\">BMDS</a>).\n </p>\n <ul>\n <li>Load example datasets below to view example input files; for more information, see the documentation\n </li>\n <li>Software is designed for automated BMDS execution using a\n programming language such as Python, R, or Java. To take\n advantage of automation, use the <a href=\"/api/v1/\">API</a>,\n and see the quickstart section.\n </li>\n </ul>\n </div>\n </div>\n <div class=\"col-md-4\">\n <form action=\"{% url 'analysis_create' %}\" method=\"post\">\n {% csrf_token %}\n <label for=\"id_id\">Create a new analysis:</label>\n <button type=\"submit\" class=\"btn btn-primary btn-block mb-1\">Create a new BMDS analysis</button>\n <p class=\"text-muted\">Analyses are deleted after {{days_to_keep_analyses}}.</p>\n </form>\n </div>\n</div>\n"
},
"created": "2021-01-31 08:00:00.123456+00:00",
"last_updated": "2021-01-31 08:00:00.123456+00:00"
Expand Down
20 changes: 0 additions & 20 deletions docs/Makefile

This file was deleted.

43 changes: 5 additions & 38 deletions docs/source/development.md → docs/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Make sure you have the following applications installed locally:
- [Yarn](https://yarnpkg.com/)
- [PostgreSQL](https://www.postgresql.org/) >= 16

If installing on Windows, all requirements are available using [miniconda](https://docs.conda.io/en/latest/miniconda.html), and do not require administrative access.
If installing on Windows, these packages are available using [miniconda](https://docs.conda.io/en/latest/miniconda.html).

## Initial setup

Expand Down Expand Up @@ -79,7 +79,7 @@ npm start
If you navigate to [localhost](http://127.0.0.1:8000/) and see a website, you're ready to begin coding!


## Visual Studio Code settings
## Visual Studio Code

[Visual Studio Code](https://code.visualstudio.com/) is the recommended editor for this project.

Expand All @@ -89,35 +89,6 @@ Recommended extensions:
- [Eslint](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint)
- [Ruff](https://marketplace.visualstudio.com/items?itemName=charliermarsh.ruff)

Recommended workspace settings:

```json
{
"restructuredtext.linter.disabled": true,
"[html]": {
"editor.formatOnSave": false
},
"[python]": {
"editor.formatOnSave": true,
"editor.formatOnPaste": false,
"editor.codeActionsOnSave": {
"source.fixAll": true
}
},
"[javascript]": {
"editor.formatOnSave": false,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
}
},
"editor.formatOnSave": true,
"python.linting.flake8Enabled": false,
"python.pythonPath": "./venv/bin/python",
"eslint.workingDirectories": [
"./frontend"
]
}
```
## Additional settings

### Feature flags (frontend)
Expand All @@ -134,14 +105,10 @@ Future mode can also be enabled via the local setting `ALWAYS_SHOW_FUTURE`. This

```python
# bmds_ui\main\settings\local.py
...
# Shows future-flagged items without login/url parameter
ALWAYS_SHOW_FUTURE = True
...
```


That's it! Now you should be able to view content that's coming soon!
# Shows future-flagged items without login/url parameter
ALWAYS_SHOW_FUTURE = True
```

### Building a test database

Expand Down
18 changes: 18 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# BMDS UI

BMDS UI is a user interface for running `pybmds`, a python package for dose-response modeling using the US EPA's Benchmark Dose Modeling Software ([BMDS](https://www.epa.gov/bmds)). The user interface is a web application, and it is desgined for running as a web application (such as [BMDS Online](https://bmdsonline.epa.gov)) or a desktop model, which we call BMDS Desktop.

## BMDS Desktop Capabilities

BMDS Desktop is designed to run locally on your desktop computer in fully offline mode; it does not interact with any resources on the internet after initial installation.


*Screenshot of TUI*

*Create database*

*BMDS Desktop User Interface w/ Runs*

*Dose Response Setup*

*Dose Response Plot*
7 changes: 0 additions & 7 deletions docs/source/_static/css/style.css

This file was deleted.

Binary file removed docs/source/_static/img/epa_logo.png
Binary file not shown.
50 changes: 0 additions & 50 deletions docs/source/conf.py

This file was deleted.

14 changes: 0 additions & 14 deletions docs/source/index.md

This file was deleted.

25 changes: 0 additions & 25 deletions make.bat
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ if "%~1" == "" goto :help
if /I %1 == help goto :help
if /I %1 == sync-dev goto :sync-dev
if /I %1 == build goto :build
if /I %1 == docs goto :docs
if /I %1 == docs-serve goto :docs-serve
if /I %1 == docs-all goto :docs-all
if /I %1 == test goto :test
if /I %1 == lint goto :lint
if /I %1 == format goto :format
Expand All @@ -23,9 +20,6 @@ goto :help
echo.Please use `make ^<target^>` where ^<target^> is one of
echo. sync-dev sync dev environment after code checkout
echo. build build application (python wheel)
echo. docs Build documentation {html}
echo. docs-serve Realtime documentation preview
echo. docs-all Build documentation {html, docx}
echo. test perform both test-py and test-js
echo. coverage generate test coverage report
echo. test-py run python tests
Expand All @@ -52,25 +46,6 @@ python manage.py set_git_commit
flit build --no-use-vcs --format=wheel
goto :eof

:docs
rmdir /s /q docs\build
sphinx-build -b html docs/source docs/build/html
goto :eof

:docs-serve
rmdir /s /q docs\build
sphinx-autobuild -b html docs/source docs/build/html --port 5555
goto :eof

:docs-all
rmdir /s /q docs\build
sphinx-build -b html docs/source docs/build/html
sphinx-build -b singlehtml docs/source docs/build/singlehtml
cd docs\build\singlehtml
pandoc -s index.html -o pybmds.docx
cd ../../..
goto :eof

:lint
ruff format . --check && ruff check .
npm --prefix .\frontend run lint
Expand Down
5 changes: 0 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,6 @@ dev = [
"django_extensions==3.2.3",
"django-browser-reload==1.12.1",

# docs
"Sphinx~=7.3.7",
"myst-parser~=2.0.0",
"pydata-sphinx-theme~=0.15.2",

# tests
"pytest~=8.2.1",
"pytest-django~=4.8.0",
Expand Down
4 changes: 2 additions & 2 deletions tests/data/db.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5161,11 +5161,11 @@
\ <div class=\"col-lg\">\n <p>\n This web-application
executes the US EPA's benchmark dose modeling software (<a href=\"https://www.epa.gov/bmds\">BMDS</a>).\n
\ </p>\n <ul>\n <li>Load example datasets
below to view example input files; for more information, see the <a href=\"http://bmds-ui.readthedocs.io/en/latest/\">documentation</a>\n
below to view example input files; for more information, see the documentation\n
\ </li>\n <li>Software is designed for automated
BMDS execution using a\n programming language such as Python,
R, or Java. To take\n advantage of automation, use the
<a href=\"/api/v1/\">API</a>,\n and see the <a href=\"http://bmds-ui.readthedocs.io/en/latest/quickstart.html\">quickstart</a>
<a href=\"/api/v1/\">API</a>,\n and see the quickstart
section.\n </li>\n </ul>\n </div>\n </div>\n
\ <div class=\"col-md-4\">\n <form action=\"{% url 'analysis_create' %}\" method=\"post\">\n {%
csrf_token %}\n <label for=\"id_id\">Create a new analysis:</label>\n
Expand Down

0 comments on commit bb76a92

Please sign in to comment.