Skip to content

Change docs theme #371

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Jun 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@ _build
*.egg-info
build/
dist/
docs/_build/
docs/build/
docs/jupyter_execute/
*.vscode
.coverage
*.jupyterlab-workspace

# Sphinx documentation
docs/build/
docs/jupyter_execute/
docs/source/api/generated/
13 changes: 1 addition & 12 deletions causalpy/pymc_experiments.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""
Experiment routines for PyMC models.

- ExperimentalDesign base class
- Pre-Post Fit
- Interrupted Time Series
- Synthetic Control
- Difference in differences
- Regression Discontinuity
- Pretest/Posttest Nonequivalent Group Design

"""
"""Quasi-Experiment classes for Bayesian causal inference"""

import warnings # noqa: I001
from typing import Union
Expand Down
13 changes: 1 addition & 12 deletions causalpy/pymc_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""
Defines generic PyMC ModelBuilder class and subclasses for

- WeightedSumFitter model for Synthetic Control experiments
- LinearRegression model

Models are intended to be used from inside an experiment
class (see :doc:`PyMC experiments</api_pymc_experiments>`).
This is why the examples require some extra
manipulation input data, often to ensure `y` has the correct shape.

"""
"""Custom PyMC models for causal inference"""

from typing import Any, Dict, Optional

Expand Down
11 changes: 1 addition & 10 deletions causalpy/skl_experiments.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""
Experiments for Scikit-Learn models

- ExperimentalDesign: base class for scikit-learn experiments
- PrePostFit: base class for synthetic control and interrupted time series
- SyntheticControl
- InterruptedTimeSeries
- DifferenceInDifferences
- RegressionDiscontinuity
"""
"""Quasi-Experiment classes for OLS inference"""

import warnings
from typing import Optional
Expand Down
7 changes: 1 addition & 6 deletions causalpy/skl_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""
Scikit-Learn Models

- Weighted Proportion

"""
"""Custom scikit-learn models for causal inference"""

from functools import partial

Expand Down
72 changes: 72 additions & 0 deletions docs/source/_static/custom.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
/* Make each footer item in-line so they stack horizontally instead of vertically */
.footer-item {
display: inline-block;
}

/* Add a separating border line for all but the last item */
/*
.footer-item:not(:last-child) {
border-right: 1px solid var(--pst-color-text-base);
margin-right: .5em;
padding-right: .5em;
}
*/

.footer-item ul {
list-style: none;
display: flex;
padding-left: 0;
margin-bottom: 0;
}

.footer-item ul li {
padding-right: .5em;
}

.footer-item li a.nav-link {
color: var(--pst-color-text-muted);
}

.footer-item li a.nav-link:hover {
color: var(--pst-color-primary);
text-decoration: none;
}

/* Remove footer icon text for small screen width and increase icons size */
@media (max-width: 660px) {
.footer-item li a.nav-link i {
padding-right: 0.5em;
font-size: calc(var(--bs-body-font-size) * 1.5);
}

.footer-item li a.nav-link span {
font-size: 0;
}
}

footer.bd-footer {
position: static;
bottom: auto;
background: var(--pst-color-on-background) !important;
}

/* Make footer non-sticky when lines start to wrap-around*/
@media (max-width: 520px) {
footer.bd-footer {
position: inherit;
}
}

.causalpy-name {
padding-left: 2rem;
}

@media (min-width: 960px) {
.navbar-center-item {
padding-right: 4em;
}
}

.no-border {
border: none !important;
}
5 changes: 5 additions & 0 deletions docs/source/_templates/autosummary/base.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{{ name | escape | underline}}

.. currentmodule:: {{ module }}

.. auto{{ objtype }}:: {{ objname }}
30 changes: 30 additions & 0 deletions docs/source/_templates/autosummary/class.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{{ name | escape | underline}}

.. currentmodule:: {{ module }}

.. autoclass:: {{ objname }}

{% block methods %}
{% if methods %}

.. rubric:: Methods

.. autosummary::
:toctree:

{% for item in methods %}
{{ objname }}.{{ item }}
{%- endfor %}
{% endif %}
{% endblock %}

{% block attributes %}
{% if attributes %}
.. rubric:: Attributes

.. autosummary::
{% for item in attributes %}
~{{ name }}.{{ item }}
{%- endfor %}
{% endif %}
{% endblock %}
5 changes: 5 additions & 0 deletions docs/source/_templates/autosummary/method.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{{ objname | escape | underline}}

.. currentmodule:: {{ module }}

.. auto{{ objtype }}:: {{ objname }}
64 changes: 64 additions & 0 deletions docs/source/_templates/autosummary/module.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
{{ name | escape | underline}}

.. automodule:: {{ fullname }}

{% block attributes %}
{% if attributes %}
.. rubric:: {{ _('Module Attributes') }}

.. autosummary::
{% for item in attributes %}
{{ item }}
{%- endfor %}
{% endif %}
{% endblock %}

{% block functions %}
{% if functions %}
.. rubric:: {{ _('Functions') }}

.. autosummary::
:toctree:

{% for item in functions %}
{{ item }}
{%- endfor %}
{% endif %}
{% endblock %}

{% block classes %}
{% if classes %}
.. rubric:: {{ _('Classes') }}

.. autosummary::
:toctree:

{% for item in classes %}
{{ item }}
{%- endfor %}
{% endif %}
{% endblock %}

{% block exceptions %}
{% if exceptions %}
.. rubric:: {{ _('Exceptions') }}

.. autosummary::
{% for item in exceptions %}
{{ item }}
{%- endfor %}
{% endif %}
{% endblock %}

{% block modules %}
{% if modules %}
.. rubric:: Modules

.. autosummary::
:toctree:
:recursive:
{% for item in modules %}
{{ item }}
{%- endfor %}
{% endif %}
{% endblock %}
38 changes: 38 additions & 0 deletions docs/source/_templates/footer-links.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<ul>

<li class="nav-item">
<a class="nav-link" href="https://twitter.com/pymc_labs">
<i class="fa-brands fa-twitter" aria-hidden="true"></i>
<span>Twitter</span>
</a>
</li>

<li class="nav-item">
<a class="nav-link" href="https://github.com/pymc-labs">
<i class="fa-brands fa-github" aria-hidden="true"></i>
<span>Github</span>
</a>
</li>

<li class="nav-item">
<a class="nav-link" href="https://www.linkedin.com/company/pymc-labs/">
<i class="fa-brands fa-linkedin" aria-hidden="true"></i>
<span>LinkedIn</span>
</a>
</li>

<li class="nav-item">
<a class="nav-link" href="https://www.youtube.com/c/PyMCLabs">
<i class="fa-brands fa-youtube" aria-hidden="true"></i>
<span>YouTube</span>
</a>
</li>

<li class="nav-item">
<a class="nav-link" href="https://www.meetup.com/pymc-labs-online-meetup/">
<i class="fa-brands fa-meetup" aria-hidden="true"></i>
<span>Meetup</span>
</a>
</li>

</ul>
1 change: 1 addition & 0 deletions docs/source/_templates/navbar-name.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<div class="causalpy-name">{{ project }} {{ release }}</div>
15 changes: 15 additions & 0 deletions docs/source/api/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# API

## Modules
```{eval-rst}
.. currentmodule:: causalpy
.. autosummary::
:recursive:
:toctree: generated/

data
pymc_experiments
pymc_models
skl_experiments
skl_models
```
9 changes: 0 additions & 9 deletions docs/source/api_datasets.rst

This file was deleted.

9 changes: 0 additions & 9 deletions docs/source/api_plot_utils.rst

This file was deleted.

10 changes: 0 additions & 10 deletions docs/source/api_pymc_experiments.rst

This file was deleted.

9 changes: 0 additions & 9 deletions docs/source/api_pymc_models.rst

This file was deleted.

9 changes: 0 additions & 9 deletions docs/source/api_skl_experiments.rst

This file was deleted.

9 changes: 0 additions & 9 deletions docs/source/api_skl_models.rst

This file was deleted.

Loading
Loading