Skip to content

Commit

Permalink
update warnign messages
Browse files Browse the repository at this point in the history
  • Loading branch information
A. Zolanvari authored and A. Zolanvari committed Aug 13, 2024
1 parent fe1bf1e commit 3791311
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Test/warning_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
>>> from pycm.pycm_util import deprecated
>>> from pytest import warns
>>> large_cm = ConfusionMatrix(list(range(10)) + [2, 3, 5], list(range(10)) + [1, 7, 2])
>>> with warns(RuntimeWarning, match='The confusion matrix is a high dimension matrix'):
>>> with warns(RuntimeWarning, match='Confusion matrix is high-dimensional and may not display properly. Consider using the `sparse` flag in printing functions, or save it as a CSV file for better visualization.'):
... large_cm.print_matrix()
Predict 0 1 2 3 4 5 6 7 8 9
Actual
Expand All @@ -28,7 +28,7 @@
<BLANKLINE>
9 0 0 0 0 0 0 0 0 0 1
<BLANKLINE>
>>> with warns(RuntimeWarning, match='The confusion matrix is a high dimension matrix'):
>>> with warns(RuntimeWarning, match='Confusion matrix is high-dimensional and may not display properly. Consider using the `sparse` flag in printing functions, or save it as a CSV file for better visualization.'):
... large_cm.print_normalized_matrix()
Predict 0 1 2 3 4 5 6 7 8 9
Actual
Expand All @@ -52,7 +52,7 @@
<BLANKLINE>
9 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0
<BLANKLINE>
>>> with warns(RuntimeWarning, match='The confusion matrix is a high dimension matrix'):
>>> with warns(RuntimeWarning, match='Confusion matrix is high-dimensional and may not display properly. Consider using the `sparse` flag in printing functions, or save it as a CSV file for better visualization.'):
... large_cm.stat()
Overall Statistics :
<BLANKLINE>
Expand Down Expand Up @@ -193,7 +193,7 @@
dInd(Distance index) 0.0 0.08333 0.5082 0.5 0.0 0.5 0.0 0.08333 0.0 0.0
sInd(Similarity index) 1.0 0.94107 0.64065 0.64645 1.0 0.64645 1.0 0.94107 1.0 1.0
<BLANKLINE>
>>> with warns(RuntimeWarning, match='The confusion matrix is a high dimension matrix'):
>>> with warns(RuntimeWarning, match='Confusion matrix is high-dimensional and may not display properly. Consider using the `sparse` flag in printing functions, or save it as a CSV file for better visualization.'):
... print(large_cm)
Predict 0 1 2 3 4 5 6 7 8 9
Actual
Expand Down

0 comments on commit 3791311

Please sign in to comment.