Skip to content

Commit 8ebb413

Browse files
muradiodevckittlt-obersebastian-peterdanielfeismann
authored
Misleading parameter name 'height' has changed to 'elevationAngle' (#443)
* mh/#393-Misleading parameter name 'height' has changed to 'elevationAngle' in PvInput * fix formatting * fix variable height to elevationAngle in PvInputTest.groovy * fix variable height to elevationAngle in some classes * fix variable height to elevationAngle in PvInputFactoryTest.groovy * fix variable height to elevationAngle in PvInputFactory and Test * fix variable height to elevationAngle in PvInputFactory and Test * fix variable height to elevationAngle in pv_input and CsvSystemParticipantSourceTest * fix variable height to elevationAngle in PvInputFactoryTest.groovy * Adapting tests to refactored field * Add changed name of parameter height to elevationAngle to Changelog * More related refactoring in comments and tests Co-authored-by: Chris Kittl <[email protected]> Co-authored-by: t-ober <[email protected]> Co-authored-by: Sebastian Peter <[email protected]> Co-authored-by: danielfeismann <[email protected]> Co-authored-by: Sebastian Peter <[email protected]>
1 parent 605898f commit 8ebb413

File tree

15 files changed

+53
-49
lines changed

15 files changed

+53
-49
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2525
- Let JavDoc pass, if there are warnings **ATTENTION:** Should be removed, when JavaDoc is fixed! (cf. Issue [#494](https://github.com/ie3-institute/PowerSystemDataModel/issues/494))
2626

2727
### Changed
28+
- BREAKING: PvInput Model parameter name height changed to elevationAngle [#393](https://github.com/ie3-institute/PowerSystemDataModel/issues/393) :warning:
2829
- BREAKING: Transformer's no load susceptance needs to be zero or negative to pass model validation [#378](https://github.com/ie3-institute/PowerSystemDataModel/issues/378)
2930
- All input data sets for version < 3.0.0 need to be altered!
3031
- Deprecating (as part of [#513](https://github.com/ie3-institute/PowerSystemDataModel/issues/513)):

docs/readthedocs/models/input/participant/pv.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Detailed model of a photovoltaic power plant.
2626
+------------------+---------+--------------------------------------------------------------------------------------+
2727
| etaConv | % | Efficiency of the assets inverter |
2828
+------------------+---------+--------------------------------------------------------------------------------------+
29-
| height | ° | Tilted inclination from horizontal [0°, 90°] |
29+
| elevationAngle | ° | Tilted inclination from horizontal [0°, 90°] |
3030
+------------------+---------+--------------------------------------------------------------------------------------+
3131
| kG | -- | Generator correction factor merging technical influences |
3232
+------------------+---------+--------------------------------------------------------------------------------------+

docs/uml/main/input/SystemDatamodelConcept.puml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ package models {
233233
- albedo: Double
234234
- azimuth: ComparableQuantity<Angle> [°]
235235
- etaConv: ComparableQuantity<Dimensionless> [%]
236-
- height: ComparableQuantity<Angle> [°]
236+
- elevationAngle: ComparableQuantity<Angle> [°]
237237
- kG: Double
238238
- kT: Double
239239
- marketReaction: Boolean

src/main/java/edu/ie3/datamodel/io/factory/input/participant/PvInputFactory.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public class PvInputFactory
2222
private static final String ALBEDO = "albedo";
2323
private static final String AZIMUTH = "azimuth";
2424
private static final String ETA_CONV = "etaconv";
25-
private static final String HEIGHT = "height";
25+
private static final String ELEVATION_ANGLE = "elevationangle";
2626
private static final String KG = "kg";
2727
private static final String KT = "kt";
2828
private static final String MARKET_REACTION = "marketreaction";
@@ -36,7 +36,7 @@ public PvInputFactory() {
3636
@Override
3737
protected String[] getAdditionalFields() {
3838
return new String[] {
39-
ALBEDO, AZIMUTH, ETA_CONV, HEIGHT, KG, KT, MARKET_REACTION, S_RATED, COS_PHI_RATED
39+
ALBEDO, AZIMUTH, ETA_CONV, ELEVATION_ANGLE, KG, KT, MARKET_REACTION, S_RATED, COS_PHI_RATED
4040
};
4141
}
4242

@@ -53,7 +53,8 @@ protected PvInput buildModel(
5353
final ComparableQuantity<Angle> azimuth = data.getQuantity(AZIMUTH, StandardUnits.AZIMUTH);
5454
final ComparableQuantity<Dimensionless> etaConv =
5555
data.getQuantity(ETA_CONV, StandardUnits.EFFICIENCY);
56-
final ComparableQuantity<Angle> height = data.getQuantity(HEIGHT, StandardUnits.SOLAR_HEIGHT);
56+
final ComparableQuantity<Angle> elevationAngle =
57+
data.getQuantity(ELEVATION_ANGLE, StandardUnits.SOLAR_ELEVATION_ANGLE);
5758
final double kG = data.getDouble(KG);
5859
final double kT = data.getDouble(KT);
5960
final boolean marketReaction = data.getBoolean(MARKET_REACTION);
@@ -70,7 +71,7 @@ protected PvInput buildModel(
7071
albedo,
7172
azimuth,
7273
etaConv,
73-
height,
74+
elevationAngle,
7475
kG,
7576
kT,
7677
marketReaction,

src/main/java/edu/ie3/datamodel/models/StandardUnits.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ public class StandardUnits {
9999
/** Orientation of a pv panel with regard to the north-south line in degree_geom */
100100
public static final Unit<Angle> AZIMUTH = DEGREE_GEOM;
101101
/** Elevation of a pv panel with regard to the plane in degree_geom */
102-
public static final Unit<Angle> SOLAR_HEIGHT = DEGREE_GEOM;
102+
public static final Unit<Angle> SOLAR_ELEVATION_ANGLE = DEGREE_GEOM;
103103
/** Direction of the wind in degree geom */
104104
public static final Unit<Angle> WIND_DIRECTION = DEGREE_GEOM;
105105
/** Velocity of the wind in metre per second */

src/main/java/edu/ie3/datamodel/models/input/system/PvInput.java

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public class PvInput extends SystemParticipantInput {
2727
/** Efficiency of converter (typically in %) */
2828
private final ComparableQuantity<Dimensionless> etaConv;
2929
/** Tilted inclination from horizontal (typically in °) */
30-
private final ComparableQuantity<Angle> height;
30+
private final ComparableQuantity<Angle> elevationAngle;
3131
/** Generator correction factor merging different technical influences */
3232
private final double kG;
3333
/** Temperature correction factor */
@@ -51,7 +51,7 @@ public class PvInput extends SystemParticipantInput {
5151
* @param albedo Albedo value (typically a value between 0 and 1)
5252
* @param azimuth Inclination in a compass direction (typically °: South 0◦; West 90◦; East -90◦)
5353
* @param etaConv Efficiency of converter (typically in %)
54-
* @param height Tilted inclination from horizontal (typically in °)
54+
* @param elevationAngle Tilted inclination from horizontal (typically in °)
5555
* @param kG Generator correction factor merging different technical influences
5656
* @param kT Generator correction factor merging different technical influences
5757
* @param marketReaction Is this asset market oriented?
@@ -68,7 +68,7 @@ public PvInput(
6868
double albedo,
6969
ComparableQuantity<Angle> azimuth,
7070
ComparableQuantity<Dimensionless> etaConv,
71-
ComparableQuantity<Angle> height,
71+
ComparableQuantity<Angle> elevationAngle,
7272
double kG,
7373
double kT,
7474
boolean marketReaction,
@@ -78,7 +78,7 @@ public PvInput(
7878
this.albedo = albedo;
7979
this.azimuth = azimuth.to(StandardUnits.AZIMUTH);
8080
this.etaConv = etaConv.to(StandardUnits.EFFICIENCY);
81-
this.height = height.to(StandardUnits.SOLAR_HEIGHT);
81+
this.elevationAngle = elevationAngle.to(StandardUnits.SOLAR_ELEVATION_ANGLE);
8282
this.kG = kG;
8383
this.kT = kT;
8484
this.marketReaction = marketReaction;
@@ -96,7 +96,7 @@ public PvInput(
9696
* @param albedo Albedo value (typically a value between 0 and 1)
9797
* @param azimuth Inclination in a compass direction (typically °: South 0◦; West 90◦; East -90◦)
9898
* @param etaConv Efficiency of converter (typically in %)
99-
* @param height Tilted inclination from horizontal (typically in °)
99+
* @param elevationAngle Tilted inclination from horizontal (typically in °)
100100
* @param kG Generator correction factor merging different technical influences
101101
* @param kT Generator correction factor merging different technical influences
102102
* @param marketReaction Is this asset market oriented?
@@ -111,7 +111,7 @@ public PvInput(
111111
double albedo,
112112
ComparableQuantity<Angle> azimuth,
113113
ComparableQuantity<Dimensionless> etaConv,
114-
ComparableQuantity<Angle> height,
114+
ComparableQuantity<Angle> elevationAngle,
115115
double kG,
116116
double kT,
117117
boolean marketReaction,
@@ -121,7 +121,7 @@ public PvInput(
121121
this.albedo = albedo;
122122
this.azimuth = azimuth.to(StandardUnits.AZIMUTH);
123123
this.etaConv = etaConv.to(StandardUnits.EFFICIENCY);
124-
this.height = height.to(StandardUnits.SOLAR_HEIGHT);
124+
this.elevationAngle = elevationAngle.to(StandardUnits.SOLAR_ELEVATION_ANGLE);
125125
this.kG = kG;
126126
this.kT = kT;
127127
this.marketReaction = marketReaction;
@@ -141,8 +141,8 @@ public ComparableQuantity<Dimensionless> getEtaConv() {
141141
return etaConv;
142142
}
143143

144-
public ComparableQuantity<Angle> getHeight() {
145-
return height;
144+
public ComparableQuantity<Angle> getElevationAngle() {
145+
return elevationAngle;
146146
}
147147

148148
public boolean isMarketReaction() {
@@ -181,7 +181,7 @@ public boolean equals(Object o) {
181181
&& Double.compare(pvInput.cosPhiRated, cosPhiRated) == 0
182182
&& azimuth.equals(pvInput.azimuth)
183183
&& etaConv.equals(pvInput.etaConv)
184-
&& height.equals(pvInput.height)
184+
&& elevationAngle.equals(pvInput.elevationAngle)
185185
&& sRated.equals(pvInput.sRated);
186186
}
187187

@@ -192,7 +192,7 @@ public int hashCode() {
192192
albedo,
193193
azimuth,
194194
etaConv,
195-
height,
195+
elevationAngle,
196196
kG,
197197
kT,
198198
marketReaction,
@@ -222,8 +222,8 @@ public String toString() {
222222
+ azimuth
223223
+ ", etaConv="
224224
+ etaConv
225-
+ ", height="
226-
+ height
225+
+ ", elevationAngle="
226+
+ elevationAngle
227227
+ ", kG="
228228
+ kG
229229
+ ", kT="
@@ -250,7 +250,7 @@ public static class PvInputCopyBuilder
250250
private double albedo;
251251
private ComparableQuantity<Angle> azimuth;
252252
private ComparableQuantity<Dimensionless> etaConv;
253-
private ComparableQuantity<Angle> height;
253+
private ComparableQuantity<Angle> elevationAngle;
254254
private double kG;
255255
private double kT;
256256
private boolean marketReaction;
@@ -262,7 +262,7 @@ public PvInputCopyBuilder(PvInput entity) {
262262
this.albedo = entity.getAlbedo();
263263
this.azimuth = entity.getAzimuth();
264264
this.etaConv = entity.getEtaConv();
265-
this.height = entity.getHeight();
265+
this.elevationAngle = entity.getElevationAngle();
266266
this.kG = entity.getkG();
267267
this.kT = entity.getkT();
268268
this.marketReaction = entity.isMarketReaction();
@@ -285,8 +285,8 @@ public PvInputCopyBuilder etaConv(ComparableQuantity<Dimensionless> etaConv) {
285285
return this;
286286
}
287287

288-
public PvInputCopyBuilder height(ComparableQuantity<Angle> height) {
289-
this.height = height;
288+
public PvInputCopyBuilder elevationAngle(ComparableQuantity<Angle> elevationAngle) {
289+
this.elevationAngle = elevationAngle;
290290
return this;
291291
}
292292

@@ -327,7 +327,7 @@ public PvInput build() {
327327
albedo,
328328
azimuth,
329329
etaConv,
330-
height,
330+
elevationAngle,
331331
kG,
332332
kT,
333333
marketReaction,

src/main/java/edu/ie3/datamodel/utils/validation/SystemParticipantValidationUtils.java

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -238,9 +238,9 @@ private static void checkLoad(LoadInput loadInput) {
238238
* Validates a PvInput if: <br>
239239
* - its rated apparent power is not negative <br>
240240
* - its albedo value of the plant's surrounding is between 0 and 1 <br>
241-
* - its inclination in a compass direction (azimuth) is is between -90° and 90° <br>
242-
* - its efficiency of the asset's inverter (etaConv) is is between 0% and 100% <br>
243-
* - its tilted inclination from horizontal (height) is is between 0° and 90° <br>
241+
* - its inclination in a compass direction (azimuth) is between -90° and 90° <br>
242+
* - its efficiency of the asset's inverter (etaConv) is between 0% and 100% <br>
243+
* - its tilted inclination from horizontal (elevation angle) is between 0° and 90° <br>
244244
* - its rated power factor is between 0 and 1
245245
*
246246
* @param pvInput PvInput to validate
@@ -250,7 +250,7 @@ private static void checkPv(PvInput pvInput) {
250250
checkAlbedo(pvInput);
251251
checkAzimuth(pvInput);
252252
isBetweenZeroAndHundredPercent(pvInput, pvInput.getEtaConv(), "Efficiency of the converter");
253-
checkHeight(pvInput);
253+
checkElevationAngle(pvInput);
254254
checkRatedPowerFactor(pvInput, pvInput.getCosPhiRated());
255255
}
256256

@@ -288,9 +288,11 @@ private static void checkAzimuth(PvInput pvInput) {
288288
*
289289
* @param pvInput PvInput to validate
290290
*/
291-
private static void checkHeight(PvInput pvInput) {
292-
if (pvInput.getHeight().isLessThan(Quantities.getQuantity(0d, SOLAR_HEIGHT))
293-
|| pvInput.getHeight().isGreaterThan(Quantities.getQuantity(90d, SOLAR_HEIGHT)))
291+
private static void checkElevationAngle(PvInput pvInput) {
292+
if (pvInput.getElevationAngle().isLessThan(Quantities.getQuantity(0d, SOLAR_ELEVATION_ANGLE))
293+
|| pvInput
294+
.getElevationAngle()
295+
.isGreaterThan(Quantities.getQuantity(90d, SOLAR_ELEVATION_ANGLE)))
294296
throw new InvalidEntityException(
295297
"Tilted inclination from horizontal of "
296298
+ pvInput.getClass().getSimpleName()

src/test/groovy/edu/ie3/datamodel/io/factory/input/participant/PvInputFactoryTest.groovy

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class PvInputFactoryTest extends Specification implements FactoryTestHelper {
4242
"albedo" : "3",
4343
"azimuth" : "4",
4444
"etaconv" : "5",
45-
"height" : "6",
45+
"elevationangle" : "6",
4646
"kg" : "7",
4747
"kt" : "8",
4848
"marketreaction" : "true",
@@ -78,7 +78,7 @@ class PvInputFactoryTest extends Specification implements FactoryTestHelper {
7878
assert albedo == Double.parseDouble(parameter["albedo"])
7979
assert azimuth == getQuant(parameter["azimuth"], StandardUnits.AZIMUTH)
8080
assert etaConv == getQuant(parameter["etaconv"], StandardUnits.EFFICIENCY)
81-
assert height == getQuant(parameter["height"], StandardUnits.SOLAR_HEIGHT)
81+
assert elevationAngle == getQuant(parameter["elevationangle"], StandardUnits.SOLAR_ELEVATION_ANGLE)
8282
assert kG == Double.parseDouble(parameter["kg"])
8383
assert kT == Double.parseDouble(parameter["kt"])
8484
assert marketReaction

src/test/groovy/edu/ie3/datamodel/io/processor/input/InputEntityProcessorTest.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ class InputEntityProcessorTest extends Specification {
173173
"azimuth" : SystemParticipantTestData.pvInput.azimuth.to(StandardUnits.AZIMUTH).getValue().doubleValue().toString(),
174174
"cosPhiRated" : SystemParticipantTestData.pvInput.cosPhiRated.toString(),
175175
"etaConv" : SystemParticipantTestData.pvInput.etaConv.getValue().doubleValue().toString(),
176-
"height" : SystemParticipantTestData.pvInput.height.getValue().doubleValue().toString(),
176+
"elevationAngle" : SystemParticipantTestData.pvInput.elevationAngle.getValue().doubleValue().toString(),
177177
"id" : SystemParticipantTestData.pvInput.id,
178178
"kG" : SystemParticipantTestData.pvInput.kG.toString(),
179179
"kT" : SystemParticipantTestData.pvInput.kT.toString(),

src/test/groovy/edu/ie3/datamodel/io/source/csv/CsvSystemParticipantSourceTest.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ class CsvSystemParticipantSourceTest extends Specification implements CsvTestDat
353353
nodes | operators || resultingSize || resultingSet
354354
[sptd.pvInput.node]| [sptd.pvInput.operator]|| 1 || [sptd.pvInput]
355355
[sptd.pvInput.node]| []|| 1 || [
356-
new PvInput(sptd.pvInput.uuid, sptd.pvInput.id, OperatorInput.NO_OPERATOR_ASSIGNED, sptd.pvInput.operationTime, sptd.pvInput.node, sptd.pvInput.qCharacteristics, sptd.pvInput.albedo, sptd.pvInput.azimuth, sptd.pvInput.etaConv, sptd.pvInput.height, sptd.pvInput.kG, sptd.pvInput.kT, sptd.pvInput.marketReaction, sptd.pvInput.sRated, sptd.pvInput.cosPhiRated)
356+
new PvInput(sptd.pvInput.uuid, sptd.pvInput.id, OperatorInput.NO_OPERATOR_ASSIGNED, sptd.pvInput.operationTime, sptd.pvInput.node, sptd.pvInput.qCharacteristics, sptd.pvInput.albedo, sptd.pvInput.azimuth, sptd.pvInput.etaConv, sptd.pvInput.elevationAngle, sptd.pvInput.kG, sptd.pvInput.kT, sptd.pvInput.marketReaction, sptd.pvInput.sRated, sptd.pvInput.cosPhiRated)
357357
]
358358
[]| [sptd.pvInput.operator]|| 0 || []
359359
[]| []|| 0 || []

0 commit comments

Comments
 (0)