mobie / mobie-utils-python

Python tools for MoBIE
MIT License
9 stars 5 forks source link

Support tables without bounding box columns #97

Closed imagejan closed 1 year ago

imagejan commented 1 year ago

When adding a source segmentation including table data using (add_source_to_dataset), the table is required to have bb_min_* and bb_max_* columns, although their presence shouldn't be strictly required.

The column checking happens here:

https://github.com/mobie/mobie-utils-python/blob/d02ca5342accbb507edc9cd5abc3a90bd4120a84/mobie/tables/default_table.py#L17-L22

and in the validation code here: https://github.com/mobie/mobie-utils-python/blob/0e2a5fd228b354e46440c415c5a3915df4ca5e3d/mobie/validation/tables.py#L74-L77

constantinpape commented 1 year ago

Good point! I am implementing less strict checks here: https://github.com/mobie/mobie-utils-python/pull/99

constantinpape commented 1 year ago

This is available on the current master branch now. @imagejan: Do you have an environment where you can test this from master?

imagejan commented 1 year ago

@constantinpape thanks for the quick fix. This works fine for me now.

A flag to suppress the warnings (about missing "recommended" columns) would be great though, otherwise my output gets spammed when adding many tables. 🙂

constantinpape commented 1 year ago

A flag to suppress the warnings (about missing "recommended" columns) would be great though, otherwise my output gets spammed when adding many tables. slightly_smiling_face

Ok, I'll look into it ;).

constantinpape commented 1 year ago

This is now implemented in #102. You can pass suppress_warnings=True to add_source_to_dataset, which should prevent the warnings from missing recommended columns. I haven't tested this yet though, so let me know if anything unexpected happens when you use this.

constantinpape commented 1 year ago

This will be included in the new release and I will close the issue. Feel free to reopen if anything is still missing or does not work as expected @imagejan.