Skip to content
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

switch to Gurobi Sphinx theme #326

Merged
merged 5 commits into from
Sep 6, 2024
Merged
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
18 changes: 0 additions & 18 deletions docs/examples/README.rst
Original file line number Diff line number Diff line change
@@ -1,21 +1,3 @@
.. only:: html

.. image:: ../_static/gurobi_light.png
:width: 220
:target: https://www.gurobi.com
:alt: Gurobi
:align: right
:class: float-right, only-light


.. image:: ../_static/gurobi_dark.png
:width: 220
:target: https://www.gurobi.com
:alt: Gurobi
:align: right
:class: float-right, only-dark


Examples
########

1 change: 1 addition & 0 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -19,3 +19,4 @@ sphinx-pyproject==0.3.0
pydata-sphinx-theme==0.15.4
.
sphinx-gallery==0.16.0
gurobi-sphinxtheme @ git+https://github.com/Gurobi/gurobi-sphinxtheme.git@main
2 changes: 2 additions & 0 deletions docs/source/_static/gurobi_ml.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.sidebar-brand-text
font-size: 1.3rem
28 changes: 28 additions & 0 deletions docs/source/_templates/sidebar/brand.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{#-

Adapted from the furo theme template at:
https://github.com/pradyunsg/furo/blob/main/src/furo/theme/furo/sidebar/brand.html

- Making the logo link to Gurobi.com
- Make the project string link to master_doc

-#}
<a class="sidebar-brand{% if logo %} centered{% endif %}" href="https://www.gurobi.com">
{% block brand_content %}
{%- if logo_url %}
<div class="sidebar-logo-container">
<img class="sidebar-logo" src="{{ logo_url }}" alt="Logo"/>
</div>
{%- endif %}
{%- if theme_light_logo and theme_dark_logo %}
<div class="sidebar-logo-container">
<img class="sidebar-logo only-light" src="{{ pathto('_static/' + theme_light_logo, 1) }}" alt="Light Logo"/>
<img class="sidebar-logo only-dark" src="{{ pathto('_static/' + theme_dark_logo, 1) }}" alt="Dark Logo"/>
</div>
{%- endif %}
</a>
<br>
<a href="{{ pathto(master_doc) }}"
<span class="sidebar-brand-text" >{{ docstitle if docstitle else project }}</span>
</a>
{% endblock brand_content %}
17 changes: 0 additions & 17 deletions docs/source/api.rst
Original file line number Diff line number Diff line change
@@ -1,20 +1,3 @@
.. only:: html

.. image:: _static/gurobi_light.png
:width: 220
:target: https://www.gurobi.com
:alt: Gurobi
:align: right
:class: float-right, only-light

.. image:: _static/gurobi_dark.png
:width: 220
:target: https://www.gurobi.com
:alt: Gurobi
:align: right
:class: float-right, only-dark


API
###

41 changes: 18 additions & 23 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
@@ -133,42 +133,37 @@ def get_versions(file: Path):
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = "pydata_sphinx_theme"
html_theme = "gurobi_sphinxtheme"
html_title = project + " Manual"
html_theme_options = {
"logo": {
"text": "GUROBI Machine Learning",
# "image_light": "_static/gurobi.png",
# "image_dark": "_static/gurobi.png",
# "alt_text": "Gurobi home",
},
"navbar_align": "content",
"icon_links": [
"version_warning": False,
"feedback_banner": True,
"construction_warning": False,
"sidebar_hide_name": False,
"footer_icons": [
{
"name": "GitHub",
"url": "https://github.com/Gurobi/Gurobi-machinelearning",
"icon": "fa-brands fa-github",
},
{
"name": "Gurobi",
"url": "https://www.gurobi.com",
"icon": "_static/gurobi.png",
"type": "local",
"url": "https://github.com/Gurobi/gurobi-machinelearning",
"html": """
<svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 16 16">
<path fill-rule="evenodd" d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0 0 16 8c0-4.42-3.58-8-8-8z"></path>
</svg>
""",
"class": "",
},
],
}
html_show_sourcelink = False

myst_enable_extensions = [
"dollarmath",
]
html_show_sourcelink = True

# 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"]
autodoc_member_order = "groupwise"
autodoc_mock_imports = ["torch", "tensorflow", "xgboost"]

html_css_files = [
"gurobi_ml.css",
]
bibtex_bibfiles = ["refs.bib"]

extlinks_detect_hardcoded_links = True
19 changes: 2 additions & 17 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
@@ -1,20 +1,3 @@
.. only:: html

.. image:: _static/gurobi_light.png
:width: 220
:target: https://www.gurobi.com
:alt: Gurobi
:align: right
:class: float-right, only-light

.. image:: _static/gurobi_dark.png
:width: 220
:target: https://www.gurobi.com
:alt: Gurobi
:align: right
:class: float-right, only-dark


Gurobi Machine Learning
#######################

@@ -49,10 +32,12 @@ different machine learning frameworks (scikit-learn, LightGBM, XGBoost, Keras an

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

userguide
auto_examples/index
api
meta/contactus
meta/license
gurobi.com ressources <https://www.gurobi.com/features/gurobi-machine-learning/>
6 changes: 4 additions & 2 deletions docs/source/user/mip-models.rst
Original file line number Diff line number Diff line change
@@ -108,10 +108,12 @@ Then for each leaf, the inequalities describing :math:`\mathcal L_l` and :math:`
are imposed using indicator constraints:

.. math::
:nowrap:

& \delta_l = 1 \rightarrow x_{i_v} \le \theta_v, & & \text{for } x_{i_v} \le \theta_v \in \mathcal L_l,

\begin{align*}
& \delta_l = 1 \rightarrow x_{i_v} \le \theta_v, & & \text{for } x_{i_v} \le \theta_v \in \mathcal L_l,\\
& \delta_l = 1 \rightarrow x_{i_v} \ge \theta_v + \epsilon, & & \text{for } x_{i_v} > \theta_v \in \mathcal R_l.
\end{align*}

A difficulty here is that the strictly greater than constraints of :math:`\mathcal R_l`
can't be represented exactly in a mixed integer optimization model. To
16 changes: 0 additions & 16 deletions docs/source/userguide.rst
Original file line number Diff line number Diff line change
@@ -1,19 +1,3 @@
.. only:: html

.. image:: _static/gurobi_light.png
:width: 220
:target: https://www.gurobi.com
:alt: Gurobi
:align: right
:class: float-right, only-light

.. image:: _static/gurobi_dark.png
:width: 220
:target: https://www.gurobi.com
:alt: Gurobi
:align: right
:class: float-right, only-dark

User Guide
##########