Skip to content

Commit a54d0f9

Browse files
committed
WIP: documented py_utils.utils_segmentation
1 parent cfd8072 commit a54d0f9

File tree

10 files changed

+237
-104
lines changed

10 files changed

+237
-104
lines changed

docs/source/api.rst

Lines changed: 0 additions & 7 deletions
This file was deleted.

docs/source/api/index.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
API Reference
2+
=============
3+
4+
Each submodule provides independent functionality and has its own
5+
optional dependencies.
6+
7+
.. toctree::
8+
:maxdepth: 1
9+
10+
utils_segmentation
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
py_utils.utils_segmentation
2+
===========================
3+
4+
.. automodule:: py_utils.utils_segmentation
5+
:no-members:
6+
7+
8+
-------------------------------------------
9+
Sliding Window Utilities
10+
-------------------------------------------
11+
12+
.. autofunction:: py_utils.utils_segmentation.compute_sliding_window_indices
13+
.. autofunction:: py_utils.utils_segmentation.sliding_window
14+
15+
16+
-------------------------------------------
17+
Segmented Reduction Utilities
18+
-------------------------------------------
19+
20+
.. autofunction:: py_utils.utils_segmentation.segmented_argmin
21+
.. autofunction:: py_utils.utils_segmentation.segmented_argmax
22+
.. autofunction:: py_utils.utils_segmentation.segmented_min
23+
.. autofunction:: py_utils.utils_segmentation.segmented_max
24+
25+
.. autofunction:: py_utils.utils_segmentation.segmented_count
26+
.. autofunction:: py_utils.utils_segmentation.segmented_sum
27+
.. autofunction:: py_utils.utils_segmentation.segmented_mean
28+
29+
.. autofunction:: py_utils.utils_segmentation.segmented_where
30+

docs/source/conf.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,5 @@
4545

4646
# -- Options for HTML output -------------------------------------------------
4747
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
48-
49-
# html_theme = "alabaster"
50-
# html_theme = "python_docs_theme"
5148
html_theme = "haiku"
5249
html_static_path = ["_static"]

docs/source/dependency.rst

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
Dependencies
2+
============
3+
4+
Below are module-level dependencies and links to full API details.
5+
6+
7+
Segmentation Utils
8+
------------------
9+
10+
:mod:`py_utils.utils_segmentation`
11+
12+
.. automodule:: py_utils.utils_segmentation
13+
:no-members:
14+
:no-undoc-members:
15+
:no-index:

docs/source/generated/py_utils.utils_segmentation.rst

Lines changed: 0 additions & 22 deletions
This file was deleted.

docs/source/index.rst

Lines changed: 22 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,29 @@
1-
.. py_utils documentation master file, created by
2-
sphinx-quickstart on Tue Nov 11 10:15:30 2025.
3-
You can adapt this file completely to your liking, but it should at least
4-
contain the root `toctree` directive.
1+
.. note::
2+
This project is under active development. Documentation may change frequently.
53

6-
py_utils Documentation
7-
======================
4+
`GitHub Repository`_.
85

9-
Add your content using ``reStructuredText`` syntax. See the
10-
`reStructuredText <https://www.sphinx-doc.org/en/master/usage/restructuredtext/index.html>`_
11-
documentation for details.
126

13-
Check out the :doc:`usage` section for further information, including how to
14-
:ref:`install <installation>` the project.
7+
Getting Started
8+
===============
159

16-
.. note::
17-
This project is under active development. Documentation may change frequently.
10+
.. Check out the :doc:`usage` section for further information, including how to
11+
.. :ref:`install <installation>` the project.
1812
1913
.. toctree::
20-
:maxdepth: 2
21-
:caption: Contents:
14+
:maxdepth: 1
15+
16+
installation
17+
dependency
18+
api/index
19+
20+
Indices and Tables
21+
==================
22+
23+
* :ref:`genindex`
24+
* :ref:`modindex`
25+
* :ref:`search`
26+
2227

23-
usage
24-
api
28+
.. comment: list link used in the file above
29+
.. _GitHub Repository: https://github.com/ChadLin9596/python_utils

docs/source/installation.rst

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
Installation
2+
============
3+
4+
Install from GitHub
5+
-------------------
6+
7+
.. code-block:: bash
8+
9+
$ pip install git+https://github.com/ChadLin9596/python_utils.git
10+
11+
Custom Installation
12+
-------------------
13+
14+
``python_utils`` is modular. Each submodule has its own optional
15+
dependencies. You only need to install the dependencies for the parts you
16+
use.
17+
18+
Check the full module-level dependency list here:
19+
20+
:doc:`Dependency Overview <dependency>`
21+
22+
23+
Examples
24+
--------
25+
26+
** Install only segmentation utilities:**
27+
28+
.. code-block:: bash
29+
30+
pip install numpy_reduceat_ext numpy
31+
32+
then use
33+
34+
.. code-block:: python
35+
36+
import py_utils.utils_segmentation
37+
38+
39+
Notes
40+
-----
41+
42+
- Importing a submodule does **not** pull dependencies from other modules.
43+
- If you don’t import a heavy module (e.g., ``utils_torch``), its dependencies are never loaded.
44+
- Each module’s required dependencies are documented at the top of its API page and in the :doc:`dependency` page.

docs/source/usage.rst

Lines changed: 0 additions & 38 deletions
This file was deleted.

0 commit comments

Comments
 (0)