diff --git a/pyproject.toml b/pyproject.toml index 1b24b42..ff83367 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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 ] diff --git a/src/petab_gui/commands.py b/src/petab_gui/commands.py index 85a6646..9ba472a 100644 --- a/src/petab_gui/commands.py +++ b/src/petab_gui/commands.py @@ -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: @@ -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") diff --git a/src/petab_gui/models/pandas_table_model.py b/src/petab_gui/models/pandas_table_model.py index db0c48a..3343dde 100644 --- a/src/petab_gui/models/pandas_table_model.py +++ b/src/petab_gui/models/pandas_table_model.py @@ -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, ) diff --git a/src/petab_gui/models/petab_model.py b/src/petab_gui/models/petab_model.py index 06a1702..c19618f 100644 --- a/src/petab_gui/models/petab_model.py +++ b/src/petab_gui/models/petab_model.py @@ -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,