Skip to content

Commit e30a3cd

Browse files
DOC add plantuml C4 diagram (#124)
* DOC add plantuml C4 diagram
1 parent 65d7f3f commit e30a3cd

File tree

13 files changed

+138
-19
lines changed

13 files changed

+138
-19
lines changed

.github/workflows/emscripten.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
steps:
1010
- uses: actions/checkout@v4
1111
- name: Build WASM wheel
12-
uses: pypa/[email protected].0
12+
uses: pypa/[email protected].1
1313
env:
1414
CIBW_PLATFORM: pyodide
1515
- name: Upload package

.github/workflows/static.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99

1010
steps:
1111
- uses: actions/checkout@v4
12-
- uses: prefix-dev/[email protected].10
12+
- uses: prefix-dev/[email protected].11
1313
with:
1414
environments: static
1515
cache: true

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616

1717
steps:
1818
- uses: actions/checkout@v4
19-
- uses: prefix-dev/[email protected].10
19+
- uses: prefix-dev/[email protected].11
2020
with:
2121
environments: >-
2222
dev

.github/workflows/wheel.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
runs-on: ubuntu-latest
99
steps:
1010
- uses: actions/checkout@v4
11-
- uses: prefix-dev/[email protected].10
11+
- uses: prefix-dev/[email protected].11
1212
with:
1313
environments: dev
1414
cache: true
@@ -33,7 +33,7 @@ jobs:
3333
steps:
3434
- uses: actions/checkout@v4
3535
- name: Build wheels
36-
uses: pypa/[email protected].0
36+
uses: pypa/[email protected].1
3737
env:
3838
CIBW_SKIP: "*_i686 *_ppc64le *_s390x *_universal2 *-musllinux_*"
3939
CIBW_PROJECT_REQUIRES_PYTHON: ">=3.10"

.readthedocs.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,16 @@ build:
33
os: ubuntu-22.04
44
tools:
55
python: "3.13"
6+
apt_packages:
7+
- default-jre # for plantuml
8+
- graphviz # for plantuml
9+
jobs:
10+
pre_install:
11+
- bash scripts/rtd_pre_install.sh
612

713
sphinx:
814
configuration: doc/conf.py
15+
fail_on_warning: true
916

1017
python:
1118
install:

README.rst

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FastCan: A Fast Canonical-Correlation-Based Greedy Search Algorithm
1+
fastcan: A fast canonical-correlation-based greedy search algorithm
22
===================================================================
33
|conda| |Codecov| |CI| |Doc| |PythonVersion| |PyPi| |ruff| |pixi|
44

@@ -26,7 +26,7 @@ FastCan: A Fast Canonical-Correlation-Based Greedy Search Algorithm
2626
.. |pixi| image:: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/prefix-dev/pixi/main/assets/badge/v0.json&style=flat-square
2727
:target: https://pixi.sh
2828

29-
FastCan is a greedy search algorithm that supports:
29+
fastcan is a greedy search algorithm that supports:
3030

3131
#. Feature selection
3232

@@ -54,7 +54,7 @@ Check `Home Page <https://fastcan.readthedocs.io/en/latest/>`_ for more informat
5454
Installation
5555
------------
5656

57-
Install **FastCan** via PyPi:
57+
Install **fastcan** via PyPi:
5858

5959
* Run ``pip install fastcan``
6060

@@ -90,35 +90,35 @@ array([0.34617598, 0.95815008])
9090

9191
NARX Time Series Modelling
9292
--------------------------
93-
FastCan can be used for system identification.
93+
fastcan can be used for system identification.
9494
In particular, we provide a submodule `fastcan.narx` to build Nonlinear AutoRegressive eXogenous (NARX) models.
9595
For more information, check our `Home Page <https://fastcan.readthedocs.io/en/latest/>`_.
9696

9797

9898
Support Free-Threaded Wheels
9999
----------------------------
100-
FastCan has support for free-threaded (also known as nogil) CPython 3.13.
100+
fastcan has support for free-threaded (also known as nogil) CPython 3.13.
101101
For more information about free-threaded CPython, check `how to install a free-threaded CPython <https://py-free-threading.github.io/installing_cpython/>`_.
102102

103103
Support WASM Wheels
104104
-------------------
105-
FastCan is compiled to WebAssembly (WASM) wheels using `pyodide <https://github.com/pyodide/pyodide>`_, and they are available on the assets of GitHub releases.
105+
fastcan is compiled to WebAssembly (WASM) wheels using `pyodide <https://github.com/pyodide/pyodide>`_, and they are available on the assets of GitHub releases.
106106
You can try it in a `REPL <https://pyodide.org/en/stable/console.html>`_ directly in a browser.
107-
The WASM wheels of FastCan can be installed by
107+
The WASM wheels of fastcan can be installed by
108108

109109
>>> import micropip # doctest: +SKIP
110110
>>> await micropip.install('URL of the wasm wheel (end with _wasm32.whl)') # doctest: +SKIP
111111

112112
📝 **Note:** Due to the Cross-Origin Resource Sharing (CORS) block in web browsers,
113113
you may need `Allow CORS: Access-Control-Allow-Origin Chrome extension <https://chrome.google.com/webstore/detail/allow-cors-access-control/lhobafahddgcelffkeicbaginigeejlf>`_.
114114

115-
📝 **Note:** The nightly wasm wheel of FastCan's dependency (i.e. scikit-learn) can be found in `Scientific Python Nightly Wheels <https://pypi.anaconda.org/scientific-python-nightly-wheels/simple/>`_.
115+
📝 **Note:** The nightly wasm wheel of fastcan's dependency (i.e. scikit-learn) can be found in `Scientific Python Nightly Wheels <https://pypi.anaconda.org/scientific-python-nightly-wheels/simple/>`_.
116116

117117

118118
Citation
119119
--------
120120

121-
FastCan is a Python implementation of the following papers.
121+
fastcan is a Python implementation of the following papers.
122122

123123
If you use the `h-correlation` method in your work please cite the following reference:
124124

doc/conf.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,10 @@
4141
# Link to other project's documentation (see mapping below)
4242
"sphinx.ext.intersphinx",
4343
"sphinx_gallery.gen_gallery",
44-
# for dropdown directive
44+
# For dropdown directive
4545
"sphinx_design",
46+
# For PlantUML diagrams
47+
"sphinxcontrib.plantuml",
4648
]
4749

4850
# List of patterns, relative to source directory, that match files and

doc/diagram.puml

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
@startuml fastcan
2+
skinparam backgroundColor transparent
3+
!include https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/C4_Component.puml
4+
!include <logos/numpy>
5+
!include <logos/python>
6+
!include <logos/c>
7+
8+
9+
AddContainerTag("module", $legendText="module")
10+
AddContainerTag("db", $legendText="input/output", $sprite="numpy", $bgColor="gray", $fontColor="white", $borderColor="gray")
11+
AddComponentTag("python", $legendText="Python code", $sprite="python")
12+
AddComponentTag("cython", $legendText="Cython code", $sprite="c", $bgColor="gold", $fontColor="brown", $borderColor="gold")
13+
UpdateContainerBoundaryStyle($type="module", $legendText="module boundary")
14+
15+
16+
Container_Boundary(fastcan, "fastcan", $descr="A library for fast feature engineering and data preprocessing"){
17+
Component(cancorr_fast, "cancorr_fast", $tags="cython", $descr="Fast canonical correlation based forward search")
18+
Component(FastCan, "FastCan", $tags="python", $descr="Feature selector")
19+
Component(minibatch, "minibatch", $tags="python", $descr="Prunes samples in batch-wise")
20+
Component(refine, "refine", $tags="python", $descr="Refines selection of FastCan")
21+
22+
23+
Rel(FastCan, cancorr_fast, "Sends features to", "arrays")
24+
Rel(minibatch, cancorr_fast, "Sends samples to", "arrays")
25+
Rel(FastCan, refine, "Sends selected features to", "arrays")
26+
Rel(refine, cancorr_fast, "Sends features to", "arrays")
27+
}
28+
29+
Container_Boundary(narx, "narx", $descr="A submodule for NARX modelling"){
30+
Component(make_narx, "make_narx", $tags="python", $descr="Builder for NARX model instances")
31+
Component(narx_fast, "narx_fast", $tags="cython", $descr="Fast computation of gradient and prediction for NARX models")
32+
Component(NARX, "NARX", $tags="python", $descr="NARX model")
33+
Component(time_shift, "time_shift", $tags="python", $descr="Transforming time-series to time-shifted features")
34+
Component(poly, "poly", $tags="python", $descr="Nonlinearises features with polynomial basis functions")
35+
' Component(tp2fd, "tp2fd", $tags="python", $descr="Converts time_shift ids and poly ids to feat ids and delay ids")
36+
Component(print_narx, "print_narx", $tags="python", $descr="Prints NARX model summary")
37+
38+
Rel(NARX, print_narx, "Sends NARX model to", "NARX model")
39+
' Rel(make_narx, poly, "Makes polynomial features using", "unique id numbers")
40+
Rel(make_narx, time_shift, "Sends time series to", "arrays")
41+
' Rel(make_narx, tp2fd, "Sends time_shift ids and poly ids to", "unique id numbers")
42+
Rel(time_shift, poly, "Sends time-shifted features to", "arrays")
43+
Rel(poly, FastCan, "Sends polynomial features to", "arrays")
44+
' Rel(tp2fd, NARX, "Sends feat ids and delay ids to", "unique id numbers")
45+
Rel(NARX, narx_fast, "Sends initial conditions of inputs, prediction and gradients to", "fit, predict")
46+
47+
}
48+
49+
Person(person, "User", $descr="A data scientist or developer using NumPy, SciPy, and scikit-learn")
50+
ContainerDb(output, "fastcan output", $tags="db", $techn="indices", $descr="Selected indices of features or samples")
51+
ContainerDb(input, "fastcan input", $tags="db", $techn="arrays, allow multi-output", $descr="Input data")
52+
ContainerDb(narx_output, "narx output", $tags="db", $techn="arrays", $descr="Prediction and gradients of NARX model")
53+
ContainerDb(narx_input, "narx input", $tags="db", $techn="arrays, allow nan, allow multi-output", $descr="Time-series data")
54+
55+
Rel(input, FastCan, "Sends features to", "arrays")
56+
Rel(input, minibatch, "Sends samples to", "arrays")
57+
Rel(narx_input, make_narx, "Sends time series to", "arrays")
58+
Rel(narx_input, NARX, "Sends time series to", "arrays")
59+
60+
Rel(cancorr_fast, output, "Sends selected indices to", "indices")
61+
Rel(output, refine, "Sends selected indices to", "indices")
62+
Rel(narx_fast, narx_output, "Sends prediction and gradients to", "arrays")
63+
Rel(output, NARX, "Sends selected polynomial features to", "indices")
64+
65+
Rel(person, input, "Processes arrays using", "NumPy, scikit-learn pipeline")
66+
Rel(person, narx_input, "Processes time series using", "NumPy, scikit-learn pipeline")
67+
68+
Container(optimizer, "SciPy Optimiser", "module", $tags="module", $descr="Minimises objective functions using prediction errors and gradients")
69+
Rel(narx_output, optimizer, "Sends prediction and gradients to", "arrays")
70+
Rel(optimizer, NARX, "Updates coefficients for", "arrays")
71+
72+
SHOW_LEGEND()
73+
@enduml

doc/index.rst

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,11 @@
99

1010
.. include:: ../README.rst
1111

12+
Architecture Diagram
13+
--------------------
1214

15+
.. uml:: diagram.puml
16+
:align: center
1317

1418
API Reference
1519
-------------
@@ -49,7 +53,7 @@ Useful Links
4953
API Compatibility
5054
-----------------
5155

52-
The API of this package is align with scikit-learn.
56+
The API of this library is align with scikit-learn.
5357

5458
.. |sklearn| image:: images/scikit-learn-logo-notext.png
5559
:width: 100pt

pixi.lock

Lines changed: 16 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)