Files
python-control/pr430-numpy119delete.patch

30 lines
1.1 KiB
Diff

From 1c91dce12d054b0edf095172970cf64e9d9e7f6a Mon Sep 17 00:00:00 2001
From: bnavigator <code@bnavigator.de>
Date: Thu, 9 Jul 2020 20:10:04 +0200
Subject: [PATCH] only call np.delete with actual removal
---
control/iosys.py | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/control/iosys.py b/control/iosys.py
index 908f407..e2bdb29 100644
--- a/control/iosys.py
+++ b/control/iosys.py
@@ -1643,8 +1643,10 @@ def find_eqpt(sys, x0, u0=[], y0=None, t=0, params={},
# and were processed above.
# Get the states and inputs that were not listed as fixed
- state_vars = np.delete(np.array(range(nstates)), ix)
- input_vars = np.delete(np.array(range(ninputs)), iu)
+ state_vars = (range(nstates) if not len(ix)
+ else np.delete(np.array(range(nstates)), ix))
+ input_vars = (range(ninputs) if not len(iu)
+ else np.delete(np.array(range(ninputs)), iu))
# Set the outputs and derivs that will serve as constraints
output_vars = np.array(iy)
--
2.27.0