motulator-multiphase 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. motulator_multiphase-0.1.0/.gitignore +19 -0
  2. motulator_multiphase-0.1.0/LICENSE +21 -0
  3. motulator_multiphase-0.1.0/PKG-INFO +130 -0
  4. motulator_multiphase-0.1.0/README.md +93 -0
  5. motulator_multiphase-0.1.0/docs/Makefile +20 -0
  6. motulator_multiphase-0.1.0/docs/_templates/autoapi/index.rst +13 -0
  7. motulator_multiphase-0.1.0/docs/_templates/autoapi/python/attribute.rst +1 -0
  8. motulator_multiphase-0.1.0/docs/_templates/autoapi/python/class.rst +104 -0
  9. motulator_multiphase-0.1.0/docs/_templates/autoapi/python/data.rst +38 -0
  10. motulator_multiphase-0.1.0/docs/_templates/autoapi/python/exception.rst +1 -0
  11. motulator_multiphase-0.1.0/docs/_templates/autoapi/python/function.rst +21 -0
  12. motulator_multiphase-0.1.0/docs/_templates/autoapi/python/method.rst +21 -0
  13. motulator_multiphase-0.1.0/docs/_templates/autoapi/python/module.rst +170 -0
  14. motulator_multiphase-0.1.0/docs/_templates/autoapi/python/package.rst +1 -0
  15. motulator_multiphase-0.1.0/docs/_templates/autoapi/python/property.rst +20 -0
  16. motulator_multiphase-0.1.0/docs/make.bat +35 -0
  17. motulator_multiphase-0.1.0/docs/source/_static/css/custom.css +6 -0
  18. motulator_multiphase-0.1.0/docs/source/bibliography.md +4 -0
  19. motulator_multiphase-0.1.0/docs/source/conf.py +152 -0
  20. motulator_multiphase-0.1.0/docs/source/control.md +76 -0
  21. motulator_multiphase-0.1.0/docs/source/index.md +49 -0
  22. motulator_multiphase-0.1.0/docs/source/installation.md +51 -0
  23. motulator_multiphase-0.1.0/docs/source/model.md +119 -0
  24. motulator_multiphase-0.1.0/docs/source/refs.bib +23 -0
  25. motulator_multiphase-0.1.0/docs/source/usage.md +40 -0
  26. motulator_multiphase-0.1.0/examples/README.txt +8 -0
  27. motulator_multiphase-0.1.0/examples/plot_1kw_triple_three_phase_spmsm_cvc.py +81 -0
  28. motulator_multiphase-0.1.0/examples/plot_4kw_dual_three_phase_ipmsm_fvc.py +76 -0
  29. motulator_multiphase-0.1.0/motulator_multiphase/__init__.py +20 -0
  30. motulator_multiphase-0.1.0/motulator_multiphase/_helpers.py +23 -0
  31. motulator_multiphase-0.1.0/motulator_multiphase/control.py +452 -0
  32. motulator_multiphase-0.1.0/motulator_multiphase/model.py +503 -0
  33. motulator_multiphase-0.1.0/motulator_multiphase/py.typed +0 -0
  34. motulator_multiphase-0.1.0/motulator_multiphase/utils.py +297 -0
  35. motulator_multiphase-0.1.0/pyproject.toml +100 -0
  36. motulator_multiphase-0.1.0/tests/test_multiphase.py +334 -0
@@ -0,0 +1,19 @@
1
+ # Byte-compiled files
2
+ __pycache__/
3
+ *.pyc
4
+
5
+ # Distribution
6
+ *.egg-info/
7
+ dist/
8
+
9
+ # Environments
10
+ .venv
11
+
12
+ # macOS specific
13
+ .DS_Store
14
+
15
+ # Sphinx documentation
16
+ docs/build/
17
+ docs/source/autoapi/
18
+ docs/source/examples/
19
+ docs/source/sg_execution_times.rst
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Aalto Electric Drives
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,130 @@
1
+ Metadata-Version: 2.5
2
+ Name: motulator-multiphase
3
+ Version: 0.1.0
4
+ Summary: Multi-three-phase machine drives for motulator
5
+ Project-URL: Homepage, https://github.com/Aalto-Electric-Drives/motulator-multiphase
6
+ Project-URL: Documentation, https://aalto-electric-drives.github.io/motulator-multiphase/
7
+ Author-email: Marko Hinkkanen <marko.hinkkanen@aalto.fi>
8
+ License-Expression: MIT
9
+ License-File: LICENSE
10
+ Keywords: control,converter,dual-three-phase,electric,machine,motor,multiphase,simulation
11
+ Classifier: License :: OSI Approved :: MIT License
12
+ Classifier: Operating System :: OS Independent
13
+ Classifier: Programming Language :: Python
14
+ Classifier: Programming Language :: Python :: 3.12
15
+ Classifier: Programming Language :: Python :: 3.13
16
+ Classifier: Programming Language :: Python :: 3.14
17
+ Classifier: Typing :: Typed
18
+ Requires-Python: >=3.12
19
+ Requires-Dist: matplotlib
20
+ Requires-Dist: motulator<0.24,>=0.23.0
21
+ Requires-Dist: numpy
22
+ Provides-Extra: dev
23
+ Requires-Dist: pre-commit; extra == 'dev'
24
+ Requires-Dist: pyright; extra == 'dev'
25
+ Requires-Dist: pytest; extra == 'dev'
26
+ Requires-Dist: ruff; extra == 'dev'
27
+ Provides-Extra: doc
28
+ Requires-Dist: myst-parser; extra == 'doc'
29
+ Requires-Dist: numpydoc; extra == 'doc'
30
+ Requires-Dist: sphinx; extra == 'doc'
31
+ Requires-Dist: sphinx-autoapi; extra == 'doc'
32
+ Requires-Dist: sphinx-book-theme; extra == 'doc'
33
+ Requires-Dist: sphinx-copybutton; extra == 'doc'
34
+ Requires-Dist: sphinx-gallery; extra == 'doc'
35
+ Requires-Dist: sphinxcontrib-bibtex; extra == 'doc'
36
+ Description-Content-Type: text/markdown
37
+
38
+ # motulator-multiphase
39
+
40
+ **Multi-three-phase machine drives for [motulator](https://github.com/Aalto-Electric-Drives/motulator)**
41
+
42
+ Documentation: https://aalto-electric-drives.github.io/motulator-multiphase/
43
+
44
+ This package extends *motulator* with models and control of machines having *n* three-phase winding sets (e.g., dual-three-phase machines), each set supplied by its own converter. The models and the control are based on the decoupled multi-stator (DMS) transformation [[1]](#references), which maps the sets to the common mode (CM) and *n* − 1 differential modes (DMs). The CM is equivalent to a three-phase machine whose sets are connected in parallel, so the machine models and vector controllers of *motulator* (synchronous and induction machines, flux-vector and current-vector control, sensored and sensorless) are reused for it. The DMs are resistive-inductive circuits, controlled by complex-vector PI current controllers, and the current sharing between the sets can be changed during operation.
45
+
46
+ ## Installation
47
+
48
+ Install the package in a [virtual environment](https://packaging.python.org/en/latest/guides/installing-using-pip-and-virtual-environments/) (*motulator* is installed as a dependency). On Linux and macOS:
49
+
50
+ ```bash
51
+ python3 -m venv .venv
52
+ source .venv/bin/activate
53
+ pip install motulator-multiphase
54
+ ```
55
+
56
+ On Windows, the environment is created and activated with `py -m venv .venv` and `.venv\Scripts\activate`.
57
+
58
+ For development, clone the repository and install the package with `pip install -e ".[dev]"`.
59
+
60
+ ## Usage
61
+
62
+ A sensorless flux-vector-controlled dual-three-phase IPMSM drive, whose sets are displaced by 30°:
63
+
64
+ ```python
65
+ from math import pi
66
+
67
+ import motulator.drive.control.sm as sm_control
68
+ from motulator_multiphase import control, model, utils
69
+
70
+ # System model: the parameters describe one three-phase set, when both sets carry
71
+ # equal currents, and L_ls is the leakage inductance not coupled to the other set
72
+ par = model.SynchronousMachinePars(n_p=3, R_s=3.6, L_d=0.036, L_q=0.051, psi_f=0.545)
73
+ machine = model.MultiThreePhaseMachine(par, L_ls=0.005, n_sets=2)
74
+ converter = model.MultiThreePhaseConverter(u_dc=540, n_sets=2)
75
+ mdl = model.MultiThreePhaseDrive(machine, model.MechanicalSystem(J=0.03), converter)
76
+
77
+ # Control system: the flux-vector controller of motulator for the CM, parametrized
78
+ # with the parallel-connected equivalent machine, and a current controller for the DM
79
+ est_par = utils.to_parallel(par, 2)
80
+ cfg = sm_control.FluxVectorControllerCfg(i_s_max=18, sensorless=True)
81
+ vector_ctrl = sm_control.FluxVectorController(est_par, cfg)
82
+ dm_ctrl = control.DifferentialModeController(L_ls=0.005, n_sets=2)
83
+ speed_ctrl = sm_control.SpeedController(J=0.03, alpha_s=2 * pi * 4)
84
+ ctrl = control.MultiThreePhaseControlSystem(vector_ctrl, dm_ctrl, speed_ctrl)
85
+
86
+ # Speed reference, load torque, and current sharing (75% in the first set at the end)
87
+ ctrl.set_speed_ref(lambda t: (t > 0.2) * 150)
88
+ mdl.mechanics.set_external_load_torque(lambda t: (t > 0.8) * 28)
89
+ ctrl.set_current_sharing(lambda t: [1.5, 0.5] if t > 1.2 else [1.0, 1.0])
90
+
91
+ res = model.Simulation(mdl, ctrl).simulate(t_stop=1.6)
92
+ utils.plot(res) # CM quantities, the current being the sum of the set currents
93
+ utils.plot_sets(res) # Set currents and DM currents
94
+ ```
95
+
96
+ The sets are displaced by 60°/*n* by default (30° for a dual-three-phase machine); other arrangements are given with `theta_sets`. Complete examples are in the [example gallery](https://aalto-electric-drives.github.io/motulator-multiphase/examples/index.html).
97
+
98
+ ## Scope
99
+
100
+ - Identical sets, any number *n* ≥ 1; a drive with one set equals the three-phase drive of *motulator*.
101
+ - The saturated machine models and GradNet flux maps of *motulator* can be used for the CM, see `utils.to_parallel`.
102
+ - Each DM is a resistive-inductive circuit of the stator resistance and the leakage inductance of a set; it is not saturated and produces no torque.
103
+ - Gate blocking (standby control) is not supported.
104
+
105
+ ## References
106
+
107
+ 1. Rubino, Dordevic, Armando, Bojoi, Levi, "A novel matrix transformation for decoupled control of modular multiphase PMSM drives," IEEE Trans. Power Electron., 2021, https://doi.org/10.1109/TPEL.2020.3043083
108
+
109
+ ## Contributors
110
+
111
+ <!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
112
+
113
+ <!-- prettier-ignore-start -->
114
+
115
+ <!-- markdownlint-disable -->
116
+
117
+ <table>
118
+ <tbody>
119
+ <tr>
120
+ <td align="center" valign="top" width="14.28%"><a href="https://github.com/SandroRubino"><img src="https://avatars.githubusercontent.com/u/346736963?v=4?s=50" width="50px;" alt="Sandro Rubino"/><br /><sub><b>Sandro Rubino</b></sub></a><br /><a href="#ideas-SandroRubino" title="Ideas, Planning, & Feedback">🤔</a> <a href="#research-SandroRubino" title="Research">🔬</a></td>
121
+ <td align="center" valign="top" width="14.28%"><a href="https://research.aalto.fi/en/persons/marko-hinkkanen"><img src="https://avatars.githubusercontent.com/u/76600872?v=4?s=50" width="50px;" alt="Marko Hinkkanen"/><br /><sub><b>Marko Hinkkanen</b></sub></a><br /><a href="https://github.com/Aalto-Electric-Drives/motulator-multiphase/commits?author=mhinkkan" title="Code">💻</a> <a href="#example-mhinkkan" title="Examples">💡</a></td>
122
+ </tr>
123
+ </tbody>
124
+ </table>
125
+
126
+ <!-- markdownlint-restore -->
127
+
128
+ <!-- prettier-ignore-end -->
129
+
130
+ <!-- ALL-CONTRIBUTORS-LIST:END -->
@@ -0,0 +1,93 @@
1
+ # motulator-multiphase
2
+
3
+ **Multi-three-phase machine drives for [motulator](https://github.com/Aalto-Electric-Drives/motulator)**
4
+
5
+ Documentation: https://aalto-electric-drives.github.io/motulator-multiphase/
6
+
7
+ This package extends *motulator* with models and control of machines having *n* three-phase winding sets (e.g., dual-three-phase machines), each set supplied by its own converter. The models and the control are based on the decoupled multi-stator (DMS) transformation [[1]](#references), which maps the sets to the common mode (CM) and *n* − 1 differential modes (DMs). The CM is equivalent to a three-phase machine whose sets are connected in parallel, so the machine models and vector controllers of *motulator* (synchronous and induction machines, flux-vector and current-vector control, sensored and sensorless) are reused for it. The DMs are resistive-inductive circuits, controlled by complex-vector PI current controllers, and the current sharing between the sets can be changed during operation.
8
+
9
+ ## Installation
10
+
11
+ Install the package in a [virtual environment](https://packaging.python.org/en/latest/guides/installing-using-pip-and-virtual-environments/) (*motulator* is installed as a dependency). On Linux and macOS:
12
+
13
+ ```bash
14
+ python3 -m venv .venv
15
+ source .venv/bin/activate
16
+ pip install motulator-multiphase
17
+ ```
18
+
19
+ On Windows, the environment is created and activated with `py -m venv .venv` and `.venv\Scripts\activate`.
20
+
21
+ For development, clone the repository and install the package with `pip install -e ".[dev]"`.
22
+
23
+ ## Usage
24
+
25
+ A sensorless flux-vector-controlled dual-three-phase IPMSM drive, whose sets are displaced by 30°:
26
+
27
+ ```python
28
+ from math import pi
29
+
30
+ import motulator.drive.control.sm as sm_control
31
+ from motulator_multiphase import control, model, utils
32
+
33
+ # System model: the parameters describe one three-phase set, when both sets carry
34
+ # equal currents, and L_ls is the leakage inductance not coupled to the other set
35
+ par = model.SynchronousMachinePars(n_p=3, R_s=3.6, L_d=0.036, L_q=0.051, psi_f=0.545)
36
+ machine = model.MultiThreePhaseMachine(par, L_ls=0.005, n_sets=2)
37
+ converter = model.MultiThreePhaseConverter(u_dc=540, n_sets=2)
38
+ mdl = model.MultiThreePhaseDrive(machine, model.MechanicalSystem(J=0.03), converter)
39
+
40
+ # Control system: the flux-vector controller of motulator for the CM, parametrized
41
+ # with the parallel-connected equivalent machine, and a current controller for the DM
42
+ est_par = utils.to_parallel(par, 2)
43
+ cfg = sm_control.FluxVectorControllerCfg(i_s_max=18, sensorless=True)
44
+ vector_ctrl = sm_control.FluxVectorController(est_par, cfg)
45
+ dm_ctrl = control.DifferentialModeController(L_ls=0.005, n_sets=2)
46
+ speed_ctrl = sm_control.SpeedController(J=0.03, alpha_s=2 * pi * 4)
47
+ ctrl = control.MultiThreePhaseControlSystem(vector_ctrl, dm_ctrl, speed_ctrl)
48
+
49
+ # Speed reference, load torque, and current sharing (75% in the first set at the end)
50
+ ctrl.set_speed_ref(lambda t: (t > 0.2) * 150)
51
+ mdl.mechanics.set_external_load_torque(lambda t: (t > 0.8) * 28)
52
+ ctrl.set_current_sharing(lambda t: [1.5, 0.5] if t > 1.2 else [1.0, 1.0])
53
+
54
+ res = model.Simulation(mdl, ctrl).simulate(t_stop=1.6)
55
+ utils.plot(res) # CM quantities, the current being the sum of the set currents
56
+ utils.plot_sets(res) # Set currents and DM currents
57
+ ```
58
+
59
+ The sets are displaced by 60°/*n* by default (30° for a dual-three-phase machine); other arrangements are given with `theta_sets`. Complete examples are in the [example gallery](https://aalto-electric-drives.github.io/motulator-multiphase/examples/index.html).
60
+
61
+ ## Scope
62
+
63
+ - Identical sets, any number *n* ≥ 1; a drive with one set equals the three-phase drive of *motulator*.
64
+ - The saturated machine models and GradNet flux maps of *motulator* can be used for the CM, see `utils.to_parallel`.
65
+ - Each DM is a resistive-inductive circuit of the stator resistance and the leakage inductance of a set; it is not saturated and produces no torque.
66
+ - Gate blocking (standby control) is not supported.
67
+
68
+ ## References
69
+
70
+ 1. Rubino, Dordevic, Armando, Bojoi, Levi, "A novel matrix transformation for decoupled control of modular multiphase PMSM drives," IEEE Trans. Power Electron., 2021, https://doi.org/10.1109/TPEL.2020.3043083
71
+
72
+ ## Contributors
73
+
74
+ <!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
75
+
76
+ <!-- prettier-ignore-start -->
77
+
78
+ <!-- markdownlint-disable -->
79
+
80
+ <table>
81
+ <tbody>
82
+ <tr>
83
+ <td align="center" valign="top" width="14.28%"><a href="https://github.com/SandroRubino"><img src="https://avatars.githubusercontent.com/u/346736963?v=4?s=50" width="50px;" alt="Sandro Rubino"/><br /><sub><b>Sandro Rubino</b></sub></a><br /><a href="#ideas-SandroRubino" title="Ideas, Planning, & Feedback">🤔</a> <a href="#research-SandroRubino" title="Research">🔬</a></td>
84
+ <td align="center" valign="top" width="14.28%"><a href="https://research.aalto.fi/en/persons/marko-hinkkanen"><img src="https://avatars.githubusercontent.com/u/76600872?v=4?s=50" width="50px;" alt="Marko Hinkkanen"/><br /><sub><b>Marko Hinkkanen</b></sub></a><br /><a href="https://github.com/Aalto-Electric-Drives/motulator-multiphase/commits?author=mhinkkan" title="Code">💻</a> <a href="#example-mhinkkan" title="Examples">💡</a></td>
85
+ </tr>
86
+ </tbody>
87
+ </table>
88
+
89
+ <!-- markdownlint-restore -->
90
+
91
+ <!-- prettier-ignore-end -->
92
+
93
+ <!-- ALL-CONTRIBUTORS-LIST:END -->
@@ -0,0 +1,20 @@
1
+ # Minimal makefile for Sphinx documentation
2
+ #
3
+
4
+ # You can set these variables from the command line, and also
5
+ # from the environment for the first two.
6
+ SPHINXOPTS ?=
7
+ SPHINXBUILD ?= sphinx-build
8
+ SOURCEDIR = source
9
+ BUILDDIR = build
10
+
11
+ # Put it first so that "make" without argument is like "make help".
12
+ help:
13
+ @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
14
+
15
+ .PHONY: help Makefile
16
+
17
+ # Catch-all target: route all unknown targets to Sphinx using the new
18
+ # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
19
+ %: Makefile
20
+ @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
@@ -0,0 +1,13 @@
1
+ API Reference
2
+ =============
3
+
4
+ This page contains auto-generated API reference documentation [#f1]_.
5
+
6
+ .. toctree::
7
+ :titlesonly:
8
+
9
+ {% for page in pages|selectattr("is_top_level_object") %}
10
+ {{ page.include_path }}
11
+ {% endfor %}
12
+
13
+ .. [#f1] Created with `sphinx-autoapi <https://github.com/readthedocs/sphinx-autoapi>`_
@@ -0,0 +1 @@
1
+ {% extends "python/data.rst" %}
@@ -0,0 +1,104 @@
1
+ {% if obj.display %}
2
+ {% if is_own_page %}
3
+ {{ obj.id }}
4
+ {{ "=" * obj.id | length }}
5
+
6
+ {% endif %}
7
+ {% set visible_children = obj.children|selectattr("display")|list %}
8
+ {% set own_page_children = visible_children|selectattr("type", "in", own_page_types)|list %}
9
+ {% if is_own_page and own_page_children %}
10
+ .. toctree::
11
+ :hidden:
12
+
13
+ {% for child in own_page_children %}
14
+ {{ child.include_path }}
15
+ {% endfor %}
16
+
17
+ {% endif %}
18
+ .. py:{{ obj.type }}:: {% if is_own_page %}{{ obj.id }}{% else %}{{ obj.short_name }}{% endif %}{% if obj.args %}({{ obj.args }}){% endif %}
19
+
20
+ {% for (args, return_annotation) in obj.overloads %}
21
+ {{ " " * (obj.type | length) }} {{ obj.short_name }}{% if args %}({{ args }}){% endif %}
22
+
23
+ {% endfor %}
24
+ {% if obj.bases %}
25
+ {% if "show-inheritance" in autoapi_options %}
26
+
27
+ Bases: {% for base in obj.bases %}{{ base|link_objs }}{% if not loop.last %}, {% endif %}{% endfor %}
28
+ {% endif %}
29
+
30
+
31
+ {% if "show-inheritance-diagram" in autoapi_options and obj.bases != ["object"] %}
32
+ .. autoapi-inheritance-diagram:: {{ obj.obj["full_name"] }}
33
+ :parts: 1
34
+ {% if "private-members" in autoapi_options %}
35
+ :private-bases:
36
+ {% endif %}
37
+
38
+ {% endif %}
39
+ {% endif %}
40
+ {% if obj.docstring %}
41
+
42
+ {{ obj.docstring|indent(3) }}
43
+ {% endif %}
44
+ {% for obj_item in visible_children %}
45
+ {% if obj_item.type not in own_page_types %}
46
+
47
+ {{ obj_item.render()|indent(3) }}
48
+ {% endif %}
49
+ {% endfor %}
50
+ {% if is_own_page and own_page_children %}
51
+ {% set visible_attributes = own_page_children|selectattr("type", "equalto", "attribute")|list %}
52
+ {% if visible_attributes %}
53
+ Attributes
54
+ ----------
55
+
56
+ .. autoapisummary::
57
+
58
+ {% for attribute in visible_attributes %}
59
+ {{ attribute.id }}
60
+ {% endfor %}
61
+
62
+
63
+ {% endif %}
64
+ {% set visible_exceptions = own_page_children|selectattr("type", "equalto", "exception")|list %}
65
+ {% if visible_exceptions %}
66
+ Exceptions
67
+ ----------
68
+
69
+ .. autoapisummary::
70
+
71
+ {% for exception in visible_exceptions %}
72
+ {{ exception.id }}
73
+ {% endfor %}
74
+
75
+
76
+ {% endif %}
77
+ {% set visible_classes = own_page_children|selectattr("type", "equalto", "class")|list %}
78
+ {% if visible_classes %}
79
+ Classes
80
+ -------
81
+
82
+ .. autoapisummary::
83
+
84
+ {% for klass in visible_classes %}
85
+ {{ klass.id }}
86
+ {% endfor %}
87
+
88
+
89
+ {% endif %}
90
+ {% set visible_methods = own_page_children|selectattr("type", "equalto", "method")|list %}
91
+ {% if visible_methods %}
92
+ Methods
93
+ -------
94
+
95
+ .. autoapisummary::
96
+
97
+ {% for method in visible_methods %}
98
+ {{ method.id }}
99
+ {% endfor %}
100
+
101
+
102
+ {% endif %}
103
+ {% endif %}
104
+ {% endif %}
@@ -0,0 +1,38 @@
1
+ {% if obj.display %}
2
+ {% if is_own_page %}
3
+ {{ obj.id }}
4
+ {{ "=" * obj.id | length }}
5
+
6
+ {% endif %}
7
+ .. py:{{ obj.type }}:: {% if is_own_page %}{{ obj.id }}{% else %}{{ obj.name }}{% endif %}
8
+ {% if obj.annotation is not none %}
9
+
10
+ :type: {% if obj.annotation %} {{ obj.annotation }}{% endif %}
11
+ {% endif %}
12
+ {% if obj.value is not none %}
13
+
14
+ {% if obj.value.splitlines()|count > 1 %}
15
+ :value: Multiline-String
16
+
17
+ .. raw:: html
18
+
19
+ <details><summary>Show Value</summary>
20
+
21
+ .. code-block:: python
22
+
23
+ {{ obj.value|indent(width=6,blank=true) }}
24
+
25
+ .. raw:: html
26
+
27
+ </details>
28
+
29
+ {% else %}
30
+ :value: {{ obj.value|truncate(100) }}
31
+ {% endif %}
32
+ {% endif %}
33
+
34
+ {% if obj.docstring %}
35
+
36
+ {{ obj.docstring|indent(3) }}
37
+ {% endif %}
38
+ {% endif %}
@@ -0,0 +1 @@
1
+ {% extends "python/class.rst" %}
@@ -0,0 +1,21 @@
1
+ {% if obj.display %}
2
+ {% if is_own_page %}
3
+ {{ obj.id }}
4
+ {{ "=" * obj.id | length }}
5
+
6
+ {% endif %}
7
+ .. py:function:: {% if is_own_page %}{{ obj.id }}{% else %}{{ obj.short_name }}{% endif %}({{ obj.args }}){% if obj.return_annotation is not none %} -> {{ obj.return_annotation }}{% endif %}
8
+ {% for (args, return_annotation) in obj.overloads %}
9
+
10
+ {%+ if is_own_page %}{{ obj.id }}{% else %}{{ obj.short_name }}{% endif %}({{ args }}){% if return_annotation is not none %} -> {{ return_annotation }}{% endif %}
11
+ {% endfor %}
12
+ {% for property in obj.properties %}
13
+
14
+ :{{ property }}:
15
+ {% endfor %}
16
+
17
+ {% if obj.docstring %}
18
+
19
+ {{ obj.docstring|indent(3) }}
20
+ {% endif %}
21
+ {% endif %}
@@ -0,0 +1,21 @@
1
+ {% if obj.display %}
2
+ {% if is_own_page %}
3
+ {{ obj.id }}
4
+ {{ "=" * obj.id | length }}
5
+
6
+ {% endif %}
7
+ .. py:method:: {% if is_own_page %}{{ obj.id }}{% else %}{{ obj.short_name }}{% endif %}({{ obj.args }}){% if obj.return_annotation is not none %} -> {{ obj.return_annotation }}{% endif %}
8
+ {% for (args, return_annotation) in obj.overloads %}
9
+
10
+ {%+ if is_own_page %}{{ obj.id }}{% else %}{{ obj.short_name }}{% endif %}({{ args }}){% if return_annotation is not none %} -> {{ return_annotation }}{% endif %}
11
+ {% endfor %}
12
+ {% for property in obj.properties %}
13
+
14
+ :{{ property }}:
15
+ {% endfor %}
16
+
17
+ {% if obj.docstring %}
18
+
19
+ {{ obj.docstring|indent(3) }}
20
+ {% endif %}
21
+ {% endif %}
@@ -0,0 +1,170 @@
1
+ {% if obj.display %}
2
+ {% if is_own_page %}
3
+ {{ obj.id }}
4
+ {{ "=" * obj.id|length }}
5
+
6
+ .. py:module:: {{ obj.name }}
7
+
8
+ {% if obj.docstring %}
9
+ .. autoapi-nested-parse::
10
+
11
+ {{ obj.docstring|indent(3) }}
12
+
13
+ {% endif %}
14
+
15
+ {% block subpackages %}
16
+ {% set visible_subpackages = obj.subpackages|selectattr("display")|list %}
17
+ {% if visible_subpackages %}
18
+ Subpackages
19
+ -----------
20
+
21
+ .. toctree::
22
+ :maxdepth: 1
23
+
24
+ {% for subpackage in visible_subpackages %}
25
+ {{ subpackage.include_path }}
26
+ {% endfor %}
27
+
28
+
29
+ {% endif %}
30
+ {% endblock %}
31
+ {% block submodules %}
32
+ {% set visible_submodules = obj.submodules|selectattr("display")|list %}
33
+ {% if visible_submodules %}
34
+ Submodules
35
+ ----------
36
+
37
+ .. toctree::
38
+ :maxdepth: 1
39
+
40
+ {% for submodule in visible_submodules %}
41
+ {{ submodule.include_path }}
42
+ {% endfor %}
43
+
44
+
45
+ {% endif %}
46
+ {% endblock %}
47
+ {% block content %}
48
+ {% set visible_children = obj.children|selectattr("display")|list %}
49
+ {% if visible_children %}
50
+ {% set visible_attributes = visible_children|selectattr("type", "equalto", "data")|list %}
51
+ {% if visible_attributes %}
52
+ {% if "attribute" in own_page_types or "show-module-summary" in autoapi_options %}
53
+ Attributes
54
+ ----------
55
+
56
+ {% if "attribute" in own_page_types %}
57
+ .. toctree::
58
+ :hidden:
59
+
60
+ {% for attribute in visible_attributes %}
61
+ {{ attribute.include_path }}
62
+ {% endfor %}
63
+
64
+ {% endif %}
65
+ .. autoapisummary::
66
+
67
+ {% for attribute in visible_attributes %}
68
+ {{ attribute.id }}
69
+ {% endfor %}
70
+ {% endif %}
71
+
72
+
73
+ {% endif %}
74
+ {% set visible_exceptions = visible_children|selectattr("type", "equalto", "exception")|list %}
75
+ {% if visible_exceptions %}
76
+ {% if "exception" in own_page_types or "show-module-summary" in autoapi_options %}
77
+ Exceptions
78
+ ----------
79
+
80
+ {% if "exception" in own_page_types %}
81
+ .. toctree::
82
+ :hidden:
83
+
84
+ {% for exception in visible_exceptions %}
85
+ {{ exception.include_path }}
86
+ {% endfor %}
87
+
88
+ {% endif %}
89
+ .. autoapisummary::
90
+
91
+ {% for exception in visible_exceptions %}
92
+ {{ exception.id }}
93
+ {% endfor %}
94
+ {% endif %}
95
+
96
+
97
+ {% endif %}
98
+ {% set visible_classes = visible_children|selectattr("type", "equalto", "class")|list %}
99
+ {% if visible_classes %}
100
+ {% if "class" in own_page_types or "show-module-summary" in autoapi_options %}
101
+ Classes
102
+ -------
103
+
104
+ {% if "class" in own_page_types %}
105
+ .. toctree::
106
+ :hidden:
107
+
108
+ {% for klass in visible_classes %}
109
+ {{ klass.include_path }}
110
+ {% endfor %}
111
+
112
+ {% endif %}
113
+ .. autoapisummary::
114
+
115
+ {% for klass in visible_classes %}
116
+ {{ klass.id }}
117
+ {% endfor %}
118
+ {% endif %}
119
+
120
+
121
+ {% endif %}
122
+ {% set visible_functions = visible_children|selectattr("type", "equalto", "function")|list %}
123
+ {% if visible_functions %}
124
+ {% if "function" in own_page_types or "show-module-summary" in autoapi_options %}
125
+ Functions
126
+ ---------
127
+
128
+ {% if "function" in own_page_types %}
129
+ .. toctree::
130
+ :hidden:
131
+
132
+ {% for function in visible_functions %}
133
+ {{ function.include_path }}
134
+ {% endfor %}
135
+
136
+ {% endif %}
137
+ .. autoapisummary::
138
+
139
+ {% for function in visible_functions %}
140
+ {{ function.id }}
141
+ {% endfor %}
142
+ {% endif %}
143
+
144
+
145
+ {% endif %}
146
+ {% set this_page_children = visible_children|rejectattr("type", "in", own_page_types)|list %}
147
+ {% if this_page_children %}
148
+ {{ obj.type|title }} Contents
149
+ {{ "-" * obj.type|length }}---------
150
+
151
+ {% for obj_item in this_page_children %}
152
+ {{ obj_item.render()|indent(0) }}
153
+ {% endfor %}
154
+ {% endif %}
155
+ {% endif %}
156
+ {% endblock %}
157
+ {% else %}
158
+ .. py:module:: {{ obj.name }}
159
+
160
+ {% if obj.docstring %}
161
+ .. autoapi-nested-parse::
162
+
163
+ {{ obj.docstring|indent(6) }}
164
+
165
+ {% endif %}
166
+ {% for obj_item in visible_children %}
167
+ {{ obj_item.render()|indent(3) }}
168
+ {% endfor %}
169
+ {% endif %}
170
+ {% endif %}
@@ -0,0 +1 @@
1
+ {% extends "python/module.rst" %}