-
Notifications
You must be signed in to change notification settings - Fork 7
Added builder implementations to the required thermal input models #270
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
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
b7c17f1
#165 Added builder implementations to several thermal input models
avgprog 0a0616a
#270 Removed redundant code by removing outer class names
avgprog eeefc1e
#270 Removed static declarations in order to access getThermalBus fun…
avgprog 69b266e
#270 Added test cases to check the builder implementations added to t…
avgprog 3f73a03
#270 Added ThermalUnitInpuiutCopyBuilder class, modified several ther…
avgprog 01ba298
Merge branch 'dev' into sb/#165-addingBuilderForThermalInputModels
ckittl File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
src/test/groovy/edu/ie3/datamodel/models/input/thermal/CylindricalStorageInputTest.groovy
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/* | ||
* © 2021. TU Dortmund University, | ||
* Institute of Energy Systems, Energy Efficiency and Energy Economics, | ||
* Research group Distribution grid planning and operation | ||
*/ | ||
package edu.ie3.datamodel.models.input.thermal | ||
|
||
import edu.ie3.test.common.ThermalUnitInputTestData | ||
import spock.lang.Specification | ||
|
||
|
||
class CylindricalStorageInputTest extends Specification { | ||
|
||
def "A CylindricalStorageInput copy method should work as expected"() { | ||
given: | ||
def cylindricalStorageInput = ThermalUnitInputTestData.cylindricStorageInput | ||
|
||
when: | ||
def alteredUnit = cylindricalStorageInput.copy().storageVolumeLvl(ThermalUnitInputTestData.storageVolumeLvl) | ||
.storageVolumeLvlMin(ThermalUnitInputTestData.storageVolumeLvlMin).inletTemp(ThermalUnitInputTestData.inletTemp) | ||
.returnTemp(ThermalUnitInputTestData.returnTemp).c(ThermalUnitInputTestData.c) | ||
.thermalBus(ThermalUnitInputTestData.thermalBus).build() | ||
|
||
|
||
then: | ||
alteredUnit.with { | ||
assert uuid == cylindricalStorageInput.uuid | ||
assert id == cylindricalStorageInput.id | ||
assert operator == cylindricalStorageInput.operator | ||
assert operationTime == cylindricalStorageInput.operationTime | ||
assert thermalBus == cylindricalStorageInput.thermalBus | ||
assert storageVolumeLvl == ThermalUnitInputTestData.storageVolumeLvl | ||
assert storageVolumeLvlMin == ThermalUnitInputTestData.storageVolumeLvlMin | ||
assert inletTemp == ThermalUnitInputTestData.inletTemp | ||
assert returnTemp == ThermalUnitInputTestData.returnTemp | ||
assert c == ThermalUnitInputTestData.c | ||
} | ||
} | ||
} |
30 changes: 30 additions & 0 deletions
30
src/test/groovy/edu/ie3/datamodel/models/input/thermal/ThermalBusInputTest.groovy
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/* | ||
* © 2021. TU Dortmund University, | ||
* Institute of Energy Systems, Energy Efficiency and Energy Economics, | ||
* Research group Distribution grid planning and operation | ||
*/ | ||
package edu.ie3.datamodel.models.input.thermal | ||
|
||
import edu.ie3.test.common.ThermalUnitInputTestData | ||
import spock.lang.Specification | ||
|
||
|
||
class ThermalBusInputTest extends Specification { | ||
|
||
def "A ThermalBusInput copy method should work as expected"() { | ||
given: | ||
def thermalBusInput = ThermalUnitInputTestData.thermalBus | ||
|
||
when: | ||
def alteredUnit = thermalBusInput.copy().build() | ||
|
||
|
||
then: | ||
alteredUnit.with { | ||
assert uuid == thermalBusInput.uuid | ||
assert id == thermalBusInput.id | ||
assert operator == thermalBusInput.operator | ||
assert operationTime == thermalBusInput.operationTime | ||
} | ||
} | ||
} |
34 changes: 34 additions & 0 deletions
34
src/test/groovy/edu/ie3/datamodel/models/input/thermal/ThermalHouseInputTest.groovy
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/* | ||
* © 2021. TU Dortmund University, | ||
* Institute of Energy Systems, Energy Efficiency and Energy Economics, | ||
* Research group Distribution grid planning and operation | ||
*/ | ||
package edu.ie3.datamodel.models.input.thermal | ||
|
||
import edu.ie3.test.common.ThermalUnitInputTestData | ||
import spock.lang.Specification | ||
|
||
|
||
class ThermalHouseInputTest extends Specification { | ||
|
||
def "A ThermalHouseInput copy method should work as expected"() { | ||
given: | ||
def thermalHouseInput = ThermalUnitInputTestData.thermalHouseInput | ||
|
||
when: | ||
def alteredUnit = thermalHouseInput.copy().ethLosses(ThermalUnitInputTestData.thermalConductance) | ||
.ethCapa(ThermalUnitInputTestData.ethCapa).thermalBus(ThermalUnitInputTestData.thermalBus).build() | ||
|
||
|
||
then: | ||
alteredUnit.with { | ||
assert uuid == thermalHouseInput.uuid | ||
assert id == thermalHouseInput.id | ||
assert operator == thermalHouseInput.operator | ||
assert operationTime == thermalHouseInput.operationTime | ||
assert thermalBus == thermalHouseInput.thermalBus | ||
assert ethLosses == ThermalUnitInputTestData.thermalConductance | ||
assert ethCapa == ThermalUnitInputTestData.ethCapa | ||
} | ||
} | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.