Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add sphinx templates from 412-user-guide-and-api-documentation
Browse files Browse the repository at this point in the history
thomass-dev committed Oct 23, 2024
1 parent 6f023ab commit 576e7ed
Showing 11 changed files with 339 additions and 0 deletions.
43 changes: 43 additions & 0 deletions sphinx/_static/css/custom.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
div.docutils.container.index-features {
width: 450px;
}

div.docutils.container.index-box {
background-color: var(--pst-color-white-highlight);
border-radius: 10px;
color: black;
padding: 5px;
margin-left: 15px;
float: right;
width: 400px;
}

/* Need to be able to have absolute positioning for the div inside */
.bd-main .bd-content .bd-article-container .bd-article {
position: relative;
}

@media (min-width: 792px) {
div.docutils.container.index-features {
position: absolute;
top: 10px;
right: 0px;
}
}

@media (min-width: 1092px) {
div.docutils.container.index-box {
margin-left: 30px;
margin-right: -15px;
}
}

@media (max-width: 892px) {
div.docutils.container.index-box {
max-width: 500px;
width: unset;
float: unset;
margin-left: auto;
margin-right: auto;
}
}
Binary file added sphinx/_static/seer_extract.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added sphinx/_static/seer_home.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 19 additions & 0 deletions sphinx/_templates/class.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
:mod:`{{module}}`.{{objname}}
{{ underline }}==============

.. rst-class:: side_comment

Usage examples at the bottom of this page.

.. currentmodule:: {{ module }}

.. autoclass:: {{ objname }}
:inherited-members:

{% block methods %}

{% endblock %}

.. raw:: html

<div class="clearer"></div>
10 changes: 10 additions & 0 deletions sphinx/_templates/function.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
:mod:`{{module}}`.{{objname}}
{{ underline }}====================

.. currentmodule:: {{ module }}

.. autofunction:: {{ objname }}

.. raw:: html

<div class="clearer"></div>
39 changes: 39 additions & 0 deletions sphinx/api.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
API
===

.. currentmodule:: skore

This page lists all the public functions and classes of the ``skore``
package.


The ``skore`` UI
----------------

These classes are meant for ``skore``'s user interface.

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

Project

.. autosummary::
:toctree: generated/
:template: function.rst
:nosignatures:

load

The ``skore`` machine learning programming assistant
----------------------------------------------------

These functions and classes enhance ``scikit-learn``'s ones.

.. autosummary::
:toctree: generated/
:template: function.rst
:nosignatures:

cross_validate
41 changes: 41 additions & 0 deletions sphinx/getting_started.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
.. _getting_started:

Getting started
===============

``skore`` UI
------------

.. currentmodule:: skore

From your shell, initialize a skore project, here named ``project.skore``, that
will be in your current working directory:

.. code:: console
python -m skore create "project.skore"
Then, from your Python code (in the same directory), load the project and store
an integer for example:

.. code-block:: python
from skore import load
project = load("project.skore")
project.put("my_int", 3)
Finally, from your shell (in the same directory), start the UI locally:

.. code:: console
python -m skore launch project.skore
This will automatically open a browser at the UI's location:

#. On the top left, create a new ``View``.
#. From the ``Elements`` section on the bottom left, you can add stored items to this view, either by double-cliking on them or by doing drag-and-drop.

For more features, please look into :ref:`auto_examples`.

.. image:: https://raw.githubusercontent.com/sylvaincom/sylvaincom.github.io/master/files/probabl/skore/2024_10_14_skore_demo.gif
:alt: Getting started with ``skore`` demo
39 changes: 39 additions & 0 deletions sphinx/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
.. You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
Welcome to ``skore``
====================

With skore, data scientists can:

#. Track and visualize their ML/DS results.
#. Get assistance when developing their ML/DS projects.

- Scikit-learn compatible :func:`~skore.cross_validate` provides insights and checks on cross-validation.

These are only the initial features: skore is a work in progress and aims to be
an end-to-end library for data scientists.
Stay tuned!
Feedbacks are welcome: please feel free to join our `Discord <http://discord.probabl.ai>`_ or `create an issue <https://github.com/probabl-ai/skore/issues>`_.

We are a product team working at `Probabl <https://probabl.ai>`_ and our motto is #OwnYourDataScience.

- License: BSD
- GitHub repository: https://github.com/probabl-ai/skore
- Discord: http://discord.probabl.ai
- Status: under development, API is subject to change.

.. image:: https://raw.githubusercontent.com/sylvaincom/sylvaincom.github.io/master/files/probabl/skore/2024_10_14_skore_demo.gif
:alt: Getting started with skore demo

.. currentmodule:: skore

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

install
getting_started
auto_examples/index
user_guide
api
21 changes: 21 additions & 0 deletions sphinx/install.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
.. _install:

Install
=======

.. currentmodule:: skore

First of all, we recommend using a `virtual environment (venv) <https://docs.python.org/3/tutorial/venv.html>`_.
You need ``python>=3.9``.

Then, you can install ``skore`` by using ``pip``:

.. code:: console
pip install -U skore
You can check ``skore``'s latest version on `PyPI <https://pypi.org/project/skore/>`_.

🚨 For Windows users, the encoding must be set to
`UTF-8 <https://docs.python.org/3/using/windows.html#utf-8-mode>`_:
see `PYTHONUTF8 <https://docs.python.org/3/using/cmdline.html#envvar-PYTHONUTF8>`_.
20 changes: 20 additions & 0 deletions sphinx/user_guide.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
.. _user_guide:

User guide
==========

.. currentmodule:: skore

*The User Guide is currently work in progress and will be released soon, thank
you for your patience!*

For now, please look into:

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

install
getting_started
auto_examples/index
api
107 changes: 107 additions & 0 deletions sphinx/user_guide/getting_started.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
.. _getting_started:

Getting started with ``skore``
==============================

This example builds on top of the :ref:`getting_started` guide.

``skore`` UI
------------

This section provides a quick start to the ``skore`` UI, an open-source package that aims to enable data scientists to:

#. Store objects of different types from their Python code: python lists, ``scikit-learn`` fitted pipelines, ``plotly`` figures, and more.
#. Track and visualize these stored objects on a user-friendly dashboard.
#. Export the dashboard to a HTML file.

Initialize a Project and launch the UI
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

From your shell, initialize a skore project, here named ``project``, that will be
in your current working directory:

.. code:: console
python -m skore create "project"
This will create a ``skore`` project directory named ``project`` in the current
directory.

From your shell (in the same directory), start the UI locally:

.. code:: console
python -m skore launch "project"
This will automatically open a browser at the UI's location.

Now that the project file exists, we can load it in our notebook so that we can
read from and write to it:

.. code-block:: python
from skore import load
project = load("project.skore")
Storing some items
------------------

Storing an integer:

.. code-block:: python
project.put("my_int", 3)
Here, the name of my stored item is ``my_int`` and the integer value is 3.

For a ``pandas`` data frame:

.. code-block:: python
import numpy as np
import pandas as pd
my_df = pd.DataFrame(np.random.randn(3, 3))
project.put("my_df", my_df)
For a ``matplotlib`` figure:

.. code-block:: python
import matplotlib.pyplot as plt
x = [0, 1, 2, 3, 4, 5]
fig, ax = plt.subplots(figsize=(5, 3), layout="constrained")
_ = ax.plot(x)
project.put("my_figure", fig)
For a ``scikit-learn`` fitted pipeline:

.. code-block:: python
from sklearn.datasets import load_diabetes
from sklearn.linear_model import Lasso
from sklearn.pipeline import Pipeline
from sklearn.preprocessing import StandardScaler
diabetes = load_diabetes()
X = diabetes.data[:150]
y = diabetes.target[:150]
my_pipeline = Pipeline(
[("standard_scaler", StandardScaler()), ("lasso", Lasso(alpha=2))]
)
my_pipeline.fit(X, y)
project.put("my_fitted_pipeline", my_pipeline)
Back to the dashboard
^^^^^^^^^^^^^^^^^^^^^
#. On the top left, create a new ``View``.
#. From the ``Elements`` section on the bottom left, you can add stored items to this view, either by double-cliking on them or by doing drag-and-drop.

.. image:: https://raw.githubusercontent.com/sylvaincom/sylvaincom.github.io/master/files/probabl/skore/2024_10_14_skore_demo.gif
:alt: Getting started with ``skore`` demo

0 comments on commit 576e7ed

Please sign in to comment.