Skip to content

Commit 7c7f456

Browse files
committed
feat: Add /docs used to deploy documentation to GitHub Pages
1 parent 8df3ea3 commit 7c7f456

File tree

11 files changed

+622
-4
lines changed

11 files changed

+622
-4
lines changed

.gitignore

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,5 +178,7 @@ tramp
178178
.\#*
179179

180180
# Sphinx documentation
181-
doc/_build/
182-
doc/auto_examples/
181+
sphinx/build/
182+
sphinx/auto_examples/
183+
sphinx/generated/
184+
sphinx/sg_execution_times.rst

.pre-commit-config.yaml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
exclude: |
2+
(?x)
3+
(fixtures/)|
4+
(^sphinx/)|
5+
(^docs/)
6+
17
repos:
28
- repo: https://github.com/pre-commit/pre-commit-hooks
39
rev: v5.0.0
@@ -52,5 +58,3 @@ repos:
5258
name: Use stylelint to lint CSS.
5359
entry: bash -c "cd skore-ui && npm run style-lint"
5460
files: ^skore-ui/
55-
56-
exclude: fixtures/

docs/.nojekyll

Whitespace-only changes.

docs/index.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<head>
2+
<meta http-equiv="refresh" content="0;latest/index.html">
3+
</head>

examples/README.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
.. _auto_examples:
2+
3+
Examples
4+
========
5+
6+
Below is a gallery of examples on how to use ``skore``.
Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
"""
2+
=================================
3+
1) Getting started with ``skore``
4+
=================================
5+
6+
This example runs the :ref:`getting_started` guide.
7+
8+
``skore`` UI
9+
------------
10+
11+
This section provides a quick start to the ``skore`` UI, an open-source package that aims to enable data scientists to:
12+
13+
#. Store objects of different types from their Python code: python lists, ``scikit-learn`` fitted pipelines, ``plotly`` figures, and more.
14+
#. Track and visualize these stored objects on a user-friendly dashboard.
15+
#. Export the dashboard to a HTML file.
16+
17+
Initialize a Project and launch the UI
18+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
19+
20+
From your shell, initialize a skore project, here named ``my_project_gs``, that
21+
will be in your current working directory:
22+
"""
23+
24+
# %%
25+
import subprocess
26+
27+
# remove the project if it already exists
28+
subprocess.run("rm -rf my_project_gs.skore".split())
29+
30+
# create the project
31+
subprocess.run("python3 -m skore create my_project_gs".split())
32+
33+
# %%
34+
# This will create a ``skore`` project directory named ``my_project_gs`` in the
35+
# current directory.
36+
#
37+
# From your shell (in the same directory), start the UI locally:
38+
#
39+
# .. code:: console
40+
#
41+
# python -m skore launch "my_project_gs"
42+
#
43+
# This will automatically open a browser at the UI's location.
44+
#
45+
# Now that the project file exists, we can load it in our notebook so that we can
46+
# read from and write to it:
47+
48+
# %%
49+
from skore import load
50+
51+
my_project_gs = load("my_project_gs.skore")
52+
53+
# %%
54+
# Storing some items
55+
# ^^^^^^^^^^^^^^^^^^
56+
#
57+
# Storing an integer:
58+
59+
# %%
60+
my_project_gs.put("my_int", 3)
61+
62+
# %%
63+
# Here, the name of my stored item is ``my_int`` and the integer value is 3.
64+
65+
# %%
66+
my_project_gs.get("my_int")
67+
68+
# %%
69+
# For a ``pandas`` data frame:
70+
71+
# %%
72+
import numpy as np
73+
import pandas as pd
74+
75+
my_df = pd.DataFrame(np.random.randn(3, 3))
76+
77+
my_project_gs.put("my_df", my_df)
78+
79+
# %%
80+
my_project_gs.get("my_df")
81+
82+
# %%
83+
# For a ``matplotlib`` figure:
84+
85+
# %%
86+
import matplotlib.pyplot as plt
87+
88+
x = [0, 1, 2, 3, 4, 5]
89+
fig, ax = plt.subplots(figsize=(5, 3), layout="constrained")
90+
_ = ax.plot(x)
91+
92+
my_project_gs.put("my_figure", fig)
93+
94+
# %%
95+
# For a ``scikit-learn`` fitted pipeline:
96+
97+
# %%
98+
from sklearn.datasets import load_diabetes
99+
from sklearn.linear_model import Lasso
100+
from sklearn.pipeline import Pipeline
101+
from sklearn.preprocessing import StandardScaler
102+
103+
diabetes = load_diabetes()
104+
X = diabetes.data[:150]
105+
y = diabetes.target[:150]
106+
my_pipeline = Pipeline(
107+
[("standard_scaler", StandardScaler()), ("lasso", Lasso(alpha=2))]
108+
)
109+
my_pipeline.fit(X, y)
110+
111+
my_project_gs.put("my_fitted_pipeline", my_pipeline)
112+
113+
# %%
114+
my_project_gs.get("my_fitted_pipeline")
115+
116+
# %%
117+
# Back to the dashboard
118+
# ^^^^^^^^^^^^^^^^^^^^^
119+
#
120+
# #. On the top left, create a new ``View``.
121+
# #. 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.
122+
#
123+
# .. image:: https://raw.githubusercontent.com/sylvaincom/sylvaincom.github.io/master/files/probabl/skore/2024_10_14_skore_demo.gif
124+
# :alt: Getting started with ``skore`` demo

0 commit comments

Comments
 (0)