Skip to content

Commit

Permalink
extend implementhed and documented, need test
Browse files Browse the repository at this point in the history
  • Loading branch information
juanbc committed Nov 17, 2023
1 parent aaca203 commit 015c020
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions skcriteria/cmp/ranks_cmp.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}]>"

Expand All @@ -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):
Expand Down Expand Up @@ -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'"
)
Expand Down
2 changes: 1 addition & 1 deletion skcriteria/cmp/ranks_rev/rank_inv_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions skcriteria/core/methods.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

# =============================================================================
# IMPORTS
# =============================================================================ç
# =============================================================================

import abc
import copy
Expand Down Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion skcriteria/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
2 changes: 1 addition & 1 deletion skcriteria/utils/lp.py
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down

0 comments on commit 015c020

Please sign in to comment.