Skip to content

Discussion: Allow for passing all arguments as keyword arguments #110

@simon-hirsch

Description

@simon-hirsch

Hi @frazane, @sallen12

question for the v1.0.0: would you consider moving away from a position-based argument passing?

The background for the question is the following: in the current setup, it is not possible to have something like a mapping between values and parameters and do things like:

params = {"fct" : array, "obs": array}
score = sr.some_score(**params)

just for scores and observations, this might not be a big of an issue, but once one handles closed-form forecasts from different distributions, it's very convienient to do things like:

params = {"param_a" : array, "param_b" : array,  "obs": array}
score = sr.some_score(**params)

because then it's just about mapping distributions / scores / forecasts and everything else can be handled by passing keyword-value dicts.

I know the main argument for positional only is that you have API stability, that's why I'm asking now. :)

Background for this questions is that I wanted to make the scoringrules CPRPS available as optional dependency in our package for online distributional regression and had to do some weird magic to ensure that all the distribution parameters are mapped correctly all of the time https://github.com/simon-hirsch/ondil (see here) and I believe this could be benefical for wider usage.

Cheers, Simon

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions