Skip to content

Logger warning for geodataframe #1240

@hboisgon

Description

@hboisgon

HydroMT version checks

  • I have checked that this issue has not already been reported.
  • I have checked that this bug exists on the latest version of HydroMT.

Reproducible Example

Read geodataframe with tabular data (table driver) like grdc with a geom as mask. (part of building wflow model step)

Current behaviour

A unnecessary warning prints in the log that intersecting the data with the geom/mask/region is not happening.
This happens at the level of read_data but the masking is effectively done a little later in _slice_data so this message risks cuasing confusion:

2025-08-19 10:42:04,879 - hydromt.data_catalog.uri_resolvers.convention_resolver - convention_resolver - DEBUG - attempting to resolve uri: C:\Users\boisgont\.hydromt\artifact_data\latest\grdc.csv
2025-08-19 10:42:04,901 - hydromt._utils.unused_kwargs - unused_kwargs - WARNING - object: GeoDataFrameTableDriver does not use kwarg mask with value                                                 geometry
value                                                   
1.0    POLYGON ((12.43667 46.69, 12.43667 46.67333, 1....
2025-08-19 10:42:04,902 - hydromt._utils.unused_kwargs - unused_kwargs - WARNING - object: GeoDataFrameTableDriver does not use kwarg predicate with value intersects.
2025-08-19 10:42:04,925 - hydromt.data_catalog.adapters.geodataframe - geodataframe - DEBUG - Clip intersects [11.778, 45.807, 12.745, 46.690] (EPSG:4326)
2025-08-19 10:42:04,927 - hydromt.hydromt_wflow.wflow - wflow - INFO - 3 grdc gauge locations found within domain

Message happens through this call:

_warn_on_unused_kwargs(
self.__class__.__name__,
{"mask": mask, "predicate": predicate, "variables": variables},
)

Desired behaviour

Either modify the function to avoid passing these arguments at that time or remove the message altogether.

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugSomething isn't workingNeeds refinementissue still needs refinement

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions