Skip to content

Commit 0ed48b7

Browse files
committed
doc: Coherent naming
1 parent 101c79c commit 0ed48b7

File tree

1 file changed

+20
-20
lines changed

1 file changed

+20
-20
lines changed

petab/v2/core.py

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ def noise_placeholders(self) -> set[sp.Symbol]:
241241

242242

243243
class ObservableTable(BaseModel):
244-
"""PEtab observables table."""
244+
"""PEtab observable table."""
245245

246246
#: List of observables.
247247
observables: list[Observable]
@@ -255,7 +255,7 @@ def __getitem__(self, observable_id: str) -> Observable:
255255

256256
@classmethod
257257
def from_df(cls, df: pd.DataFrame) -> ObservableTable:
258-
"""Create an ObservablesTable from a DataFrame."""
258+
"""Create an ObservableTable from a DataFrame."""
259259
if df is None:
260260
return cls(observables=[])
261261

@@ -268,7 +268,7 @@ def from_df(cls, df: pd.DataFrame) -> ObservableTable:
268268
return cls(observables=observables)
269269

270270
def to_df(self) -> pd.DataFrame:
271-
"""Convert the ObservablesTable to a DataFrame."""
271+
"""Convert the ObservableTable to a DataFrame."""
272272
records = self.model_dump(by_alias=True)["observables"]
273273
for record in records:
274274
obs = record[C.OBSERVABLE_FORMULA]
@@ -294,25 +294,25 @@ def to_df(self) -> pd.DataFrame:
294294

295295
@classmethod
296296
def from_tsv(cls, file_path: str | Path) -> ObservableTable:
297-
"""Create an ObservablesTable from a TSV file."""
297+
"""Create an ObservableTable from a TSV file."""
298298
df = pd.read_csv(file_path, sep="\t")
299299
return cls.from_df(df)
300300

301301
def to_tsv(self, file_path: str | Path) -> None:
302-
"""Write the ObservablesTable to a TSV file."""
302+
"""Write the ObservableTable to a TSV file."""
303303
df = self.to_df()
304304
df.to_csv(file_path, sep="\t", index=True)
305305

306306
def __add__(self, other: Observable) -> ObservableTable:
307307
"""Add an observable to the table."""
308308
if not isinstance(other, Observable):
309-
raise TypeError("Can only add Observable to ObservablesTable")
309+
raise TypeError("Can only add Observable to ObservableTable")
310310
return ObservableTable(observables=self.observables + [other])
311311

312312
def __iadd__(self, other: Observable) -> ObservableTable:
313313
"""Add an observable to the table in place."""
314314
if not isinstance(other, Observable):
315-
raise TypeError("Can only add Observable to ObservablesTable")
315+
raise TypeError("Can only add Observable to ObservableTable")
316316
self.observables.append(other)
317317
return self
318318

@@ -415,7 +415,7 @@ def __getitem__(self, condition_id: str) -> Condition:
415415

416416
@classmethod
417417
def from_df(cls, df: pd.DataFrame) -> ConditionTable:
418-
"""Create a ConditionsTable from a DataFrame."""
418+
"""Create a ConditionTable from a DataFrame."""
419419
if df is None or df.empty:
420420
return cls(conditions=[])
421421

@@ -427,7 +427,7 @@ def from_df(cls, df: pd.DataFrame) -> ConditionTable:
427427
return cls(conditions=conditions)
428428

429429
def to_df(self) -> pd.DataFrame:
430-
"""Convert the ConditionsTable to a DataFrame."""
430+
"""Convert the ConditionTable to a DataFrame."""
431431
records = [
432432
{C.CONDITION_ID: condition.id, **change.model_dump(by_alias=True)}
433433
for condition in self.conditions
@@ -447,31 +447,31 @@ def to_df(self) -> pd.DataFrame:
447447

448448
@classmethod
449449
def from_tsv(cls, file_path: str | Path) -> ConditionTable:
450-
"""Create a ConditionsTable from a TSV file."""
450+
"""Create a ConditionTable from a TSV file."""
451451
df = pd.read_csv(file_path, sep="\t")
452452
return cls.from_df(df)
453453

454454
def to_tsv(self, file_path: str | Path) -> None:
455-
"""Write the ConditionsTable to a TSV file."""
455+
"""Write the ConditionTable to a TSV file."""
456456
df = self.to_df()
457457
df.to_csv(file_path, sep="\t", index=False)
458458

459459
def __add__(self, other: Condition) -> ConditionTable:
460460
"""Add a condition to the table."""
461461
if not isinstance(other, Condition):
462-
raise TypeError("Can only add Conditions to ConditionsTable")
462+
raise TypeError("Can only add Condition to ConditionTable")
463463
return ConditionTable(conditions=self.conditions + [other])
464464

465465
def __iadd__(self, other: Condition) -> ConditionTable:
466466
"""Add a condition to the table in place."""
467467
if not isinstance(other, Condition):
468-
raise TypeError("Can only add Conditions to ConditionsTable")
468+
raise TypeError("Can only add Condition to ConditionTable")
469469
self.conditions.append(other)
470470
return self
471471

472472
@property
473473
def free_symbols(self) -> set[sp.Symbol]:
474-
"""Get all free symbols in the conditions table.
474+
"""Get all free symbols in the condition table.
475475
476476
This includes all free symbols in the target values of the changes,
477477
independently of whether it is referenced by any experiment, or
@@ -556,7 +556,7 @@ class ExperimentTable(BaseModel):
556556

557557
@classmethod
558558
def from_df(cls, df: pd.DataFrame) -> ExperimentTable:
559-
"""Create an ExperimentsTable from a DataFrame."""
559+
"""Create an ExperimentTable from a DataFrame."""
560560
if df is None:
561561
return cls(experiments=[])
562562

@@ -573,7 +573,7 @@ def from_df(cls, df: pd.DataFrame) -> ExperimentTable:
573573
return cls(experiments=experiments)
574574

575575
def to_df(self) -> pd.DataFrame:
576-
"""Convert the ExperimentsTable to a DataFrame."""
576+
"""Convert the ExperimentTable to a DataFrame."""
577577
records = [
578578
{
579579
C.EXPERIMENT_ID: experiment.id,
@@ -590,25 +590,25 @@ def to_df(self) -> pd.DataFrame:
590590

591591
@classmethod
592592
def from_tsv(cls, file_path: str | Path) -> ExperimentTable:
593-
"""Create an ExperimentsTable from a TSV file."""
593+
"""Create an ExperimentTable from a TSV file."""
594594
df = pd.read_csv(file_path, sep="\t")
595595
return cls.from_df(df)
596596

597597
def to_tsv(self, file_path: str | Path) -> None:
598-
"""Write the ExperimentsTable to a TSV file."""
598+
"""Write the ExperimentTable to a TSV file."""
599599
df = self.to_df()
600600
df.to_csv(file_path, sep="\t", index=False)
601601

602602
def __add__(self, other: Experiment) -> ExperimentTable:
603603
"""Add an experiment to the table."""
604604
if not isinstance(other, Experiment):
605-
raise TypeError("Can only add Experiment to ExperimentsTable")
605+
raise TypeError("Can only add Experiment to ExperimentTable")
606606
return ExperimentTable(experiments=self.experiments + [other])
607607

608608
def __iadd__(self, other: Experiment) -> ExperimentTable:
609609
"""Add an experiment to the table in place."""
610610
if not isinstance(other, Experiment):
611-
raise TypeError("Can only add Experiment to ExperimentsTable")
611+
raise TypeError("Can only add Experiment to ExperimentTable")
612612
self.experiments.append(other)
613613
return self
614614

0 commit comments

Comments
 (0)