Codacy correction
This commit is contained in:
committed by
Nicola Demo
parent
ea3d1924e7
commit
dd43c8304c
@@ -1,6 +1,6 @@
|
||||
|
||||
from abc import ABCMeta
|
||||
|
||||
|
||||
class ConditionInterface(metaclass=ABCMeta):
|
||||
|
||||
condition_types = ['physics', 'supervised', 'unsupervised']
|
||||
@@ -12,7 +12,7 @@ class ConditionInterface(metaclass=ABCMeta):
|
||||
@property
|
||||
def problem(self):
|
||||
return self._problem
|
||||
|
||||
|
||||
@problem.setter
|
||||
def problem(self, value):
|
||||
self._problem = value
|
||||
@@ -20,15 +20,14 @@ class ConditionInterface(metaclass=ABCMeta):
|
||||
@property
|
||||
def condition_type(self):
|
||||
return self._condition_type
|
||||
|
||||
|
||||
@condition_type.setter
|
||||
def condition_type(self, values):
|
||||
if not isinstance(values, (list, tuple)):
|
||||
values = [values]
|
||||
for value in values:
|
||||
if value not in ConditionInterface.condition_types:
|
||||
raise ValueError(
|
||||
'Unavailable type of condition, expected one of'
|
||||
f' {ConditionInterface.condition_types}.'
|
||||
)
|
||||
self._condition_type = values
|
||||
raise ValueError(
|
||||
'Unavailable type of condition, expected one of'
|
||||
f' {ConditionInterface.condition_types}.')
|
||||
self._condition_type = values
|
||||
|
||||
Reference in New Issue
Block a user