Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Formatting Spotless Groovy import order [#960](https://github.com/ie3-institute/PowerSystemDataModel/issues/960)
- Implementing missing typical methods in `Try` [#970](https://github.com/ie3-institute/PowerSystemDataModel/issues/970)
- Added log warning when using `SwitchInputs` with `parallelDevices` parameter [#840](https://github.com/ie3-institute/PowerSystemDataModel/issues/840)
- Validation for `EvcsInput` [#1000](https://github.com/ie3-institute/PowerSystemDataModel/issues/1000)

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

## [4.1.0] - 2023-11-02

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
import edu.ie3.datamodel.models.input.connector.type.Transformer3WTypeInput;
import edu.ie3.datamodel.models.input.container.SubGridContainer;
import edu.ie3.datamodel.utils.Try;
import edu.ie3.datamodel.utils.Try.*;
import edu.ie3.util.geo.GeoUtils;
import edu.ie3.util.quantities.QuantityUtil;
import java.util.ArrayList;
Expand Down Expand Up @@ -44,8 +43,12 @@ private ConnectorValidationUtils() {
}

/**
* Validates a connector if: <br>
* - it is not null <br>
* Validates a connector if:
*
* <ul>
* <li>it is not null
* </ul>
*
* A "distribution" method, that forwards the check request to specific implementations to fulfill
* the checking task, based on the class of the given object.
*
Expand Down Expand Up @@ -73,25 +76,25 @@ protected static List<Try<Void, InvalidEntityException>> check(ConnectorInput co
} else if (SwitchInput.class.isAssignableFrom(connector.getClass())) {
exceptions.add(checkSwitch((SwitchInput) connector));
} else {
exceptions.add(
new Failure<>(
new InvalidEntityException(
"Validation failed due to: ", buildNotImplementedException(connector))));
logNotImplemented(connector);
}

return exceptions;
}

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

/**
* Validates a line type if: <br>
* - it is not null <br>
* - B is greater/equal to 0 (Phase-to-ground susceptance per length) <br>
* - G is greater/equal to 0 (Phase-to-ground conductance per length) <br>
* - R is greater 0 (Phase resistance per length) <br>
* - X is greater 0 (Phase reactance per length) <br>
* - iMax is greater 0 (Maximum permissible current) <br>
* - vRated is greater 0 (Rated voltage)
* Validates a line type if:
*
* <ul>
* <li>it is not null
* <li>B is greater/equal to 0 (Phase-to-ground susceptance per length)
* <li>G is greater/equal to 0 (Phase-to-ground conductance per length)
* <li>R is greater 0 (Phase resistance per length)
* <li>X is greater 0 (Phase reactance per length)
* <li>iMax is greater 0 (Maximum permissible current)
* <li>vRated is greater 0 (Rated voltage)
* </ul>
*
* @param lineType Line type to validate
* @return a list of try objects either containing an {@link InvalidEntityException} or an empty
Expand All @@ -150,13 +156,16 @@ protected static List<Try<Void, InvalidEntityException>> checkLineType(LineTypeI
}

/**
* Validates a transformer2W if: <br>
* - {@link ConnectorValidationUtils#checkTransformer2WType(Transformer2WTypeInput)} confirms a
* valid type properties <br>
* - its tap position is within bounds <br>
* - it connects different subnets <br>
* - it connects different voltage levels <br>
* - its rated voltages match the voltages at the nodes
* Validates a transformer2W if:
*
* <ul>
* <li>{@link ConnectorValidationUtils#checkTransformer2WType(Transformer2WTypeInput)} confirms
* a valid type properties
* <li>its tap position is within bounds
* <li>it connects different subnets
* <li>it connects different voltage levels
* <li>its rated voltages match the voltages at the nodes
* </ul>
*
* @param transformer2W Transformer2W to validate
* @return a list of try objects either containing an {@link InvalidEntityException} or an empty
Expand All @@ -180,19 +189,22 @@ private static List<Try<Void, InvalidEntityException>> checkTransformer2W(
}

/**
* Validates a transformer2W type if: <br>
* - it is not null <br>
* - rSc is greater 0 (short circuit resistance) <br>
* - xSc is greater 0 (short circuit impedance) <br>
* - gM is greater/equal to 0 (no load conductance) <br>
* - bM is less/equal to 0 (no load susceptance)<br>
* - sRated is greater 0 (rated apparent power) <br>
* - vRatedA is greater 0 (rated voltage at higher voltage terminal) <br>
* - vRatedB is greater 0 (rated voltage at lower voltage terminal) <br>
* - dV is between 0% and 100% (voltage magnitude increase per tap position <br>
* - dPhi is greater/equal to 0 (voltage angle increase per tap position) <br>
* - neutral tap position is between min and max tap position <br>
* - minimum tap position is smaller than maximum tap position
* Validates a transformer2W type if:
*
* <ul>
* <li>it is not null
* <li>rSc is greater 0 (short circuit resistance)
* <li>xSc is greater 0 (short circuit impedance)
* <li>gM is greater/equal to 0 (no load conductance)
* <li>bM is less/equal to 0 (no load susceptance)
* <li>sRated is greater 0 (rated apparent power)
* <li>vRatedA is greater 0 (rated voltage at higher voltage terminal)
* <li>vRatedB is greater 0 (rated voltage at lower voltage terminal)
* <li>dV is between 0% and 100% (voltage magnitude increase per tap position
* <li>dPhi is greater/equal to 0 (voltage angle increase per tap position)
* <li>neutral tap position is between min and max tap position
* <li>minimum tap position is smaller than maximum tap position
* </ul>
*
* @param transformer2WType Transformer2W type to validate
* @return a list of try objects either containing an {@link InvalidEntityException} or an empty
Expand Down Expand Up @@ -233,13 +245,16 @@ protected static List<Try<Void, InvalidEntityException>> checkTransformer2WType(
}

/**
* Validates a transformer3W if: <br>
* - {@link ConnectorValidationUtils#checkTransformer3WType(Transformer3WTypeInput)} confirm a
* valid type <br>
* - its tap position is within bounds <br>
* - it connects different subnets <br>
* - it connects different voltage levels <br>
* - its rated voltages match the voltages at the nodes
* Validates a transformer3W if:
*
* <ul>
* <li>{@link ConnectorValidationUtils#checkTransformer3WType(Transformer3WTypeInput)} confirm a
* valid type
* <li>its tap position is within bounds
* <li>it connects different subnets
* <li>it connects different voltage levels
* <li>its rated voltages match the voltages at the nodes
* </ul>
*
* @param transformer3W Transformer3W to validate
* @return a list of try objects either containing an {@link InvalidEntityException} or an empty
Expand Down Expand Up @@ -284,18 +299,21 @@ private static List<Try<Void, InvalidEntityException>> checkTransformer3W(
}

/**
* Validates a transformer3W type if: <br>
* - it is not null <br>
* - rScA, rScB, rScC are greater 0 (short circuit resistance in branches A,B,C) <br>
* - xScA, xScB, xScC are greater 0 (short circuit impedance in branches A,B,C) <br>
* - gM is greater/equal to 0 (no load conductance) <br>
* - bM is less/equal to 0 (no load susceptance) <br>
* - sRatedA, sRatedB, sRatedC are greater 0 (rated apparent power in branches A,B,C) <br>
* - vRatedA, vRatedB, vRatedC are greater 0 (rated voltage at higher node A,B,C) <br>
* - dV is between 0% and 100% (voltage magnitude increase per tap position <br>
* - dPhi is greater/equal to 0 (voltage angle increase per tap position) <br>
* - neutral tap position is between min and max tap position <br>
* - minimum tap position is smaller than maximum tap position <br>
* Validates a transformer3W type if:
*
* <ul>
* <li>it is not null
* <li>rScA, rScB, rScC are greater 0 (short circuit resistance in branches A,B,C)
* <li>xScA, xScB, xScC are greater 0 (short circuit impedance in branches A,B,C)
* <li>gM is greater/equal to 0 (no load conductance)
* <li>bM is less/equal to 0 (no load susceptance)
* <li>sRatedA, sRatedB, sRatedC are greater 0 (rated apparent power in branches A,B,C)
* <li>vRatedA, vRatedB, vRatedC are greater 0 (rated voltage at higher node A,B,C)
* <li>dV is between 0% and 100% (voltage magnitude increase per tap position
* <li>dPhi is greater/equal to 0 (voltage angle increase per tap position)
* <li>neutral tap position is between min and max tap position
* <li>minimum tap position is smaller than maximum tap position
* </ul>
*
* @param transformer3WType Transformer type to validate
* @return a list of try objects either containing an {@link InvalidEntityException} or an empty
Expand Down Expand Up @@ -342,8 +360,11 @@ protected static List<Try<Void, InvalidEntityException>> checkTransformer3WType(
}

/**
* Validates a switch if: <br>
* - its connected nodes are in the same voltage level
* Validates a switch if:
*
* <ul>
* <li>its connected nodes are in the same voltage level
* </ul>
*
* @param switchInput Switch to validate
* @return a try object either containing an {@link InvalidEntityException} or an empty Success
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,12 @@ private GraphicValidationUtils() {
}

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

/**
* Validates a line graphic input if: <br>
* - its path is not null
* Validates a line graphic input if:
*
* <ul>
* <li>its path is not null
* </ul>
*
* @param lineGraphicInput LineGraphicInput to validate
*/
Expand All @@ -74,9 +80,12 @@ private static Try<Void, InvalidEntityException> checkLineGraphicInput(
}

/**
* Validates a node graphic input if: <br>
* - its node is not null <br>
* - its point is not null
* Validates a node graphic input if:
*
* <ul>
* <li>its node is not null
* <li>its point is not null
* </ul>
*
* @param nodeGraphicInput NodeGraphicInput to validate
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,12 @@ private MeasurementUnitValidationUtils() {
}

/**
* Validates a measurement unit if: <br>
* - it is not null <br>
* - any values are measured
* Validates a measurement unit if:
*
* <ul>
* <li>it is not null
* <li>any values are measured
* </ul>
*
* @param measurementUnit Measurement unit to validate
* @return a try object either containing an {@link ValidationException} or an empty Success
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,15 @@ private NodeValidationUtils() {
}

/**
* Validates a node if: <br>
* - it is not null <br>
* - voltage level is not null and valid <br>
* - target voltage is larger than zero and smaller than two <br>
* - subnet number is larger than zero <br>
* - geoPosition is not null
* Validates a node if:
*
* <ul>
* <li>it is not null
* <li>voltage level is not null and valid
* <li>target voltage is larger than zero and smaller than two
* <li>subnet number is larger than zero
* <li>geoPosition is not null
* </ul>
*
* @param node Node to validate
* @return a list of try objects either containing an {@link ValidationException} or an empty
Expand Down
Loading