From 015c0209e77a2c7925926f602ad13a4a2cf87720 Mon Sep 17 00:00:00 2001 From: juanbc Date: Fri, 17 Nov 2023 00:14:55 -0300 Subject: [PATCH] extend implementhed and documented, need test --- skcriteria/cmp/ranks_cmp.py | 6 +++--- skcriteria/cmp/ranks_rev/rank_inv_check.py | 2 +- skcriteria/core/methods.py | 4 ++-- skcriteria/pipeline.py | 2 +- skcriteria/utils/lp.py | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/skcriteria/cmp/ranks_cmp.py b/skcriteria/cmp/ranks_cmp.py index 0d2d39b..309839a 100644 --- a/skcriteria/cmp/ranks_cmp.py +++ b/skcriteria/cmp/ranks_cmp.py @@ -129,7 +129,7 @@ def named_ranks(self): def __repr__(self): """x.__repr__() <==> repr(x).""" - cls_name = type(self).__name__ + cls_name = type(self).__qualname__ ranks_names = [rn for rn, _ in self._ranks] return f"<{cls_name} [ranks={ranks_names!r}]>" @@ -149,7 +149,7 @@ def __getitem__(self, ind): """ if isinstance(ind, slice): if ind.step not in (1, None): - cname = type(self).__name__ + cname = type(self).__qualname__ raise ValueError(f"{cname} slicing only supports a step of 1") return self.__class__(self.ranks[ind]) elif isinstance(ind, int): @@ -461,7 +461,7 @@ def reg( # Just to ensure that no manual color reaches regplot if "color" in kwargs: - cls_name = type(self).__name__ + cls_name = type(self).__qualname__ raise TypeError( f"{cls_name}.reg() got an unexpected keyword argument 'color'" ) diff --git a/skcriteria/cmp/ranks_rev/rank_inv_check.py b/skcriteria/cmp/ranks_rev/rank_inv_check.py index 7688937..cd8d17c 100644 --- a/skcriteria/cmp/ranks_rev/rank_inv_check.py +++ b/skcriteria/cmp/ranks_rev/rank_inv_check.py @@ -157,7 +157,7 @@ def __init__( def __repr__(self): """x.__repr__() <==> repr(x).""" - cls_name = type(self).__name__ + cls_name = type(self).__qualname__ dm = repr(self.dmaker) repeats = self.repeat ama = self._allow_missing_alternatives diff --git a/skcriteria/core/methods.py b/skcriteria/core/methods.py index 56d6379..b0dd15d 100644 --- a/skcriteria/core/methods.py +++ b/skcriteria/core/methods.py @@ -13,7 +13,7 @@ # ============================================================================= # IMPORTS -# =============================================================================รง +# ============================================================================= import abc import copy @@ -76,7 +76,7 @@ def __init_subclass__(cls): def __repr__(self): """x.__repr__() <==> repr(x).""" - cls_name = type(self).__name__ + cls_name = type(self).__qualname__ parameters = [] if self._skcriteria_parameters: diff --git a/skcriteria/pipeline.py b/skcriteria/pipeline.py index 43dc27f..e5521d1 100644 --- a/skcriteria/pipeline.py +++ b/skcriteria/pipeline.py @@ -110,7 +110,7 @@ def __getitem__(self, ind): """ if isinstance(ind, slice): if ind.step not in (1, None): - cname = type(self).__name__ + cname = type(self).__qualname__ raise ValueError(f"{cname} slicing only supports a step of 1") return self.__class__(self.steps[ind]) elif isinstance(ind, int): diff --git a/skcriteria/utils/lp.py b/skcriteria/utils/lp.py index e591bb4..fd3f543 100644 --- a/skcriteria/utils/lp.py +++ b/skcriteria/utils/lp.py @@ -179,7 +179,7 @@ def __init__(self, z, name="no-name", solver=None, **solver_kwds): def __repr__(self): """model.__repr__() <==> repr(model).""" - cls_name = type(self).__name__ + cls_name = type(self).__qualname__ objective = self._problem.objective constraints = ",\n ".join( map(str, self._problem.constraints.values())