@@ -2433,6 +2433,51 @@ def add_hybridization(self, target_id: str, target_value: str):
24332433 Hybridization (target_id = target_id , target_value = target_value )
24342434 )
24352435
2436+ def add_neural_network_from_dict (self , model_id : str , nn_dict : dict ):
2437+ """Add a SciML neural net from a dictionary."""
2438+ from petab_sciml import NNModel
2439+
2440+ nn_model = NNModel .model_validate (nn_dict )
2441+ nn_model .nn_model_id = model_id
2442+ self .neural_networks .append (nn_model )
2443+
2444+ def add_neural_network_from_yaml (
2445+ self ,
2446+ model_id : str ,
2447+ file_path : str | Path ,
2448+ base_path : str | Path | None = None ,
2449+ ):
2450+ """Add a SciML neural net from a yaml file."""
2451+ from petab_sciml import NNModelStandard
2452+
2453+ self .neural_networks .append (
2454+ NNModelStandard .load_data (
2455+ _generate_path (
2456+ file_path = file_path ,
2457+ base_path = base_path ,
2458+ ),
2459+ nn_model_id = model_id ,
2460+ )
2461+ )
2462+
2463+ def add_array_data_from_dict (self , array_data : dict ):
2464+ """Add SciML array data from a dictionary."""
2465+ from petab_sciml import ArrayData
2466+
2467+ self .array_data_files .append (ArrayData .model_validate (array_data ))
2468+
2469+ def add_array_data_from_hdf5 (
2470+ self ,
2471+ file_path : str | Path ,
2472+ base_path : str | Path | None = None ,
2473+ ):
2474+ """Add SciML array data from an hdf5 file."""
2475+ from petab_sciml import ArrayDataStandard
2476+
2477+ self .array_data_files .append (
2478+ ArrayDataStandard .load_data (_generate_path (file_path , base_path ))
2479+ )
2480+
24362481 def __iadd__ (self , other ):
24372482 """Add Observable, Parameter, Measurement, Condition, or Experiment"""
24382483 from .core import (
0 commit comments