This adds some type annotations to TableModel. This is slightly awkward because the data rows are a heterogenous list, and there is not way to strictly type its elements. We can't switch to a tuple, because they need to be mutable (maybe we can. but it is more code change).
So add ElementType and RowType, which limit the types, but don't understand the positions. and add an overloaded get_element() that fixes the type based on the literal value of the column argument.
Also some changes in the view to access things though get_element() and set_element()
Acceptance Criteria
Existing tests should all still pass
Play around with adding, removing and renaming ROIs
coverage: 73.142% (-0.01%) from 73.156%
when pulling 1588106d06ce5d3732cb8846fea41ac38ead9510 on 2213-type-checking-2
into d40724317a710baf2d6eaf64da7ae71adc810e14 on main.
coverage: 73.137% (-0.02%) from 73.156%
when pulling b9cc6932f6384d7fc0f972dbc4abe58d4e0600b1 on 2213-type-checking-2
into 38eeb6111b5bfac794e3530b7451492f791baf70 on main.
Issue
Some type checking for #2213
Description
This adds some type annotations to
TableModel
. This is slightly awkward because the data rows are a heterogenous list, and there is not way to strictly type its elements. We can't switch to a tuple, because they need to be mutable (maybe we can. but it is more code change).So add
ElementType
andRowType
, which limit the types, but don't understand the positions. and add anoverload
edget_element()
that fixes the type based on the literal value of the column argument.Also some changes in the view to access things though
get_element()
andset_element()
Acceptance Criteria
Existing tests should all still pass Play around with adding, removing and renaming ROIs
Documentation
Not needed