Skip to content

bug(skore): not possible to choose default backend in a nested context #1951

@glemaitre

Description

@glemaitre

What would you like to say?

In #1924, we chose to not use "default" thinking that it was the same semantic than None.

However, those two options have different semantics:

  • None means that we do not change the backend
  • "default" means that we use the default backend set by the Display

It starts to matter in nested context. Right now, we are unable to reset a context to the default backend that would be equivalent to:

with config_context(plot_backend="default"):  
    with config_context(plot_backend="plotly"):
        print(get_config()["plot_backend"])

We are only able to write:

with config_context(plot_backend=None):  
    with config_context(plot_backend="plotly"):
        print(get_config()["plot_backend"])

that will let the "plotly" backend on. The problem is that one might not be the code owner of the internal config_context and thus cannot really modify the inner call.

We used this pattern in scikit-learn for the transform_output parameter or in skrub for the enable_subsampling parameter and faced similar issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs-triageThis has been recently submitted and needs attentionuser-reported

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions