Change warning category for force_type to DeprecationWarning

Closes #156
This commit is contained in:
Sergey B Kirpichev
2024-01-24 12:49:52 +03:00
parent e7e9102cf6
commit 85b16c61ab
2 changed files with 6 additions and 1 deletions
+2 -1
View File
@@ -285,7 +285,8 @@ class _matrix:
" properly anyway. If you want to force floating-point or"
" interval computations, use the respective methods from `fp`"
" or `mp` instead, e.g., `fp.matrix()` or `iv.matrix()`."
" If you want to truncate values to integer, use .apply(int) instead.")
" If you want to truncate values to integer, use .apply(int) instead.",
DeprecationWarning)
if isinstance(args[0], (list, tuple)):
if isinstance(args[0][0], (list, tuple)):
# interpret nested list as matrix
+4
View File
@@ -251,3 +251,7 @@ def test_interval_matrix_mult_bug():
assert mp.mpf('1.00000000000001998401444325291756783368705994138804689654') in C[0, 0]
# the following caused an error before the bug was fixed
assert iv.matrix(mp.eye(2)) * (iv.ones(2) + mpi(1, 2)) == iv.matrix([[mpi(2, 3), mpi(2, 3)], [mpi(2, 3), mpi(2, 3)]])
def test_issue_156():
with pytest.deprecated_call():
matrix([[1, 2], [3, 4]], force_type=float)