Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ lint.ignore = [
"T201", # `print` found"
"SIM105", # Use `contextlib.suppress`
"S110", # `try`-`except`-`pass` detected, consider logging the exception
"A002", # Function argument shadowing a Python builtin
"E701", # Multiple statements on one line (colon)
"E741", # Ambiguous variable name
]
Expand Down
4 changes: 2 additions & 2 deletions src/petab_gui/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def _convert_dtype_with_nullable_int(series, dtype):
# Check if it's already a pandas nullable int type
is_pandas_nullable_int = isinstance(
dtype,
(pd.Int64Dtype, pd.Int32Dtype, pd.Int16Dtype, pd.Int8Dtype),
pd.Int64Dtype | pd.Int32Dtype | pd.Int16Dtype | pd.Int8Dtype,
)

if is_pandas_nullable_int:
Expand Down Expand Up @@ -306,7 +306,7 @@ def _apply_changes(self, use_new: bool):
# For numeric types, convert string inputs to numbers first
is_pandas_nullable_int = isinstance(
dtype,
(pd.Int64Dtype, pd.Int32Dtype, pd.Int16Dtype, pd.Int8Dtype),
pd.Int64Dtype | pd.Int32Dtype | pd.Int16Dtype | pd.Int8Dtype,
)
if is_pandas_nullable_int or np.issubdtype(dtype, np.number):
df[col] = pd.to_numeric(df[col], errors="coerce")
Expand Down
8 changes: 5 additions & 3 deletions src/petab_gui/models/pandas_table_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -1127,12 +1127,14 @@ class MeasurementModel(PandasTableModel):
possibly_new_condition = Signal(str) # Signal for new condition
possibly_new_observable = Signal(str) # Signal for new observable

def __init__(self, data_frame, type: str = "measurement", parent=None):
allowed_columns = COLUMNS[type].copy()
def __init__(
self, data_frame, table_type: str = "measurement", parent=None
):
allowed_columns = COLUMNS[table_type].copy()
super().__init__(
data_frame=data_frame,
allowed_columns=allowed_columns,
table_type=type,
table_type=table_type,
parent=parent,
)

Expand Down
4 changes: 2 additions & 2 deletions src/petab_gui/models/petab_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,11 @@ def __init__(
)
self.measurement = MeasurementModel(
data_frame=self.problem.measurement_df,
type="measurement",
table_type="measurement",
)
self.simulation = MeasurementModel(
data_frame=None,
type="simulation",
table_type="simulation",
)
self.observable = ObservableModel(
data_frame=self.problem.observable_df,
Expand Down