Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up configurations to utilize composition instead #89

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

t-persson
Copy link
Collaborator

Applicable Issues

Description of the Change

With my change for controller I noticed that I had to add a lot of the same code in multiple places. By utilizing composition here instead we will get cleaner code and it makes it easier to add new base configuration values instead of having to add it to every config separately.

Alternate Designs

Considered keeping it as is, but I think it's better to try and fix this now when it is easy instead of waiting and, potentially, not being able to.

Possible Drawbacks

I don't see any drawbacks of this design.

Sign-off

Developer's Certificate of Origin 1.1

By making a contribution to this project, I certify that:

(a) The contribution was created in whole or in part by me and I
have the right to submit it under the open source license
indicated in the file; or

(b) The contribution is based upon previous work that, to the best
of my knowledge, is covered under an appropriate open source
license and I have the right under that license to submit that
work with modifications, whether created in whole or in part
by me, under the same open source license (unless I am
permitted to submit under a different license), as indicated
in the file; or

(c) The contribution was provided directly to me by some other
person who certified (a), (b) or (c) and I have not modified
it.

(d) I understand and agree that this project and the contribution
are public and that a record of the contribution (including all
personal information I submit with it, including my sign-off) is
maintained indefinitely and may be redistributed consistent with
this project or the open source license(s) involved.

Signed-off-by: Tobias Persson [email protected]

@t-persson t-persson requested a review from a team as a code owner October 23, 2024 08:14
@t-persson t-persson requested review from fredjn and andmat900 and removed request for a team October 23, 2024 08:14
@t-persson t-persson mentioned this pull request Nov 15, 2024
Copy link
Member

Choose a reason for hiding this comment

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

Why remove the tests for specific configurations?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The test mostly just test that it is possible to use the config interface. It does not necessarily test that each value is possible to set.
While a new config_test could be added for the executionspace config it would not really do anything other than check that the default values are correct. The benefit of adding it would be that we'd be able to check that it loads the base config, but loading the base config is not really necessary as long as the config implements the Config interface (which it does).

In other words: I can add the tests if we want to, but I don't see much value in having them.

@t-persson t-persson force-pushed the configs-to-use-composition branch from 5a5c7f5 to 7a27c7e Compare November 27, 2024 13:35
@t-persson
Copy link
Collaborator Author

Forced push due to rebase

@t-persson t-persson requested a review from fredjn November 28, 2024 09:55
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.

2 participants