Skip to content
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ instance/

# Sphinx documentation
docs/_build/
docs/_autosummary/

# PyBuilder
.pybuilder/
Expand Down
1 change: 1 addition & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,4 @@ clean:
sphinx-build -M clean "$(SOURCEDIR)" "$(BUILDDIR)"
sphinx-build -M clean "$(SOURCEDIR)" "imgs"
sphinx-build -M clean "$(SOURCEDIR)" "pages/modules/generated/"
rm -rf "$(SOURCEDIR)/_autosummary"
143 changes: 143 additions & 0 deletions docs/_static/custom.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
/* Улучшенные цвета и стили */
.wy-nav-content {
max-width: 1200px;
}

/* Красивые заголовки */
h1 {
color: #2980B9;
border-bottom: 2px solid #2980B9;
padding-bottom: 10px;
}

h2 {
color: #34495e;
margin-top: 30px;
}

/* Стилизация блоков кода */
.highlight {
background: #f8f8f8 !important;
border: 1px solid #e1e4e8;
border-radius: 6px;
margin: 1em 0;
}

/* Красивые примечания */
.admonition {
border-radius: 6px;
padding: 12px;
border-left: 4px solid;
}

.admonition.note {
background-color: #e3f2fd;
border-left-color: #2196f3;
}

.admonition.warning {
background-color: #fff3cd;
border-left-color: #ffc107;
}

.admonition.tip {
background-color: #e8f5e9;
border-left-color: #4caf50;
}

/* Улучшенные таблицы */
.wy-table-responsive table td, .wy-table-responsive table th {
white-space: normal;
}

table.docutils {
border: 1px solid #e1e4e8;
border-collapse: collapse;
border-spacing: 0;
width: 100%;
}

table.docutils tr:nth-child(2n) {
background-color: #f6f8fa;
}

/* Красивые кнопки */
.btn {
display: inline-block;
padding: 6px 12px;
margin-bottom: 0;
font-size: 14px;
font-weight: 400;
line-height: 1.42857143;
text-align: center;
white-space: nowrap;
vertical-align: middle;
cursor: pointer;
border: 1px solid transparent;
border-radius: 4px;
background-color: #2980B9;
color: white;
text-decoration: none;
}

.btn:hover {
background-color: #21618C;
color: white;
}

/* API Reference styling */
.class dt {
font-size: 1.1em;
font-weight: bold;
margin-top: 20px;
padding: 10px;
background-color: #f0f0f0;
border-left: 3px solid #2980B9;
}

/* Parameters styling */
.field-list {
margin: 20px 0;
}

.field-name {
font-weight: bold;
min-width: 100px;
padding-right: 20px;
}

/* Навигация */
.wy-menu-vertical li.current > a {
background: #fcfcfc;
border-right: solid 3px #2980B9;
}

.wy-menu-vertical li.current a {
color: #404040;
}

/* Badges */
.badge {
display: inline-block;
padding: 3px 7px;
font-size: 12px;
font-weight: bold;
line-height: 1;
color: #fff;
text-align: center;
white-space: nowrap;
vertical-align: baseline;
border-radius: 10px;
}

.badge-primary {
background-color: #2980B9;
}

.badge-success {
background-color: #27ae60;
}

.badge-warning {
background-color: #f39c12;
}
71 changes: 38 additions & 33 deletions docs/_templates/autosummary/module.rst
Original file line number Diff line number Diff line change
@@ -1,48 +1,53 @@
.. role:: hidden
:class: hidden-section
:class: hidden-section

{{ name | underline }}

.. automodule:: {{ fullname }}

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

.. autosummary::
:toctree: generated
:nosignatures:
:template: classtemplate.rst
{% for item in classes %}
{{ item }}
{%- endfor %}
{% endif %}
{% endblock %}

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

.. autosummary::
:toctree: generated
:nosignatures:
:template: functiontemplate.rst
{% for item in functions %}
{{ item }}
{%- endfor %}
{% endif %}
{% endblock %}
{% block classes %}
{% if classes %}

.. rubric:: {{ _('Classes') }}

.. autosummary::
:toctree: generated
:nosignatures:
:template: classtemplate.rst

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

{% block functions %}
{% if functions %}

.. rubric:: {{ _('Functions') }}

.. autosummary::
:toctree: generated
:nosignatures:
:template: functiontemplate.rst

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

{% block modules %}
{% if modules %}

.. rubric:: {{ _('Modules') }}

.. autosummary::
:toctree:
:recursive:
{% for item in modules %}
{{ item }}
{%- endfor %}
:toctree:
:recursive:

{% for item in modules %}
{{ item }}
{% endfor %}
{% endif %}
{% endblock %}
40 changes: 40 additions & 0 deletions docs/api_reference.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
API Reference
=============

.. currentmodule:: hypex

Main Classes
------------

.. autosummary::
:toctree: _autosummary
:nosignatures:
:template: autosummary/class.rst

AATest
ABTest
HomogeneityTest
matching.Matching

Dataset Module
--------------

.. autosummary::
:toctree: _autosummary
:nosignatures:
:template: autosummary/class.rst

dataset.Dataset
dataset.ExperimentData

Roles
~~~~~

.. autosummary::
:toctree: _autosummary
:nosignatures:

dataset.TargetRole
dataset.TreatmentRole
dataset.FeatureRole
dataset.InfoRole
31 changes: 31 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,41 @@
# a list of builtin themes.
html_theme = "sphinx_rtd_theme"

html_theme_options = {
'logo_only': False,
'prev_next_buttons_location': 'bottom',
'style_external_links': True,
'vcs_pageview_mode': 'blob',
'style_nav_header_background': '#2980B9',
# Toc options
'collapse_navigation': True,
'sticky_navigation': True,
'navigation_depth': 4,
'includehidden': True,
'titles_only': False,
'globaltoc_collapse': True,
'globaltoc_maxdepth': 3,
}

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ["_static"]

html_css_files = [
'custom.css',
]

html_show_sourcelink = False
html_sidebars = {
'**': [
'globaltoc.html',
'relations.html',
'sourcelink.html',
'searchbox.html',
]
}

# code style
pygments_style = "default"

Expand All @@ -99,6 +129,7 @@
"ignore-module-all": True,
"show-inheritance": True,
"exclude-members": EXCLUDED_MEMBERS,
'inherited-members': False,
}

# order of members in docs, usefully for methods in class
Expand Down
30 changes: 30 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,36 @@
Welcome to HypEx's documentation!
==================================

HypEx is a fast and customizable framework for Causal Inference.

.. toctree::
:maxdepth: 2
:caption: Contents:

installation
quickstart
api_reference

Installation
------------

.. code-block:: bash

pip install hypex

Quick Start
-----------

.. code-block:: python

from hypex import ABTest, AATest, Matching
from hypex.dataset import Dataset, TargetRole, TreatmentRole

# Your code here

Indices and tables
==================

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
Loading
Loading