Skip to content

Refactored the handling of power profiles#1515

Open
staudtMarius wants to merge 8 commits intodevfrom
ms/#1514-refactor-handling-of-power-profiles
Open

Refactored the handling of power profiles#1515
staudtMarius wants to merge 8 commits intodevfrom
ms/#1514-refactor-handling-of-power-profiles

Conversation

@staudtMarius
Copy link
Member

Resolves #1514

@staudtMarius staudtMarius self-assigned this Jan 9, 2026
@staudtMarius staudtMarius added enhancement New feature or request code quality Code readability or structure is improved labels Jan 9, 2026
Copy link
Member

@sebastian-peter sebastian-peter left a comment

Choose a reason for hiding this comment

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

Looks great overall, this really simplifies things.

I have two small additional todos:

  • Could you please adapt the relevant UML diagrams in docs/uml/? At least TimeSeriesDatamodelConcept.puml, maybe more, need adaption
  • Please have a look into the SonarQube issues

Comment on lines -331 to -335
SystemParticipantTestData.loadInput.copy().loadprofile(createInvalidStandardLoadProfile("h1")).build() || 1 || new InvalidEntityException("Load profile must contain at least one valid entry: h0, g[0-6], l[0-2], ep1, ez2, random, or LoadProfile#NO_LOAD_PROFILE.", invalidLoad)
SystemParticipantTestData.loadInput.copy().loadprofile(createInvalidStandardLoadProfile("g7")).build() || 1 || new InvalidEntityException("Load profile must contain at least one valid entry: h0, g[0-6], l[0-2], ep1, ez2, random, or LoadProfile#NO_LOAD_PROFILE.", invalidLoad)
SystemParticipantTestData.loadInput.copy().loadprofile(createInvalidStandardLoadProfile("l3")).build() || 1 || new InvalidEntityException("Load profile must contain at least one valid entry: h0, g[0-6], l[0-2], ep1, ez2, random, or LoadProfile#NO_LOAD_PROFILE.", invalidLoad)
SystemParticipantTestData.loadInput.copy().loadprofile(createInvalidStandardLoadProfile("invalid")).build() || 1 || new InvalidEntityException("Load profile must contain at least one valid entry: h0, g[0-6], l[0-2], ep1, ez2, random, or LoadProfile#NO_LOAD_PROFILE.", invalidLoad)
}
Copy link
Member

Choose a reason for hiding this comment

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

Would be great if you could test these in PowerProfileKeyTest

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't see the need to test this, since we are no longer using the profile in the model. The key can contain a key that is not part of the standard load profiles that are defined in the PSDM. But this behavior is intended.

Copy link
Member

Choose a reason for hiding this comment

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

Ah, because we're not matching the keys against static profiles anymore, right? Maybe we should provide a method to do so, at least to get a mapping PowerProfileKey -> Optional<LoadProfile>, and if it's none we have to check for custom profiles?

Copy link
Member

Choose a reason for hiding this comment

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

Not sure anymore what the latest state of our discussion was...

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

Labels

code quality Code readability or structure is improved enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Refactor handling of power profiles.

2 participants