FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

fix(xferfcn): preserve np.printoptions formatting in _tf_polynomial_t… · python-control/python-control@1dd5a87 · GitHub

Commit 1dd5a87

Browse files
Петушков А.
committed
fix(xferfcn): preserve np.printoptions formatting in _tf_polynomial_to_string
1 parent 4fb1bed commit 1dd5a87

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

‎control/xferfcn.py‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1378,8 +1378,9 @@ def _tf_polynomial_to_string(coeffs, var='s'):
13781378
"""Convert a transfer function polynomial to a string."""
13791379
thestr = "0"
13801380

1381-
# Convert coefficients to Python list of floats/numbers
1382-
coeffs = np.asarray(coeffs).tolist()
1381+
# Apply NumPy formatting
1382+
with np.printoptions(threshold=sys.maxsize):
1383+
coeffs = eval(repr(coeffs))
13831384

13841385
# Compute the number of coefficients
13851386
N = len(coeffs) - 1

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL