Skip to content

Commit 87d273c

Browse files
committed
add to docstrings
1 parent 8a138ea commit 87d273c

1 file changed

Lines changed: 26 additions & 11 deletions

File tree

petab/v2/core.py

Lines changed: 26 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1258,8 +1258,8 @@ def from_yaml(
12581258
hybridization_tables = None
12591259
array_data_files = None
12601260
if config.extensions and config.extensions[C.SCIML]:
1261-
# Neural network classes are constructed via pytorch for now to get the
1262-
# proper inputs
1261+
# Neural network classes are constructed via pytorch for now to get
1262+
# the proper inputs
12631263
neural_networks = [
12641264
NNModel.from_pytorch_module(
12651265
NNModelStandard.load_data(
@@ -1274,12 +1274,12 @@ def from_yaml(
12741274
config.extensions[C.SCIML].neural_networks or {}
12751275
).items()
12761276
]
1277-
1277+
12781278
hybridization_tables = [
12791279
HybridizationTable.from_tsv(f, base_path)
12801280
for f in config.extensions[C.SCIML].hybridization_files
12811281
]
1282-
1282+
12831283
array_data_files = [
12841284
ArrayDataStandard.load_data(_generate_path(f, base_path))
12851285
for f in config.extensions[C.SCIML].array_files
@@ -1605,7 +1605,10 @@ def id(self, value: str):
16051605

16061606
@property
16071607
def hybridizations(self) -> list[Hybridization]:
1608-
"""List of hybridizations in the hybridization table(s)."""
1608+
"""
1609+
List of hybridizations in the hybridization table(s).
1610+
Note that hybridizations are specific to PEtab SciML problems.
1611+
"""
16091612
return list(
16101613
chain.from_iterable(
16111614
ht.hybridizations for ht in self.hybridization_tables
@@ -1614,7 +1617,10 @@ def hybridizations(self) -> list[Hybridization]:
16141617

16151618
@property
16161619
def hybridization_df(self) -> pd.DataFrame | None:
1617-
"""Combined SciML hybridization tables as DataFrame."""
1620+
"""
1621+
Combined SciML hybridization tables as DataFrame.
1622+
Note that hybridizations are specific to PEtab SciML problems.
1623+
"""
16181624
return (
16191625
HybridizationTable(hybridizations).to_df()
16201626
if (hybridizations := self.hybridizations)
@@ -2245,7 +2251,8 @@ def add_hybridization(self, target_id: str, target_value: str):
22452251
"""Add a SciML hybridization table entry to the problem.
22462252
22472253
If there is more than one hybridization table, the hybridization
2248-
is added to the last table.
2254+
is added to the last table. Note that hybridizations are specific
2255+
to PEtab SciML problems.
22492256
22502257
Arguments:
22512258
target_id: The ID of the target entity in the PEtab problem
@@ -2259,7 +2266,9 @@ def add_hybridization(self, target_id: str, target_value: str):
22592266
)
22602267

22612268
def add_neural_network_from_dict(self, model_id: str, nn_dict: dict):
2262-
"""Add a SciML neural net from a dictionary."""
2269+
"""
2270+
Add a SciML neural net from a dictionary (or PEtab SciML problems).
2271+
"""
22632272
# from petab_sciml import NNModel
22642273
nn_model = NNModel.model_validate(nn_dict)
22652274
nn_model.nn_model_id = model_id
@@ -2271,7 +2280,9 @@ def add_neural_network_from_yaml(
22712280
file_path: str | Path,
22722281
base_path: str | Path | None = None,
22732282
):
2274-
"""Add a SciML neural net from a yaml file."""
2283+
"""
2284+
Add a SciML neural net from a yaml file (for PEtab SciML problems).
2285+
"""
22752286
# from petab_sciml import NNModelStandard
22762287
self.neural_networks.append(
22772288
NNModelStandard.load_data(
@@ -2284,7 +2295,9 @@ def add_neural_network_from_yaml(
22842295
)
22852296

22862297
def add_array_data_from_dict(self, array_data: dict):
2287-
"""Add SciML array data from a dictionary."""
2298+
"""
2299+
Add SciML array data from a dictionary (for PEtab SciML problems).
2300+
"""
22882301
# from petab_sciml import ArrayData
22892302
self.array_data_files.append(ArrayData.model_validate(array_data))
22902303

@@ -2293,7 +2306,9 @@ def add_array_data_from_hdf5(
22932306
file_path: str | Path,
22942307
base_path: str | Path | None = None,
22952308
):
2296-
"""Add SciML array data from an hdf5 file."""
2309+
"""
2310+
Add SciML array data from an hdf5 file (for PEtab SciML problems).
2311+
"""
22972312
# from petab_sciml import ArrayDataStandard
22982313
self.array_data_files.append(
22992314
ArrayDataStandard.load_data(_generate_path(file_path, base_path))

0 commit comments

Comments
 (0)