Skip to content

Commit d95b86b

Browse files
PEP8 standard A002 (#247)
* A002 reenabled * renamed type to table_type. Distinction necessary for simulation and measurement table
1 parent b7cefb2 commit d95b86b

File tree

4 files changed

+9
-8
lines changed

4 files changed

+9
-8
lines changed

pyproject.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,6 @@ lint.ignore = [
9494
"T201", # `print` found"
9595
"SIM105", # Use `contextlib.suppress`
9696
"S110", # `try`-`except`-`pass` detected, consider logging the exception
97-
"A002", # Function argument shadowing a Python builtin
9897
"E701", # Multiple statements on one line (colon)
9998
"E741", # Ambiguous variable name
10099
]

src/petab_gui/commands.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def _convert_dtype_with_nullable_int(series, dtype):
2525
# Check if it's already a pandas nullable int type
2626
is_pandas_nullable_int = isinstance(
2727
dtype,
28-
(pd.Int64Dtype, pd.Int32Dtype, pd.Int16Dtype, pd.Int8Dtype),
28+
pd.Int64Dtype | pd.Int32Dtype | pd.Int16Dtype | pd.Int8Dtype,
2929
)
3030

3131
if is_pandas_nullable_int:
@@ -306,7 +306,7 @@ def _apply_changes(self, use_new: bool):
306306
# For numeric types, convert string inputs to numbers first
307307
is_pandas_nullable_int = isinstance(
308308
dtype,
309-
(pd.Int64Dtype, pd.Int32Dtype, pd.Int16Dtype, pd.Int8Dtype),
309+
pd.Int64Dtype | pd.Int32Dtype | pd.Int16Dtype | pd.Int8Dtype,
310310
)
311311
if is_pandas_nullable_int or np.issubdtype(dtype, np.number):
312312
df[col] = pd.to_numeric(df[col], errors="coerce")

src/petab_gui/models/pandas_table_model.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1127,12 +1127,14 @@ class MeasurementModel(PandasTableModel):
11271127
possibly_new_condition = Signal(str) # Signal for new condition
11281128
possibly_new_observable = Signal(str) # Signal for new observable
11291129

1130-
def __init__(self, data_frame, type: str = "measurement", parent=None):
1131-
allowed_columns = COLUMNS[type].copy()
1130+
def __init__(
1131+
self, data_frame, table_type: str = "measurement", parent=None
1132+
):
1133+
allowed_columns = COLUMNS[table_type].copy()
11321134
super().__init__(
11331135
data_frame=data_frame,
11341136
allowed_columns=allowed_columns,
1135-
table_type=type,
1137+
table_type=table_type,
11361138
parent=parent,
11371139
)
11381140

src/petab_gui/models/petab_model.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,11 @@ def __init__(
6262
)
6363
self.measurement = MeasurementModel(
6464
data_frame=self.problem.measurement_df,
65-
type="measurement",
65+
table_type="measurement",
6666
)
6767
self.simulation = MeasurementModel(
6868
data_frame=None,
69-
type="simulation",
69+
table_type="simulation",
7070
)
7171
self.observable = ObservableModel(
7272
data_frame=self.problem.observable_df,

0 commit comments

Comments
 (0)