prefiltering of items
This commit is contained in:
@ -19,12 +19,12 @@ class Item(BaseModel):
|
||||
def irf(self, solver_run, theta):
|
||||
return ItemResponseFunction(solver_run.irt_model).calculate(b_param=self.b_param, theta=theta)
|
||||
|
||||
def get_attribute(self, ref_attribute):
|
||||
def get_attribute(self, ref_attribute: Attribute) -> Attribute or None:
|
||||
for attribute in self.attributes:
|
||||
if attribute.id == ref_attribute.id and attribute.value.lower(
|
||||
) == ref_attribute.value.lower():
|
||||
return attribute.value
|
||||
return False
|
||||
if self.attribute_exists(ref_attribute):
|
||||
return attribute
|
||||
|
||||
return None
|
||||
|
||||
def attribute_exists(self, ref_attribute: Attribute) -> bool:
|
||||
for attribute in self.attributes:
|
||||
|
Reference in New Issue
Block a user