-
Notifications
You must be signed in to change notification settings - Fork 4
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
base: dev
Are you sure you want to change the base?
FixedLoadModelSpec.scala-convert-groovy-to-scala #831
Conversation
There was a problem hiding this 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
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, | ||
) |
There was a problem hiding this comment.
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.
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, | ||
) |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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
FixedLoadModel convert from groovy to scala.
This PR is related to Issue #646