Skip to content

Commit

Permalink
support user-supplied models with no specified subspace
Browse files Browse the repository at this point in the history
  • Loading branch information
Dilan Pathirana committed Mar 27, 2024
1 parent 96f0022 commit 9ab8a23
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions petab_select/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -899,13 +899,19 @@ def from_model(model: Model) -> "ModelHash":
Returns:
The model hash.
"""
return ModelHash(
model_subspace_id=model.model_subspace_id,
model_subspace_indices_hash=(
model_subspace_id = ''
model_subspace_indices_hash = ''
if model.model_subspace_id is not None:
model_subspace_id = model.model_subspace_id
model_subspace_indices_hash = (
ModelHash.hash_model_subspace_indices(
model.model_subspace_indices,
model.model_subspace_indices
)
),
)

return ModelHash(
model_subspace_id=model_subspace_id,
model_subspace_indices_hash=model_subspace_indices_hash,
petab_hash=ModelHash.get_petab_hash(model=model),
)

Expand Down

0 comments on commit 9ab8a23

Please sign in to comment.