Skip to content

Commit fbf0fa8

Browse files
authored
add docs (#27)
1 parent 676e769 commit fbf0fa8

11 files changed

+616
-0
lines changed
+54
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Rebuilt entire documentation
2+
3+
on:
4+
release:
5+
types:
6+
- created
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
strategy:
12+
fail-fast: false
13+
steps:
14+
- uses: r-lib/actions/setup-pandoc@v1
15+
- name: Checkout Source
16+
uses: actions/checkout@v2
17+
with:
18+
# require all of history to see all tagged versions' docs
19+
fetch-depth: 0
20+
21+
- name: Set up Python ${{ matrix.python-version }}
22+
uses: actions/setup-python@v2
23+
with:
24+
python-version: 3.7
25+
26+
- name: Install Dependencies
27+
run: |
28+
python -m pip install --upgrade pip
29+
pip install -r requirements.txt
30+
pip install -r requirements-dev.txt
31+
python setup.py build
32+
python setup.py install
33+
34+
- name: Checkout gh-pages
35+
uses: actions/checkout@v2
36+
with:
37+
ref: gh-pages
38+
path: docs/_build/html
39+
40+
- name: Remove and build documentation from scratch
41+
run: |
42+
rm -rd docs/_build/html
43+
sphinx-multiversion docs docs/_build/html
44+
touch docs/_build/html/.nojekyll
45+
cp docs/_assets/gh-pages-redirect.html docs/_build/html/index.html
46+
47+
- name: Publish Docs to gh-pages
48+
# We pin to the SHA, not the tag, for security reasons.
49+
# https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/security-hardening-for-github-actions#using-third-party-actions
50+
uses: peaceiris/actions-gh-pages@bbdfb200618d235585ad98e965f4aafc39b4c501 # v3.7.3
51+
with:
52+
github_token: ${{ secrets.GITHUB_TOKEN }}
53+
publish_dir: docs/_build/html
54+
keep_files: true

.github/workflows/publish-docs.yml

+65
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name: Build and publish documentation
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
strategy:
13+
fail-fast: false
14+
steps:
15+
- uses: r-lib/actions/setup-pandoc@v1
16+
- name: Checkout Source
17+
uses: actions/checkout@v2
18+
with:
19+
# require all of history to see all tagged versions' docs
20+
fetch-depth: 0
21+
22+
- name: Set up Python ${{ matrix.python-version }}
23+
uses: actions/setup-python@v2
24+
with:
25+
python-version: 3.8
26+
27+
- name: Install Dependencies
28+
run: |
29+
python -m pip install --upgrade pip
30+
pip install -r requirements.txt
31+
pip install -r requirements-dev.txt
32+
python setup.py build
33+
python setup.py install
34+
35+
- name: Checkout gh-pages
36+
# As we already did a deploy of gh-pages above, it is guaranteed to be there
37+
# so check it out so we can selectively build docs below
38+
uses: actions/checkout@v2
39+
with:
40+
ref: gh-pages
41+
path: docs/_build/html
42+
43+
- name: Test Build Docs
44+
if: github.ref != 'refs/heads/main' && ! startsWith(github.ref, 'refs/tags')
45+
run: |
46+
BUILDDIR=_build/html/main make -C docs/ local
47+
48+
- name: Build Docs
49+
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags')
50+
# Use the args we normally pass to sphinx-build, but run sphinx-multiversion
51+
run: |
52+
sphinx-multiversion docs docs/_build/html
53+
touch docs/_build/html/.nojekyll
54+
cp docs/_assets/gh-pages-redirect.html docs/_build/html/index.html
55+
56+
- name: Publish Docs to gh-pages
57+
# Only once from main or a tag
58+
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags')
59+
# We pin to the SHA, not the tag, for security reasons.
60+
# https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/security-hardening-for-github-actions#using-third-party-actions
61+
uses: peaceiris/actions-gh-pages@bbdfb200618d235585ad98e965f4aafc39b4c501 # v3.7.3
62+
with:
63+
github_token: ${{ secrets.GITHUB_TOKEN }}
64+
publish_dir: docs/_build/html
65+
keep_files: true

CODE_OF_CONDUCT.md

+78
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
# PyMC Code of Conduct
2+
3+
## Our Pledge
4+
5+
In the interest of fostering an open and welcoming environment, we as
6+
contributors and maintainers pledge to making participation in our project and
7+
our community a harassment-free experience for everyone, regardless of age, body
8+
size, disability, ethnicity, sex characteristics, gender identity and expression,
9+
level of experience, education, socio-economic status, nationality, personal
10+
appearance, race, religion, or sexual identity and orientation.
11+
12+
## Our Standards
13+
14+
Examples of behavior that contributes to creating a positive environment
15+
include:
16+
17+
* Using welcoming and inclusive language
18+
* Being respectful of differing viewpoints and experiences
19+
* Gracefully accepting constructive criticism
20+
* Focusing on what is best for the community
21+
* Showing empathy towards other community members
22+
23+
Examples of unacceptable behavior by participants include:
24+
25+
* The use of sexualized language or imagery and unwelcome sexual attention or
26+
advances
27+
* Trolling, insulting/derogatory comments, and personal or political attacks
28+
* Public or private harassment
29+
* Publishing others' private information, such as a physical or electronic
30+
address, without explicit permission
31+
* Other conduct which could reasonably be considered inappropriate in a
32+
professional setting
33+
34+
## Our Responsibilities
35+
36+
Project maintainers are responsible for clarifying the standards of acceptable
37+
behavior and are expected to take appropriate and fair corrective action in
38+
response to any instances of unacceptable behavior.
39+
40+
Project maintainers have the right and responsibility to remove, edit, or
41+
reject comments, commits, code, wiki edits, issues, and other contributions
42+
that are not aligned to this Code of Conduct, or to ban temporarily or
43+
permanently any contributor for other behaviors that they deem inappropriate,
44+
threatening, offensive, or harmful.
45+
46+
## Scope
47+
48+
This Code of Conduct applies both within project spaces and in public spaces
49+
when an individual is representing the project or its community. Examples of
50+
representing a project or community include using an official project e-mail
51+
address, posting via an official social media account, or acting as an appointed
52+
representative at an online or offline event. Representation of a project may be
53+
further defined and clarified by project maintainers.
54+
55+
## Enforcement
56+
57+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
58+
reported by contacting PyMC developer Christopher Fonnesbeck via email
59+
([email protected]) or phone (615-955-0380). Alternatively, you
60+
may also contact NumFOCUS Executive Director Leah Silen (512-222-5449) or
61+
fill an anonymous report using [NumFOCUS Typeform](https://numfocus.typeform.com/to/ynjGdT).
62+
As PyMC is a member of NumFOCUS and subscribes to their code of conduct as a
63+
precondition for continued membership. All complaints will be reviewed and
64+
investigated and will result in a response that is deemed necessary and
65+
appropriate to the circumstances. The project team is obligated to maintain
66+
confidentiality with regard to the reporter of an incident. Further details of
67+
specific enforcement policies may be posted separately.
68+
69+
Project maintainers who do not follow or enforce the Code of Conduct in good
70+
faith may face temporary or permanent repercussions as determined by other
71+
members of the project's leadership.
72+
73+
## Attribution
74+
75+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
76+
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
77+
78+
[homepage]: https://www.contributor-covenant.org

docs/.nojekyll

Whitespace-only changes.

docs/Makefile

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Minimal makefile for Sphinx documentation
2+
#
3+
4+
# You can set these variables from the command line.
5+
SPHINXOPTS = # "-W" treats warnings as errors
6+
SPHINXBUILD ?= sphinx-multiversion
7+
SOURCEDIR = .
8+
BUILDDIR ?= _build
9+
10+
# Put it first so that "make" without argument is like "make help".
11+
help:
12+
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
13+
14+
.PHONY: help Makefile
15+
16+
clean:
17+
rm -rf $(BUILDDIR)/*
18+
19+
# For local build
20+
local:
21+
sphinx-build "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
22+
23+
# Catch-all target: route all unknown targets to Sphinx using the new
24+
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
25+
%: Makefile
26+
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

docs/_templates/versioning.html

+66
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
{% if versions %}
2+
3+
{% if current_version != versions.tags[-1] and current_version != versions.branches[0] %}
4+
<p style="margin-top: 1em; margin-bottom: 0;">
5+
<strong>
6+
You're reading an old version of this documentation (v. {{current_version.name}}).<br>
7+
If you want up-to-date information, please have a look at <a href="{{ vpathto(versions.tags[-1].name) }}">latest</a>.
8+
</strong>
9+
</p>
10+
{% endif %}
11+
12+
{% if current_version == versions.branches[0] %}
13+
<p style="margin-top: 1em; margin-bottom: 0;">
14+
<strong>
15+
You're reading the documentation for a development version ({{current_version.name}}).<br>
16+
For the latest released version, please have a look at <a href="{{ vpathto(versions.tags[-1].name) }}">latest</a>.
17+
</strong>
18+
</p>
19+
{% endif %}
20+
21+
<nav class="bd-links" id="bd-docs-nav" aria-label="Versions navigation">
22+
<div class="bd-toc-item active">
23+
<ul class="current nav bd-sidenav">
24+
<li class="toctree-l1 has-children">
25+
<p class="caption"><span class="caption-text">Version</span></p>
26+
<input class="toctree-checkbox" id="toctree-checkbox-1" name="toctree-checkbox-1" type="checkbox">
27+
<label for="toctree-checkbox-1"> <i class="fas fa-chevron-down"></i></label>
28+
29+
<ul>
30+
31+
{%- for item in versions.branches %}
32+
{% if item == current_version %}
33+
<li class="toctree-l2 current active"><a href="{{ item.url }}"> Development </a></li>
34+
{% else %}
35+
<li><a href="{{ item.url }}"> Development </a></li>
36+
{% endif %}
37+
{%- endfor %}
38+
39+
{%- for item in versions.tags[::-1] %}
40+
41+
{% if item == current_version %}
42+
43+
{% if loop.first %}
44+
<li class="toctree-l2 current active"><a href="{{ item.url }}">{{ item.name }} (latest)</a></li>
45+
{% else %}
46+
<li class="toctree-l2 current active"><a href="{{ item.url }}">{{ item.name }}</a></li>
47+
{% endif %}
48+
49+
{% else %}
50+
51+
{% if loop.first %}
52+
<li><a href="{{ item.url }}">{{ item.name }} (latest)</a></li>
53+
{% else %}
54+
<li><a href="{{ item.url }}">{{ item.name }}</a></li>
55+
{% endif %}
56+
57+
{% endif %}
58+
{%- endfor %}
59+
60+
</ul>
61+
</li>
62+
</ul>
63+
</div>
64+
</nav>
65+
66+
{% endif %}

docs/api_reference.rst

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
API Reference
2+
***************
3+
4+
This reference provides detailed documentation for all modules, classes, and
5+
methods in the current release of PyMC experimental.
6+
7+
8+
.. toctree::
9+
:maxdepth: 2
10+
11+
12+
:mod:`pymc_experimental.bart`
13+
=============================
14+
15+
.. automodule:: pymc_experimental.bart
16+
:members: BART, PGBART, plot_dependence, plot_variable_importance, predict
17+

0 commit comments

Comments
 (0)