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

FixedLoadModelSpec.scala-convert-groovy-to-scala #831

Open
wants to merge 10 commits into
base: dev
Choose a base branch
from

Conversation

pierrepetersmeier
Copy link
Contributor

FixedLoadModel convert from groovy to scala.

This PR is related to Issue #646

@pierrepetersmeier pierrepetersmeier added the test Issues related to (unit) tests label Jun 16, 2024
@pierrepetersmeier pierrepetersmeier added this to the Version 4.0 milestone Jun 16, 2024
@pierrepetersmeier pierrepetersmeier self-assigned this Jun 16, 2024
@pierrepetersmeier pierrepetersmeier linked an issue Jun 16, 2024 that may be closed by this pull request
Copy link
Member

@danielfeismann danielfeismann left a comment

Choose a reason for hiding this comment

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

This looks already very good. Just some minor remarks for further improvements from my side

Comment on lines +37 to +61
val loadInput =
new LoadInput(
UUID.fromString("4eeaf76a-ec17-4fc3-872d-34b7d6004b03"),
"testLoad",
OperatorInput.NO_OPERATOR_ASSIGNED,
OperationTime.notLimited(),
new NodeInput(
UUID.fromString("e5c1cde5-c161-4a4f-997f-fcf31fecbf57"),
"TestNodeInputModel",
OperatorInput.NO_OPERATOR_ASSIGNED,
OperationTime.notLimited(),
Quantities.getQuantity(1d, PowerSystemUnits.PU),
false,
NodeInput.DEFAULT_GEO_POSITION,
GermanVoltageLevelUtils.LV,
-1,
),
new CosPhiFixed("cosPhiFixed:{(0.0,0.95)}"),
null,
BdewStandardLoadProfile.H0,
false,
Quantities.getQuantity(3000d, PowerSystemUnits.KILOWATTHOUR),
Quantities.getQuantity(282.74d, PowerSystemUnits.VOLTAMPERE),
0.95,
)
Copy link
Member

Choose a reason for hiding this comment

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

I guess this can be simplyfied by using LoadInputTestData. You can access it by extending the class by it.

Comment on lines +63 to +72
val simulationStartDate =
TimeUtil.withDefaults.toZonedDateTime("2019-01-01T00:00:00Z")
val simulationEndDate =
TimeUtil.withDefaults.toZonedDateTime("2019-12-31T23:59:00Z")
val foreSeenOperationInterval =
SystemComponent.determineOperationInterval(
simulationStartDate,
simulationEndDate,
loadInput.getOperationTime,
)
Copy link
Member

Choose a reason for hiding this comment

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

Same here, these are also within DefaultTestData

forAll(testData) { (reference, expectedPower: Power) =>
val relevantData = FixedLoadModel.FixedLoadRelevantData

val scale = 1.0
Copy link
Member

Choose a reason for hiding this comment

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

Note to self: scaling 0 - 2.0 needs to be considered

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
test Issues related to (unit) tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Convert groovy tests to ScalaTest, remove groovy
2 participants