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

412 user guide and api documentation #503

Closed
wants to merge 21 commits into from
Closed
Show file tree
Hide file tree
Changes from 6 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
54 changes: 54 additions & 0 deletions .github/workflows/push_doc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Build documentation

on:
push:
branches:
- main
- test-ci*
pull_request:
branches:
- '**'

permissions:
contents: write

jobs:
push_doc:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- uses: actions/setup-python@v4
with:
python-version: '3.10'

- run: pip install .[doc]

- name: Sphinx build
run: sphinx-build doc build

- name: Save the PR number
env:
GITHUB_PULL_REQUEST_NUMBER: ${{github.event.number}}
run: |
echo "Storing PR number ${{github.event.number}} to 'pull_request_number' file"
echo ${{github.event.number}} > pull_request_number

- name: Upload doc preview
# The publication of the preview itself happens in pr-doc-preview.yml
if: ${{ github.event_name == 'pull_request' }}
uses: actions/upload-artifact@v3
with:
name: doc-preview
path: |
./build
pull_request_number

- name: Deploy
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
uses: peaceiris/actions-gh-pages@v3
with:
publish_branch: gh-pages
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./build
commit_message: "[ci skip] ${{ github.event.head_commit.message }}"
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,10 @@ cython_debug/
.DS_Store
*.datamander

# Sphinx documentation
doc/_build/
doc/auto_examples/

# Visual studio code
.vscode

Expand Down
20 changes: 20 additions & 0 deletions doc/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = .
BUILDDIR = _build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
43 changes: 43 additions & 0 deletions doc/_static/css/custom.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
div.docutils.container.index-features {
width: 300px;
}

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;
}
}
Copy link
Contributor

@augustebaum augustebaum Oct 17, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe a file called .gitkeep would achieve the same result?

Empty file.
Binary file added doc/_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 doc/_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 doc/_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 doc/_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>
17 changes: 17 additions & 0 deletions doc/api.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
API
===

.. currentmodule:: skore

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

Project
-------

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

Project
60 changes: 60 additions & 0 deletions doc/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# Configuration file for the Sphinx documentation builder.
#
# For the full list of built-in configuration values, see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html

# -- Project information -----------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information

project = "skore"
copyright = "2024, Probabl team"
author = "Probabl team"
release = "0.1.1"

# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration

extensions = [
"sphinx_gallery.gen_gallery",
"sphinx.ext.autosummary",
"sphinx.ext.intersphinx",
"numpydoc",
"sphinx_design",
]
templates_path = ["_templates"]
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]

# Add any paths that contain templates here, relative to this directory.
templates_path = ["_templates"]

# -- Options for HTML output -------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output

html_theme = "pydata_sphinx_theme"
html_static_path = ["_static"]

html_css_files = [
"css/custom.css",
]
html_js_files = []

# sphinx_gallery options
sphinx_gallery_conf = {
"examples_dirs": "../examples", # path to example scripts
"gallery_dirs": "auto_examples", # path to gallery generated output
}

# intersphinx configuration
intersphinx_mapping = {
"sklearn": ("https://scikit-learn.org/stable/", None),
}

numpydoc_show_class_members = False

html_title = "skore"

html_theme_options = {
"announcement": (
"https://raw.githubusercontent.com/soda-inria/hazardous/main/doc/announcement.html"
),
}
19 changes: 19 additions & 0 deletions doc/generated/skore.Project.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
:mod:`skore`.Project
===========================

.. rst-class:: side_comment

Usage examples at the bottom of this page.

.. currentmodule:: skore

.. autoclass:: Project
:inherited-members:





.. raw:: html

<div class="clearer"></div>
36 changes: 36 additions & 0 deletions doc/getting_started.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
.. _getting_started:

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

.. 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.

.. 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
44 changes: 44 additions & 0 deletions doc/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
.. You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.

Welcome to ``skore``
====================

#OwnYourDataScience
-------------------

.. container:: index-features

* track and visualize your objects from a user-friendly dashboard

* scikit-learn compatible

With ``skore``, data scientists can:

#. 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.

These are only the first features: skore is a work in progress and aims to be
an end-to-end library for data scientists.
Stay tuned!

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

.. 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 doc/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>`_.
Loading
Loading