Skip to content

Commit

Permalink
fix : pycm_error --> errors
Browse files Browse the repository at this point in the history
  • Loading branch information
sepandhaghighi committed Oct 8, 2024
1 parent 74edd45 commit 76985f1
Show file tree
Hide file tree
Showing 12 changed files with 86 additions and 85 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- `pycm_multilabel_cm.py` renamed to `multilabel_cm.py`
- `pycm_interpret.py` renamed to `interpret.py`
- `pycm_handler.py` renamed to `handlers.py`
- `pycm_error.py` renamed to `errors.py`
## [4.0] - 2023-06-07
### Added
- `pycmMultiLabelError` class
Expand Down
146 changes: 73 additions & 73 deletions Test/error_test.py

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions Test/plot_error_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@
>>> ax = cm.plot()
Traceback (most recent call last):
...
pycm.pycm_error.pycmPlotError: Failed to import matplotlib module. Please install it using: `pip install matplotlib`.
pycm.errors.pycmPlotError: Failed to import matplotlib module. Please install it using: `pip install matplotlib`.
>>> ax = cm.plot(plot_lib='seaborn')
Traceback (most recent call last):
...
pycm.pycm_error.pycmPlotError: Failed to import matplotlib module. Please install it using: `pip install matplotlib`.
pycm.errors.pycmPlotError: Failed to import matplotlib module. Please install it using: `pip install matplotlib`.
>>> crv = Curve(actual_vector = np.array([1, 1, 2, 2]), probs = np.array([[0.1, 0.9], [0.4, 0.6], [0.35, 0.65], [0.8, 0.2]]), classes=[2, 1])
>>> ax = crv.plot(classes=[1])
Traceback (most recent call last):
...
pycm.pycm_error.pycmPlotError: Failed to import matplotlib module. Please install it using: `pip install matplotlib`.
pycm.errors.pycmPlotError: Failed to import matplotlib module. Please install it using: `pip install matplotlib`.
"""
4 changes: 2 additions & 2 deletions Test/plot_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,11 +207,11 @@
>>> crv.plot(colors=['c'])
Traceback (most recent call last):
...
pycm.pycm_error.pycmPlotError: The number of colors does not match the number of classes.
pycm.errors.pycmPlotError: The number of colors does not match the number of classes.
>>> crv.plot(markers=['*'])
Traceback (most recent call last):
...
pycm.pycm_error.pycmPlotError: The number of markers does not match the number of classes.
pycm.errors.pycmPlotError: The number of markers does not match the number of classes.
>>> ax = crv.plot(classes=[1])
>>> ax.get_figure()._suptitle.get_text()
'FPR per TPR'
Expand Down
2 changes: 1 addition & 1 deletion pycm/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
"""PyCM modules."""
from .params import PYCM_VERSION, OVERALL_BENCHMARK_LIST, CLASS_BENCHMARK_LIST
from .pycm_error import *
from .errors import *
from .output import pycm_help, online_help
from .pycm_distance import DistanceType
from .cm import ConfusionMatrix
Expand Down
2 changes: 1 addition & 1 deletion pycm/cm.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
"""ConfusionMatrix module."""
from __future__ import division
from .pycm_error import pycmVectorError, pycmMatrixError, pycmCIError, pycmAverageError, pycmPlotError
from .errors import pycmVectorError, pycmMatrixError, pycmCIError, pycmAverageError, pycmPlotError
from .handlers import __class_stat_init__, __overall_stat_init__
from .handlers import __obj_assign_handler__, __obj_file_handler__, __obj_matrix_handler__, __obj_vector_handler__, __obj_array_handler__
from .handlers import __imbalancement_handler__
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion pycm/pycm_handler.py → pycm/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"""ConfusionMatrix handlers."""
from __future__ import division
from .pycm_class_func import class_statistics
from .pycm_error import pycmVectorError, pycmMatrixError
from .errors import pycmVectorError, pycmMatrixError
from .overall_funcs import overall_statistics
from .utils import *
from .params import *
Expand Down
2 changes: 1 addition & 1 deletion pycm/multilabel_cm.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
"""MultiLabelCM module."""
from __future__ import division
from .pycm_error import pycmVectorError, pycmMultiLabelError
from .errors import pycmVectorError, pycmMultiLabelError
from .params import *
from .cm import ConfusionMatrix
import numpy
Expand Down
2 changes: 1 addition & 1 deletion pycm/pycm_compare.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
"""Compare module."""
from __future__ import division
from .pycm_error import pycmCompareError
from .errors import pycmCompareError
from .output import *
from .utils import *
from .params import *
Expand Down
2 changes: 1 addition & 1 deletion pycm/pycm_curve.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
"""Curve module."""
from __future__ import division
from .pycm_error import pycmCurveError, pycmPlotError
from .errors import pycmCurveError, pycmPlotError
from .utils import threshold_func, thresholds_calc, isfloat
from .params import *
from .cm import ConfusionMatrix
Expand Down
2 changes: 1 addition & 1 deletion pycm/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import numpy
import re
from .params import *
from .pycm_error import pycmMatrixError
from .errors import pycmMatrixError
from warnings import warn
from functools import wraps

Expand Down

0 comments on commit 76985f1

Please sign in to comment.