Skip to content

Raise when leftover kwargs are present #142

Open
@OriolAbril

Description

@OriolAbril

Most functions in the xarray interface allow kwargs, which are passed to apply_ufunc or downstream to control behaviour of other stats functions called as intermediate steps of the one currently being called (e.g. hist/kde in hdi).

For functions that take **kwargs and pass them downstream it is generally not a good idea to check kwargs, as the downstream functions might change behaviour from time to time, but functions that consume those kwargs we should make sure we check there are no leftover kwargs.

As of now, there are several places where we take elements from kwargs by name and silently ignore extra keys in kwargs. For example both dims="draw" and dim="draw" work without error or warning in hdi, but dims is silently ignored (you can check in the output that both chain, draw have been reduced, the default sample_dims in rcParams)

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions