Skip to content

Commit a79aeae

Browse files
dweindldilpath
andauthored
Apply suggestions from code review
Co-authored-by: Dilan Pathirana <[email protected]>
1 parent b7b8b5b commit a79aeae

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

petab/v2/C.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@
133133
OPERATION_TYPE = "operationType"
134134
#: Column in the condition table with the new value of the target entity
135135
TARGET_VALUE = "targetValue"
136-
# opeartion types:
136+
# operation types:
137137
OT_CUR_VAL = "setCurrentValue"
138138
OT_NO_CHANGE = "noChange"
139139

petab/v2/core.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ def validate_id(cls, v):
144144
mode="before",
145145
)
146146
@classmethod
147-
def convert_nan_to_none(cls, v, info: ValidationInfo):
147+
def convert_nan_to_default(cls, v, info: ValidationInfo):
148148
if isinstance(v, float) and np.isnan(v):
149149
return cls.model_fields[info.field_name].default
150150
return v
@@ -177,7 +177,7 @@ def __getitem__(self, observable_id: str) -> Observable:
177177
raise KeyError(f"Observable ID {observable_id} not found")
178178

179179
@classmethod
180-
def from_dataframe(cls, df: pd.DataFrame) -> ObservablesTable:
180+
def from_df(cls, df: pd.DataFrame) -> ObservablesTable:
181181
if df is None:
182182
return cls(observables=[])
183183

@@ -188,7 +188,7 @@ def from_dataframe(cls, df: pd.DataFrame) -> ObservablesTable:
188188

189189
return cls(observables=observables)
190190

191-
def to_dataframe(self) -> pd.DataFrame:
191+
def to_df(self) -> pd.DataFrame:
192192
return pd.DataFrame(self.model_dump()["observables"])
193193

194194
@classmethod

0 commit comments

Comments
 (0)