Skip to content

Commit 6ff56d8

Browse files
Merge pull request #1003 from ie3-institute/ms/#1000-implement-evcs-validation
Implementing an evcs validation.
2 parents df54e26 + 4ff74fe commit 6ff56d8

File tree

11 files changed

+363
-309
lines changed

11 files changed

+363
-309
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1010
- Formatting Spotless Groovy import order [#960](https://github.com/ie3-institute/PowerSystemDataModel/issues/960)
1111
- Implementing missing typical methods in `Try` [#970](https://github.com/ie3-institute/PowerSystemDataModel/issues/970)
1212
- Added log warning when using `SwitchInputs` with `parallelDevices` parameter [#840](https://github.com/ie3-institute/PowerSystemDataModel/issues/840)
13+
- Validation for `EvcsInput` [#1000](https://github.com/ie3-institute/PowerSystemDataModel/issues/1000)
1314

1415
### Fixed
1516
- Fixed Couchbase integration tests that randomly failed [#755](https://github.com/ie3-institute/PowerSystemDataModel/issues/755)
@@ -31,6 +32,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
3132
- Improving column name validation to only run once per source [#849](https://github.com/ie3-institute/PowerSystemDataModel/issues/849)
3233
- Refactored and abstracted `EntitySource`s and `EntityData` creation [#969](https://github.com/ie3-institute/PowerSystemDataModel/issues/969)
3334
- Updated contributing.md [#737](https://github.com/ie3-institute/PowerSystemDataModel/issues/737)
35+
- Don't throw exceptions for not yet implemented validations [#879](https://github.com/ie3-institute/PowerSystemDataModel/issues/879)
3436

3537
## [4.1.0] - 2023-11-02
3638

src/main/java/edu/ie3/datamodel/exceptions/NotImplementedException.java

Lines changed: 0 additions & 12 deletions
This file was deleted.

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

Lines changed: 86 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
import edu.ie3.datamodel.models.input.connector.type.Transformer3WTypeInput;
1616
import edu.ie3.datamodel.models.input.container.SubGridContainer;
1717
import edu.ie3.datamodel.utils.Try;
18-
import edu.ie3.datamodel.utils.Try.*;
1918
import edu.ie3.util.geo.GeoUtils;
2019
import edu.ie3.util.quantities.QuantityUtil;
2120
import java.util.ArrayList;
@@ -44,8 +43,12 @@ private ConnectorValidationUtils() {
4443
}
4544

4645
/**
47-
* Validates a connector if: <br>
48-
* - it is not null <br>
46+
* Validates a connector if:
47+
*
48+
* <ul>
49+
* <li>it is not null
50+
* </ul>
51+
*
4952
* A "distribution" method, that forwards the check request to specific implementations to fulfill
5053
* the checking task, based on the class of the given object.
5154
*
@@ -73,25 +76,25 @@ protected static List<Try<Void, InvalidEntityException>> check(ConnectorInput co
7376
} else if (SwitchInput.class.isAssignableFrom(connector.getClass())) {
7477
exceptions.add(checkSwitch((SwitchInput) connector));
7578
} else {
76-
exceptions.add(
77-
new Failure<>(
78-
new InvalidEntityException(
79-
"Validation failed due to: ", buildNotImplementedException(connector))));
79+
logNotImplemented(connector);
8080
}
8181

8282
return exceptions;
8383
}
8484

8585
/**
86-
* Validates a line if: <br>
87-
* - {@link ConnectorValidationUtils#checkLineType(LineTypeInput)} confirms valid type properties
88-
* <br>
89-
* - it does not connect the same node <br>
90-
* - it connects nodes in the same subnet <br>
91-
* - it connects nodes in the same voltage level <br>
92-
* - its line length has a positive value <br>
93-
* - its length equals the sum of calculated distances between points of LineString <br>
94-
* - its coordinates of start and end point equal coordinates of nodes
86+
* Validates a line if:
87+
*
88+
* <ul>
89+
* <li>{@link ConnectorValidationUtils#checkLineType(LineTypeInput)} confirms valid type
90+
* properties
91+
* <li>it does not connect the same node
92+
* <li>it connects nodes in the same subnet
93+
* <li>it connects nodes in the same voltage level
94+
* <li>its line length has a positive value
95+
* <li>its length equals the sum of calculated distances between points of LineString
96+
* <li>its coordinates of start and end point equal coordinates of nodes
97+
* </ul>
9598
*
9699
* @param line Line to validate
97100
* @return a list of try objects either containing an {@link InvalidEntityException} or an empty
@@ -116,14 +119,17 @@ private static List<Try<Void, InvalidEntityException>> checkLine(LineInput line)
116119
}
117120

118121
/**
119-
* Validates a line type if: <br>
120-
* - it is not null <br>
121-
* - B is greater/equal to 0 (Phase-to-ground susceptance per length) <br>
122-
* - G is greater/equal to 0 (Phase-to-ground conductance per length) <br>
123-
* - R is greater 0 (Phase resistance per length) <br>
124-
* - X is greater 0 (Phase reactance per length) <br>
125-
* - iMax is greater 0 (Maximum permissible current) <br>
126-
* - vRated is greater 0 (Rated voltage)
122+
* Validates a line type if:
123+
*
124+
* <ul>
125+
* <li>it is not null
126+
* <li>B is greater/equal to 0 (Phase-to-ground susceptance per length)
127+
* <li>G is greater/equal to 0 (Phase-to-ground conductance per length)
128+
* <li>R is greater 0 (Phase resistance per length)
129+
* <li>X is greater 0 (Phase reactance per length)
130+
* <li>iMax is greater 0 (Maximum permissible current)
131+
* <li>vRated is greater 0 (Rated voltage)
132+
* </ul>
127133
*
128134
* @param lineType Line type to validate
129135
* @return a list of try objects either containing an {@link InvalidEntityException} or an empty
@@ -150,13 +156,16 @@ protected static List<Try<Void, InvalidEntityException>> checkLineType(LineTypeI
150156
}
151157

152158
/**
153-
* Validates a transformer2W if: <br>
154-
* - {@link ConnectorValidationUtils#checkTransformer2WType(Transformer2WTypeInput)} confirms a
155-
* valid type properties <br>
156-
* - its tap position is within bounds <br>
157-
* - it connects different subnets <br>
158-
* - it connects different voltage levels <br>
159-
* - its rated voltages match the voltages at the nodes
159+
* Validates a transformer2W if:
160+
*
161+
* <ul>
162+
* <li>{@link ConnectorValidationUtils#checkTransformer2WType(Transformer2WTypeInput)} confirms
163+
* a valid type properties
164+
* <li>its tap position is within bounds
165+
* <li>it connects different subnets
166+
* <li>it connects different voltage levels
167+
* <li>its rated voltages match the voltages at the nodes
168+
* </ul>
160169
*
161170
* @param transformer2W Transformer2W to validate
162171
* @return a list of try objects either containing an {@link InvalidEntityException} or an empty
@@ -180,19 +189,22 @@ private static List<Try<Void, InvalidEntityException>> checkTransformer2W(
180189
}
181190

182191
/**
183-
* Validates a transformer2W type if: <br>
184-
* - it is not null <br>
185-
* - rSc is greater 0 (short circuit resistance) <br>
186-
* - xSc is greater 0 (short circuit impedance) <br>
187-
* - gM is greater/equal to 0 (no load conductance) <br>
188-
* - bM is less/equal to 0 (no load susceptance)<br>
189-
* - sRated is greater 0 (rated apparent power) <br>
190-
* - vRatedA is greater 0 (rated voltage at higher voltage terminal) <br>
191-
* - vRatedB is greater 0 (rated voltage at lower voltage terminal) <br>
192-
* - dV is between 0% and 100% (voltage magnitude increase per tap position <br>
193-
* - dPhi is greater/equal to 0 (voltage angle increase per tap position) <br>
194-
* - neutral tap position is between min and max tap position <br>
195-
* - minimum tap position is smaller than maximum tap position
192+
* Validates a transformer2W type if:
193+
*
194+
* <ul>
195+
* <li>it is not null
196+
* <li>rSc is greater 0 (short circuit resistance)
197+
* <li>xSc is greater 0 (short circuit impedance)
198+
* <li>gM is greater/equal to 0 (no load conductance)
199+
* <li>bM is less/equal to 0 (no load susceptance)
200+
* <li>sRated is greater 0 (rated apparent power)
201+
* <li>vRatedA is greater 0 (rated voltage at higher voltage terminal)
202+
* <li>vRatedB is greater 0 (rated voltage at lower voltage terminal)
203+
* <li>dV is between 0% and 100% (voltage magnitude increase per tap position
204+
* <li>dPhi is greater/equal to 0 (voltage angle increase per tap position)
205+
* <li>neutral tap position is between min and max tap position
206+
* <li>minimum tap position is smaller than maximum tap position
207+
* </ul>
196208
*
197209
* @param transformer2WType Transformer2W type to validate
198210
* @return a list of try objects either containing an {@link InvalidEntityException} or an empty
@@ -233,13 +245,16 @@ protected static List<Try<Void, InvalidEntityException>> checkTransformer2WType(
233245
}
234246

235247
/**
236-
* Validates a transformer3W if: <br>
237-
* - {@link ConnectorValidationUtils#checkTransformer3WType(Transformer3WTypeInput)} confirm a
238-
* valid type <br>
239-
* - its tap position is within bounds <br>
240-
* - it connects different subnets <br>
241-
* - it connects different voltage levels <br>
242-
* - its rated voltages match the voltages at the nodes
248+
* Validates a transformer3W if:
249+
*
250+
* <ul>
251+
* <li>{@link ConnectorValidationUtils#checkTransformer3WType(Transformer3WTypeInput)} confirm a
252+
* valid type
253+
* <li>its tap position is within bounds
254+
* <li>it connects different subnets
255+
* <li>it connects different voltage levels
256+
* <li>its rated voltages match the voltages at the nodes
257+
* </ul>
243258
*
244259
* @param transformer3W Transformer3W to validate
245260
* @return a list of try objects either containing an {@link InvalidEntityException} or an empty
@@ -284,18 +299,21 @@ private static List<Try<Void, InvalidEntityException>> checkTransformer3W(
284299
}
285300

286301
/**
287-
* Validates a transformer3W type if: <br>
288-
* - it is not null <br>
289-
* - rScA, rScB, rScC are greater 0 (short circuit resistance in branches A,B,C) <br>
290-
* - xScA, xScB, xScC are greater 0 (short circuit impedance in branches A,B,C) <br>
291-
* - gM is greater/equal to 0 (no load conductance) <br>
292-
* - bM is less/equal to 0 (no load susceptance) <br>
293-
* - sRatedA, sRatedB, sRatedC are greater 0 (rated apparent power in branches A,B,C) <br>
294-
* - vRatedA, vRatedB, vRatedC are greater 0 (rated voltage at higher node A,B,C) <br>
295-
* - dV is between 0% and 100% (voltage magnitude increase per tap position <br>
296-
* - dPhi is greater/equal to 0 (voltage angle increase per tap position) <br>
297-
* - neutral tap position is between min and max tap position <br>
298-
* - minimum tap position is smaller than maximum tap position <br>
302+
* Validates a transformer3W type if:
303+
*
304+
* <ul>
305+
* <li>it is not null
306+
* <li>rScA, rScB, rScC are greater 0 (short circuit resistance in branches A,B,C)
307+
* <li>xScA, xScB, xScC are greater 0 (short circuit impedance in branches A,B,C)
308+
* <li>gM is greater/equal to 0 (no load conductance)
309+
* <li>bM is less/equal to 0 (no load susceptance)
310+
* <li>sRatedA, sRatedB, sRatedC are greater 0 (rated apparent power in branches A,B,C)
311+
* <li>vRatedA, vRatedB, vRatedC are greater 0 (rated voltage at higher node A,B,C)
312+
* <li>dV is between 0% and 100% (voltage magnitude increase per tap position
313+
* <li>dPhi is greater/equal to 0 (voltage angle increase per tap position)
314+
* <li>neutral tap position is between min and max tap position
315+
* <li>minimum tap position is smaller than maximum tap position
316+
* </ul>
299317
*
300318
* @param transformer3WType Transformer type to validate
301319
* @return a list of try objects either containing an {@link InvalidEntityException} or an empty
@@ -342,8 +360,11 @@ protected static List<Try<Void, InvalidEntityException>> checkTransformer3WType(
342360
}
343361

344362
/**
345-
* Validates a switch if: <br>
346-
* - its connected nodes are in the same voltage level
363+
* Validates a switch if:
364+
*
365+
* <ul>
366+
* <li>its connected nodes are in the same voltage level
367+
* </ul>
347368
*
348369
* @param switchInput Switch to validate
349370
* @return a try object either containing an {@link InvalidEntityException} or an empty Success

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

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,12 @@ private GraphicValidationUtils() {
2121
}
2222

2323
/**
24-
* Validates a graphic input if: <br>
25-
* - it is not null <br>
26-
* - its graphic layer is not null <br>
24+
* Validates a graphic input if:
25+
*
26+
* <ul>
27+
* <li>it is not null
28+
* <li>its graphic layer is not null
29+
* </ul>
2730
*
2831
* <p>A "distribution" method, that forwards the check request to specific implementations to
2932
* fulfill the checking task, based on the class of the given object.
@@ -59,8 +62,11 @@ protected static List<Try<Void, InvalidEntityException>> check(GraphicInput grap
5962
}
6063

6164
/**
62-
* Validates a line graphic input if: <br>
63-
* - its path is not null
65+
* Validates a line graphic input if:
66+
*
67+
* <ul>
68+
* <li>its path is not null
69+
* </ul>
6470
*
6571
* @param lineGraphicInput LineGraphicInput to validate
6672
*/
@@ -74,9 +80,12 @@ private static Try<Void, InvalidEntityException> checkLineGraphicInput(
7480
}
7581

7682
/**
77-
* Validates a node graphic input if: <br>
78-
* - its node is not null <br>
79-
* - its point is not null
83+
* Validates a node graphic input if:
84+
*
85+
* <ul>
86+
* <li>its node is not null
87+
* <li>its point is not null
88+
* </ul>
8089
*
8190
* @param nodeGraphicInput NodeGraphicInput to validate
8291
*/

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

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,12 @@ private MeasurementUnitValidationUtils() {
1919
}
2020

2121
/**
22-
* Validates a measurement unit if: <br>
23-
* - it is not null <br>
24-
* - any values are measured
22+
* Validates a measurement unit if:
23+
*
24+
* <ul>
25+
* <li>it is not null
26+
* <li>any values are measured
27+
* </ul>
2528
*
2629
* @param measurementUnit Measurement unit to validate
2730
* @return a try object either containing an {@link ValidationException} or an empty Success

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

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,15 @@ private NodeValidationUtils() {
2424
}
2525

2626
/**
27-
* Validates a node if: <br>
28-
* - it is not null <br>
29-
* - voltage level is not null and valid <br>
30-
* - target voltage is larger than zero and smaller than two <br>
31-
* - subnet number is larger than zero <br>
32-
* - geoPosition is not null
27+
* Validates a node if:
28+
*
29+
* <ul>
30+
* <li>it is not null
31+
* <li>voltage level is not null and valid
32+
* <li>target voltage is larger than zero and smaller than two
33+
* <li>subnet number is larger than zero
34+
* <li>geoPosition is not null
35+
* </ul>
3336
*
3437
* @param node Node to validate
3538
* @return a list of try objects either containing an {@link ValidationException} or an empty

0 commit comments

Comments
 (0)