You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We now have a first version of write_table, which will be part of the upcoming v0.14.0.
We should check whether also a read_table function may be useful. This could replace of lines like
importanndataasad# Load the ROI table and its metadata attributesROI_table=ad.read_zarr(ROI_table_path)
attrs=zarr.group(ROI_table_path).attrsMaskingROITableAttrs(**attrs.asdict())
column_name=attrs["instance_key"]
# Check that ROI_table.obs has the right column and extract label_valueifcolumn_namenotinROI_table.obs.columns:
raiseValueError(
'In _preprocess_input, "{column_name}" 'f" missing in {ROI_table.obs.columns=}"
)
with lines which could look like
fromfractal_tasks_core.tablesimportread_table# Load the ROI table and its metadata attributestable, attrs, column_names=read_table(path, options={"validate_attrs": True})
column_name=attrs["instance_key"]
# Check that ROI_table.obs has the right column and extract label_valueifcolumn_namenotincolumn_names:
raiseValueError(
'In _preprocess_input, "{column_name}" 'f" missing in {columns=}"
)
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
The text was updated successfully, but these errors were encountered:
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=}"
)
We now have a first version of
write_table
, which will be part of the upcoming v0.14.0.We should check whether also a
read_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? TBDThe text was updated successfully, but these errors were encountered: