tcc and tif drift, compensated for string value casing, csv to dict improved process
This commit is contained in:
@ -6,3 +6,7 @@ class IRTModel(BaseModel):
|
||||
b_param: Dict = {"schema_bson_id": str, "field_bson_id": str}
|
||||
c_param: float
|
||||
model: str
|
||||
|
||||
|
||||
def formatted_b_param(self):
|
||||
return self.b_param['schema_bson_id'] + '-' + self.b_param['field_bson_id']
|
||||
|
@ -9,6 +9,7 @@ from lib.irt.item_information_function import ItemInformationFunction
|
||||
class Item(BaseModel):
|
||||
id: int
|
||||
passage_id: Optional[int]
|
||||
workflow_state: Optional[str]
|
||||
attributes: List[Attribute]
|
||||
b_param: float = 0.00
|
||||
|
||||
@ -20,12 +21,12 @@ class Item(BaseModel):
|
||||
|
||||
def get_attribute(self, ref_attribute):
|
||||
for attribute in self.attributes:
|
||||
if attribute.id == ref_attribute.id and attribute.value == ref_attribute.value:
|
||||
if attribute.id == ref_attribute.id and attribute.value.lower() == ref_attribute.value.lower():
|
||||
return attribute.value
|
||||
return False
|
||||
|
||||
def attribute_exists(self, ref_attribute):
|
||||
for attribute in self.attributes:
|
||||
if attribute.id == ref_attribute.id and attribute.value == ref_attribute.value:
|
||||
if attribute.id == ref_attribute.id and attribute.value.lower() == ref_attribute.value.lower():
|
||||
return True
|
||||
return False
|
||||
|
@ -9,7 +9,7 @@ from models.objective_function import ObjectiveFunction
|
||||
from models.advanced_options import AdvancedOptions
|
||||
|
||||
class SolverRun(BaseModel):
|
||||
items: List[Item]
|
||||
items: List[Item] = []
|
||||
bundles: Optional[Bundle]
|
||||
constraints: List[Constraint]
|
||||
irt_model: IRTModel
|
||||
@ -63,3 +63,6 @@ class SolverRun(BaseModel):
|
||||
count=1,
|
||||
type=type_attribute
|
||||
)]
|
||||
|
||||
def get_constraint(self, name):
|
||||
return next((constraint for constraint in self.constraints if constraint.reference_attribute.id == name), None)
|
||||
|
Reference in New Issue
Block a user