Skip to content

Feature: add parameters via method chaining#67

Merged
dynobo merged 1 commit into
mainfrom
feature/add-parameters-via-method-chaining
Jul 17, 2025
Merged

Feature: add parameters via method chaining#67
dynobo merged 1 commit into
mainfrom
feature/add-parameters-via-method-chaining

Conversation

@dynobo
Copy link
Copy Markdown
Collaborator

@dynobo dynobo commented Jul 10, 2025

The current way to construct a ParameterSpace is

space = ParameterSpace()
space = space.add(...)
space = space.add(...)
space = space.add(...)
...

This feels a bit verbose, and method chaining seems a bit more convenient:

space = (
    ParameterSpace()
    .add(...)
    .add(...)
    .add(...)
    ...
)

This PR gives the user to choose between both syntaxes.

@dynobo dynobo requested review from LGro and sfalkner July 10, 2025 08:07
@dynobo dynobo force-pushed the feature/add-parameters-via-method-chaining branch from b3e7b5e to 4314921 Compare July 10, 2025 08:08
@LGro
Copy link
Copy Markdown

LGro commented Jul 10, 2025

I usually am a fan of there is one way to do things, but I have also wondered about allowing that to avoid copying the object instance variable over and over. I'd still wait for feedback from @sfalkner before moving forward, but you have my approval ☺️

Copy link
Copy Markdown
Collaborator

@sfalkner sfalkner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Simple change, and if it improves the user experience for some of us, why not. Thanks @dynobo !

Signed-off-by: Holger Buech (CR/AIR2.2) <holger.buech@de.bosch.com>
@dynobo dynobo force-pushed the feature/add-parameters-via-method-chaining branch from 4314921 to 4d0d73c Compare July 17, 2025 10:45
@dynobo dynobo merged commit 825292d into main Jul 17, 2025
7 checks passed
@dynobo dynobo deleted the feature/add-parameters-via-method-chaining branch July 17, 2025 10:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants