uw-cryo / coincident

Search and analysis of STV Precursor Coincident Datasets
https://coincident.readthedocs.io
MIT License
3 stars 1 forks source link

Cascading Search Meaningful Error Messages #19

Open Jack-Hayes opened 2 weeks ago

Jack-Hayes commented 2 weeks ago

11/08/2024 Custom Python environment 3.12.5 Coincident version: '0.1.dev40+gfa66db4.d20241108'

cascading_search returns ValueError ValueError: ItemCollection is empty, cannot convert to GeoDataFrame when a one of the datasets in secondary_datasets doesn't return a 'hit'. Returns TypeError unsupported operand type(s) for *: 'GeometryArray' and 'float' when the overlapping datasets in the search don't meet the min_overlap_area minimum. ie. when geographic_area() returns an empty gdf due to datasets not meeting minimum area constraint, subset_by_minimum_area() raises the error

scottyhq commented 1 day ago

Thanks for digging into this @Jack-Hayes ! I'd say it's really 2 separate issues.

cascading_search returns ValueError ValueError: ItemCollection is empty, cannot convert to GeoDataFrame when a one of the datasets in secondary_datasets doesn't return a 'hit'.

Do you think it's better to just clarify the error message by including the dataset name without hits? Or warn instead and proceed to the next secondary dataset?

TypeError unsupported operand type(s) for *: 'GeometryArray' and 'float' when the overlapping datasets in the search don't meet the min_overlap_area minimum. ie. when geographic_area() returns an empty gdf due to datasets not meeting minimum area constraint, subset_by_minimum_area() raises the error

Agreed we want to avoid that confusing error. Would you prefer to just return the empty geodataframe or raise a more informative ValueError for this case?