-
Notifications
You must be signed in to change notification settings - Fork 0
Add sphinx doc #7
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
Open
popescu-v
wants to merge
5
commits into
main
Choose a base branch
from
add-sphinx-doc
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+245
−1
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
ca10548
chore: add Sphinx-generated build scripts
popescu-v dfd8d8c
chore: add Sphinx configuration file
popescu-v 231f073
docs: add custom CSS file (copied from khiops-python)
popescu-v 17f1e53
docs: add Sphinx documentation index
popescu-v c13c39b
fix: hard-code khisto version
popescu-v File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| /* Custom header sizes */ | ||
| h1 { | ||
| font-size: 1.85em; | ||
| } | ||
|
|
||
| h2 { | ||
| font-size: 1.55em; | ||
| } | ||
|
|
||
| h3 { | ||
| font-size: 1.30em; | ||
| } | ||
|
|
||
| h4 { | ||
| font-size: 1.10em; | ||
| } | ||
|
|
||
| h5 { | ||
| font-size: 0.90em; | ||
| } | ||
|
|
||
| img.sidebar-logo { | ||
| width: 40px; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| ====================== | ||
| khisto.array.histogram | ||
| ====================== | ||
|
|
||
| .. automodule:: khisto.array.histogram | ||
|
|
||
| Main Modules | ||
| ============ | ||
| .. autosummary:: | ||
| :toctree: generated | ||
| :recursive: | ||
| :nosignatures: | ||
|
|
||
| api |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,101 @@ | ||
| # 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 | ||
| import os | ||
| import sys | ||
| from pathlib import Path | ||
|
|
||
| sys.path.append("..") | ||
| sys.path.append(os.path.join("..", "src")) | ||
|
|
||
| project = 'khisto-python' | ||
| copyright = '2026, The Khiops Team' | ||
| author = 'The Khiops Team' | ||
| release = "0.1.0" # TODO: use pyproject metadata here | ||
|
|
||
| # -- General configuration --------------------------------------------------- | ||
| # https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration | ||
| # Be strict about any broken references | ||
| nitpicky = True | ||
|
|
||
| # To avoid using qualifiers like :class: to reference objects within the same context | ||
| default_role = "obj" | ||
|
|
||
| extensions = [ | ||
| "sphinx.ext.autodoc", | ||
| "sphinx.ext.autosummary", | ||
| "sphinx.ext.intersphinx", | ||
| "numpydoc", | ||
| "sphinx_copybutton", | ||
| ] | ||
|
|
||
| ## Numpydoc extension config | ||
| numpydoc_show_class_members = False | ||
|
|
||
| ## Autodoc extension config | ||
| autodoc_default_options = { | ||
| "members": True, | ||
| "inherited-members": False, | ||
| "private-members": False, | ||
| "show-inheritance": True, | ||
| "special-members": False, | ||
| } | ||
|
|
||
| ## Intersphinx extension config | ||
| intersphinx_mapping = { | ||
| "python": ("https://docs.python.org/3", None), | ||
| "numpy": ("https://numpy.org/doc/stable", None), | ||
| "matplotlib": ("https://matplotlib.org/stable", None), | ||
| } | ||
|
|
||
| templates_path = ['_templates'] | ||
| exclude_patterns = ['_templates', '_build', 'Thumbs.db', '.DS_Store'] | ||
|
|
||
|
|
||
|
|
||
| # -- Options for HTML output ------------------------------------------------- | ||
| # https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output | ||
|
|
||
| html_theme = 'furo' | ||
| html_theme_options = { | ||
| "light_css_variables": { | ||
| "color-brand-primary": "#FF7900", | ||
| "color-brand-content": "#F16E00", | ||
| "color-brand-visited": "#FF7900", | ||
| "color-sidebar-background": "#FFFFFF", | ||
| "color-highlighted-background": "#FFD200", | ||
| "color-admonition-title--note": "#FF7900", | ||
| "color-admonition-title-background--note": "#FFF0E2", | ||
| "font-stack": "Helvetica Neue, Helvetica, sans-serif", | ||
| }, | ||
| "dark_css_variables": { | ||
| "color-brand-primary": "#FF7900", | ||
| "color-brand-content": "#F16E00", | ||
| "color-brand-visited": "#FF7900", | ||
| "color-sidebar-background": "#000000", | ||
| "color-highlighted-background": "#FFD200", | ||
| "color-admonition-title--note": "#FF7900", | ||
| "color-admonition-title-background--note": "#CC6100", | ||
| "font-stack": "Helvetica Neue, Helvetica, sans-serif", | ||
| }, | ||
| # Sets the Github Icon (the SVG is embedded, copied from furo's repo) | ||
| "footer_icons": [ | ||
| { | ||
| "name": "GitHub", | ||
| "url": "https://github.com/khiopsml/khisto-python", | ||
| "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_title = f"<h6><center>{project} {release}</center></h6>" | ||
| html_static_path = ['_static'] | ||
| html_css_files = ["css/custom.css"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| ============ | ||
| khisto.core | ||
| ============ | ||
|
|
||
| .. automodule:: khisto.core | ||
|
|
||
| Main Modules | ||
| ============ | ||
| .. autosummary:: | ||
| :toctree: generated | ||
| :recursive: | ||
| :nosignatures: | ||
|
|
||
| cli_adapter |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| .. khisto-python documentation master file, created by | ||
| sphinx-quickstart on Fri Mar 6 17:40:33 2026. | ||
| You can adapt this file completely to your liking, but it should at least | ||
| contain the root `toctree` directive. | ||
|
|
||
| khisto-python documentation | ||
| =========================== | ||
|
|
||
| Add your content using ``reStructuredText`` syntax. See the | ||
| `reStructuredText <https://www.sphinx-doc.org/en/master/usage/restructuredtext/index.html>`_ | ||
| documentation for details. | ||
|
|
||
|
|
||
| .. toctree:: | ||
| :maxdepth: 2 | ||
| :caption: API Reference | ||
| :hidden: | ||
|
|
||
| Histograms <array/histogram/index> | ||
| Core <core/index> | ||
| Matplotlib <matplotlib/index> | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| @ECHO OFF | ||
|
|
||
| pushd %~dp0 | ||
|
|
||
| REM Command file for Sphinx documentation | ||
|
|
||
| if "%SPHINXBUILD%" == "" ( | ||
| set SPHINXBUILD=sphinx-build | ||
| ) | ||
| set SOURCEDIR=. | ||
| set BUILDDIR=_build | ||
|
|
||
| %SPHINXBUILD% >NUL 2>NUL | ||
| if errorlevel 9009 ( | ||
| echo. | ||
| echo.The 'sphinx-build' command was not found. Make sure you have Sphinx | ||
| echo.installed, then set the SPHINXBUILD environment variable to point | ||
| echo.to the full path of the 'sphinx-build' executable. Alternatively you | ||
| echo.may add the Sphinx directory to PATH. | ||
| echo. | ||
| echo.If you don't have Sphinx installed, grab it from | ||
| echo.https://www.sphinx-doc.org/ | ||
| exit /b 1 | ||
| ) | ||
|
|
||
| if "%1" == "" goto help | ||
|
|
||
| %SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% | ||
| goto end | ||
|
|
||
| :help | ||
| %SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% | ||
|
|
||
| :end | ||
| popd |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| ================= | ||
| khisto.matplotlib | ||
| ================= | ||
|
|
||
| .. automodule:: khisto.matplotlib | ||
|
|
||
| Main Modules | ||
| ============ | ||
| .. autosummary:: | ||
| :toctree: generated | ||
| :recursive: | ||
| :nosignatures: | ||
|
|
||
| hist |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not get the version from the pyproject toml ?