Open tcompa opened 9 months ago
Big fan of the idea!
For read_table(path, options={"validate_attrs": True})
, I'd rather go with something like:
read_table(path, validate_attrs=True)
(with a potential default for validate_attrs)
Also, couldn't this part be part of the validation block?
column_name = attrs["instance_key"]
# Check that ROI_table.obs has the right column and extract label_value
if column_name not in column_names:
raise ValueError(
'In _preprocess_input, "{column_name}" '
f" missing in {columns=}"
)
For the future, something like:
table, attrs = read_table(path, validate_attrs=True)
We now have a first version of
write_table
, which will be part of the upcoming v0.14.0. We should check whether also aread_table
function may be useful. This could replace of lines likewith lines which could look like
This is partly relevant also for #629, since it would force us to think more about what attributes a table must have; e.g. do all V1 tables have an
obs
attribute with some specific contents? TBD