better abstraction and error handling/logging
This commit is contained in:
@ -19,5 +19,9 @@ class AbilityEstimation(BaseModel):
|
||||
}
|
||||
|
||||
def calculate(self) -> float:
|
||||
model = self.IRT_MODELS[self.irt_model]
|
||||
return model.ability_estimate(self.items)
|
||||
if self.irt_model in self.IRT_MODELS:
|
||||
model = self.IRT_MODELS[self.irt_model]
|
||||
return model.ability_estimate(self.items)
|
||||
else:
|
||||
logging.error(f'model of type {self.irt_model} does not exist.')
|
||||
return None
|
||||
|
Reference in New Issue
Block a user