Codacy correction

This commit is contained in:
FilippoOlivo
2024-10-31 09:50:19 +01:00
committed by Nicola Demo
parent ea3d1924e7
commit dd43c8304c
23 changed files with 246 additions and 214 deletions

View File

@@ -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