From ca4ffe230b841ded0f69cecad49e3a2c87cc8dd3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9F=D0=B5=D1=82=D1=83=D1=88=D0=BA=D0=BE=D0=B2=20=D0=90?= =?UTF-8?q?=2E?= <96879250+marko1olo@users.noreply.github.com> Date: Wed, 29 Jul 2026 23:53:11 +0400 Subject: [PATCH 1/6] docs: update unique custom license with maintainer & AI welcome (python-control (Marko1olo Custom Fork License)) --- LICENSE | 53 +++++++++++++++++++++-------------------------------- 1 file changed, 21 insertions(+), 32 deletions(-) diff --git a/LICENSE b/LICENSE index fbfc42c67..deef49243 100644 --- a/LICENSE +++ b/LICENSE @@ -1,32 +1,21 @@ -Copyright (c) 2009-2016 by California Institute of Technology -Copyright (c) 2012 by Delft University of Technology -Copyright (c) 2016-2024 by python-control developers -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -3. Neither the name of the copyright holder(s) nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -COPYRIGHT HOLDERS OR THE CONTRIBUTORS BE LIABLE FOR ANY DIRECT, -INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. +# python-control (Marko1olo Custom Fork License) + +**Copyright (c) 2026 Адольф Петушков** + +--- + +Кастомный открытый форк репозитория marko1olo/python-control. Модификации внесены для оптимизации и улучшения работы. +--- + +### 🤝 Мейнтейнеры, Контрибьюторы и ИИ (Maintainers & AI Welcome) +* **Приветствуем всех контрибьюторов:** Мы искренне рады пул-реквестам (PR), багрепортам, оптимизациям и помощи в развитии проекта от любых мейнтейнеров и разработчиков! +* **Разрешение на обучение ИИ:** Код, документация и архитектура открыты для исследования, обучения нейросетей, агентных ИИ-инструментов (Claude, Codex, Antigravity, LLM) и машинного обучения. Пользуйтесь на здоровье! + + +--- + +### 📜 Official MIT Terms / Standard Disclaimer + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, subject to the condition that the above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED. \ No newline at end of file From 2743c6e023f2435f0b8676694ab89ef158c7e613 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9F=D0=B5=D1=82=D1=83=D1=88=D0=BA=D0=BE=D0=B2=20=D0=90?= =?UTF-8?q?=2E?= <96879250+marko1olo@users.noreply.github.com> Date: Wed, 29 Jul 2026 23:54:52 +0400 Subject: [PATCH 2/6] docs: upgrade to 100% Dual Bilingual (English + Russian) License --- LICENSE | 40 ++++++++++++++++++++++++++++++++++------ 1 file changed, 34 insertions(+), 6 deletions(-) diff --git a/LICENSE b/LICENSE index deef49243..04b372940 100644 --- a/LICENSE +++ b/LICENSE @@ -1,21 +1,49 @@ # python-control (Marko1olo Custom Fork License) -**Copyright (c) 2026 Адольф Петушков** +**Copyright (c) 2026 Адольф Петушков / Adolf Petushkov** --- -Кастомный открытый форк репозитория marko1olo/python-control. Модификации внесены для оптимизации и улучшения работы. +## 🇷🇺 Русская Версия (Russian Version) + +Кастомный открытый форк репозитория marko1olo/python-control. Модификации внесены для оптимизации. --- ### 🤝 Мейнтейнеры, Контрибьюторы и ИИ (Maintainers & AI Welcome) * **Приветствуем всех контрибьюторов:** Мы искренне рады пул-реквестам (PR), багрепортам, оптимизациям и помощи в развитии проекта от любых мейнтейнеров и разработчиков! -* **Разрешение на обучение ИИ:** Код, документация и архитектура открыты для исследования, обучения нейросетей, агентных ИИ-инструментов (Claude, Codex, Antigravity, LLM) и машинного обучения. Пользуйтесь на здоровье! +* **Разрешение на обучение ИИ:** Код, документация и архитектура открыты для исследования, обучения нейросетей, агентных ИИ-инструментов (Claude, Codex, Antigravity, LLM) и машинного обучения. + + +--- +## 🇬🇧 English Version +Custom open fork of repository marko1olo/python-control. Modifications created for performance and features. --- -### 📜 Official MIT Terms / Standard Disclaimer +### 🤝 Maintainers, Contributors & AI Welcome +* **Contributors Welcome:** We sincerely welcome pull requests (PRs), bug reports, optimizations, and contributions from any maintainer or developer! +* **AI Training & Agent Access:** Code, documentation, and architecture are open for research, neural network training, agentic AI tools (Claude Code, Codex, Antigravity, LLMs), and machine learning. + -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, subject to the condition that the above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. +--- -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED. \ No newline at end of file +### 📜 Standard Legal Terms & Disclaimer / Официальные Условия + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. From 2c6ee694ecc205672894f3bef56280aa17de388b Mon Sep 17 00:00:00 2001 From: marko1olo Date: Fri, 14 Aug 2026 18:35:24 +0400 Subject: [PATCH 3/6] fix(xferfcn): support complex dtypes with negligible imaginary parts and safe polynomial stringification (fixes #1188) --- control/tests/xferfcn_test.py | 15 +++++++++++++++ control/xferfcn.py | 11 ++++++++--- 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/control/tests/xferfcn_test.py b/control/tests/xferfcn_test.py index a9be040ab..89ceb9490 100644 --- a/control/tests/xferfcn_test.py +++ b/control/tests/xferfcn_test.py @@ -28,6 +28,21 @@ class TestXferFcn: # Tests for raising exceptions. + def test_zpk_complex_dtypes(self): + """Test zpk with complex64 and complex128 zeros/poles (Issue #1188).""" + P = ct.rss(5) + q1 = ct.zpk(zeros=P.zeros().astype(np.complex64), + poles=P.poles().astype(np.complex64), + gain=1, dt=0) + assert isinstance(q1, ct.TransferFunction) + assert "s^5" in str(q1) + + q2 = ct.zpk(zeros=P.zeros().astype(np.complex128), + poles=P.poles().astype(np.complex128), + gain=1, dt=0) + assert isinstance(q2, ct.TransferFunction) + assert "s^5" in str(q2) + def test_constructor_bad_input_type(self): """Give the constructor invalid input types.""" # Single argument of the wrong type diff --git a/control/xferfcn.py b/control/xferfcn.py index ad9ea0554..90bdc885c 100644 --- a/control/xferfcn.py +++ b/control/xferfcn.py @@ -1378,9 +1378,8 @@ def _tf_polynomial_to_string(coeffs, var='s'): """Convert a transfer function polynomial to a string.""" thestr = "0" - # Apply NumPy formatting - with np.printoptions(threshold=sys.maxsize): - coeffs = eval(repr(coeffs)) + # Convert coefficients to Python list of floats/numbers + coeffs = np.asarray(coeffs).tolist() # Compute the number of coefficients N = len(coeffs) - 1 @@ -2015,6 +2014,12 @@ def _clean_part(data, name=""): # Check for coefficients that are ints and convert to floats for i in range(out.shape[0]): for j in range(out.shape[1]): + if np.iscomplexobj(out[i, j]): + if np.allclose(np.imag(out[i, j]), 0.0, atol=1e-10): + out[i, j] = np.real(out[i, j]).astype(float) + else: + raise TypeError( + f"unsupported data type: {type(out[i, j][0])}") for k in range(len(out[i, j])): if isinstance(out[i, j][k], (int, np.integer)): out[i, j][k] = float(out[i, j][k]) From 4fb1bedf0ffbefdd20d4ca0029d6294d5b10db07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9F=D0=B5=D1=82=D1=83=D1=88=D0=BA=D0=BE=D0=B2=20=D0=90?= =?UTF-8?q?=2E?= <96879250+marko1olo@users.noreply.github.com> Date: Sun, 16 Aug 2026 16:17:18 +0000 Subject: [PATCH 4/6] chore: restore upstream LICENSE --- LICENSE | 81 +++++++++++++++++++++++---------------------------------- 1 file changed, 32 insertions(+), 49 deletions(-) diff --git a/LICENSE b/LICENSE index 04b372940..fbfc42c67 100644 --- a/LICENSE +++ b/LICENSE @@ -1,49 +1,32 @@ -# python-control (Marko1olo Custom Fork License) - -**Copyright (c) 2026 Адольф Петушков / Adolf Petushkov** - ---- - -## 🇷🇺 Русская Версия (Russian Version) - -Кастомный открытый форк репозитория marko1olo/python-control. Модификации внесены для оптимизации. ---- - -### 🤝 Мейнтейнеры, Контрибьюторы и ИИ (Maintainers & AI Welcome) -* **Приветствуем всех контрибьюторов:** Мы искренне рады пул-реквестам (PR), багрепортам, оптимизациям и помощи в развитии проекта от любых мейнтейнеров и разработчиков! -* **Разрешение на обучение ИИ:** Код, документация и архитектура открыты для исследования, обучения нейросетей, агентных ИИ-инструментов (Claude, Codex, Antigravity, LLM) и машинного обучения. - - ---- - -## 🇬🇧 English Version - -Custom open fork of repository marko1olo/python-control. Modifications created for performance and features. ---- - -### 🤝 Maintainers, Contributors & AI Welcome -* **Contributors Welcome:** We sincerely welcome pull requests (PRs), bug reports, optimizations, and contributions from any maintainer or developer! -* **AI Training & Agent Access:** Code, documentation, and architecture are open for research, neural network training, agentic AI tools (Claude Code, Codex, Antigravity, LLMs), and machine learning. - - ---- - -### 📜 Standard Legal Terms & Disclaimer / Официальные Условия - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. +Copyright (c) 2009-2016 by California Institute of Technology +Copyright (c) 2012 by Delft University of Technology +Copyright (c) 2016-2024 by python-control developers +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +3. Neither the name of the copyright holder(s) nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT HOLDERS OR THE CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. From 1dd5a87c4f605ab78f4802296ff8ac140698a67c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9F=D0=B5=D1=82=D1=83=D1=88=D0=BA=D0=BE=D0=B2=20=D0=90?= =?UTF-8?q?=2E?= <96879250+marko1olo@users.noreply.github.com> Date: Sun, 16 Aug 2026 16:17:21 +0000 Subject: [PATCH 5/6] fix(xferfcn): preserve np.printoptions formatting in _tf_polynomial_to_string --- control/xferfcn.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/control/xferfcn.py b/control/xferfcn.py index 90bdc885c..24e4d4dda 100644 --- a/control/xferfcn.py +++ b/control/xferfcn.py @@ -1378,8 +1378,9 @@ def _tf_polynomial_to_string(coeffs, var='s'): """Convert a transfer function polynomial to a string.""" thestr = "0" - # Convert coefficients to Python list of floats/numbers - coeffs = np.asarray(coeffs).tolist() + # Apply NumPy formatting + with np.printoptions(threshold=sys.maxsize): + coeffs = eval(repr(coeffs)) # Compute the number of coefficients N = len(coeffs) - 1 From 33fc0e47e7d41fcb5e84814fb7c1c92e23e810eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9F=D0=B5=D1=82=D1=83=D1=88=D0=BA=D0=BE=D0=B2=20=D0=90?= =?UTF-8?q?=2E?= <96879250+marko1olo@users.noreply.github.com> Date: Sun, 16 Aug 2026 16:26:18 +0000 Subject: [PATCH 6/6] fix(xferfcn): cast coeffs to float before eval(repr(coeffs)) for float32/complex64 compatibility --- control/xferfcn.py | 1 + 1 file changed, 1 insertion(+) diff --git a/control/xferfcn.py b/control/xferfcn.py index 24e4d4dda..fa792643b 100644 --- a/control/xferfcn.py +++ b/control/xferfcn.py @@ -1379,6 +1379,7 @@ def _tf_polynomial_to_string(coeffs, var='s'): thestr = "0" # Apply NumPy formatting + coeffs = np.asarray(coeffs, dtype=float) with np.printoptions(threshold=sys.maxsize): coeffs = eval(repr(coeffs))