Skip to content

[ENH] should set_config and get_config be able to address deep configs? #282

Description

@fkiraly

here's a question: should there be a deep arg to get_config, like get_params? That way, we could avoid changes to _clone, as then we just need to add the deep arg in clone, once. It would be "cleaner" imo since it completely decouples the param logic from the config logic (coupling/cohesion improvement).

That is, should get_config, set_config of the top node object support getting/setting of component node configs - like get_params, set_params - or do you have to address the components directly.

I.e., compare

# how it would work right now
composite = Composite(comp1=Component1(), comp2=Component2().set_config(foo="bar"))
# vs how it could also work
composite = Composite(comp1=Component1(), comp2=Component2())
composite.set_config(comp2__foo="bar")

Both ways are already making the assumption that clone should keep configs across all nodes.

Originally posted by @fkiraly in #276 (comment), moved here for discussion.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    API designAPI design & software architectureenhancementAdding new functionality

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions