Skip to content

Commit e9706c7

Browse files
committed
Proble.add_hybridization method
1 parent 96ebee5 commit e9706c7

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

petab/v2/core.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2402,6 +2402,23 @@ def add_experiment(self, id_: str, *args):
24022402
Experiment(id=id_, periods=periods)
24032403
)
24042404

2405+
def add_hybridization(self, target_id: str, target_value: str):
2406+
"""Add a SciML hybridization table entry to the problem.
2407+
2408+
If there are more than one hybridization tables, the hybridization
2409+
is added to the last one.
2410+
2411+
Arguments:
2412+
target_id: The ID of the target entity in the PEtab problem
2413+
or neural network model
2414+
target_value: The value that is assigned to the target id.
2415+
"""
2416+
if not self.hybridization_tables:
2417+
self.hybridization_tables.append(HybridizationTable())
2418+
self.hybridization_tables[-1].hybridizations.append(
2419+
Hybridization(target_id=target_id, target_value=target_value)
2420+
)
2421+
24052422
def __iadd__(self, other):
24062423
"""Add Observable, Parameter, Measurement, Condition, or Experiment"""
24072424
from .core import (

0 commit comments

Comments
 (0)