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: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed
- Fixed small issues in tests [#1400](https://github.com/ie3-institute/PowerSystemDataModel/issues/1400)
- Fix transformer susceptance in readTheDocs to negative values [#1078](https://github.com/ie3-institute/PowerSystemDataModel/issues/1078)

- Added mising fields to field validation [#1422](https://github.com/ie3-institute/PowerSystemDataModel/issues/1422)

### Changed
- Updated CI-Pipeline to run task `Deploy` and `Staging` only for `Main` [#1403](https://github.com/ie3-institute/PowerSystemDataModel/issues/1403)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
package edu.ie3.datamodel.io.factory.input;

import edu.ie3.datamodel.models.StandardUnits;
import edu.ie3.datamodel.models.input.AssetInput;
import edu.ie3.datamodel.models.input.thermal.AbstractStorageInput;
import edu.ie3.util.quantities.interfaces.SpecificHeatCapacity;
import javax.measure.quantity.Power;
import javax.measure.quantity.Temperature;
import javax.measure.quantity.Volume;
import tech.units.indriya.ComparableQuantity;

public abstract class AbstractThermalStorageInputFactory<T extends AssetInput>
public abstract class AbstractThermalStorageInputFactory<T extends AbstractStorageInput>
extends AssetInputEntityFactory<T, ThermalUnitInputEntityData> {

private static final String STORAGE_VOLUME_LVL = "storageVolumeLvl";
Expand All @@ -22,7 +22,7 @@
private static final String C = "c";
private static final String P_THERMAL_MAX = "pThermalMax";

public AbstractThermalStorageInputFactory(Class<T> clazz) {

Check warning on line 25 in src/main/java/edu/ie3/datamodel/io/factory/input/AbstractThermalStorageInputFactory.java

View check run for this annotation

SonarQubeGithubPRChecks / SonarQube Code Analysis

src/main/java/edu/ie3/datamodel/io/factory/input/AbstractThermalStorageInputFactory.java#L25

Change the visibility of this constructor to "protected".
super(clazz);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ public abstract class ConnectorInputEntityFactory<
T extends ConnectorInput, D extends ConnectorInputEntityData>
extends AssetInputEntityFactory<T, D> {

protected static final String NODE_A = "nodeA";
protected static final String NODE_B = "nodeB";

/**
* Attribute that _can_, but does not _have to_ be present for the creation of {@link
* ConnectorInput}s. Thus, this attribute name declaration can be used in subclasses of {@link
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,17 @@ public class LineInputFactory
private static final String LENGTH = "length";
private static final String GEO_POSITION = "geoPosition";
private static final String OLM_CHARACTERISTIC = "olmCharacteristic";
private static final String TYPE = "type";

public LineInputFactory() {
super(LineInput.class);
}

@Override
protected String[] getAdditionalFields() {
return new String[] {PARALLEL_DEVICES, LENGTH, GEO_POSITION, OLM_CHARACTERISTIC};
return new String[] {
NODE_A, NODE_B, PARALLEL_DEVICES, LENGTH, GEO_POSITION, OLM_CHARACTERISTIC, TYPE
};
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

public class MeasurementUnitInputFactory
extends AssetInputEntityFactory<MeasurementUnitInput, NodeAssetInputEntityData> {
private static final String NODE = "node";
private static final String V_MAG = "vMag";
private static final String V_ANG = "vAng";
private static final String P = "p";
Expand All @@ -24,7 +25,7 @@ public MeasurementUnitInputFactory() {

@Override
protected String[] getAdditionalFields() {
return new String[] {V_MAG, V_ANG, P, Q};
return new String[] {NODE, V_MAG, V_ANG, P, Q};
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public SwitchInputFactory() {

@Override
protected String[] getAdditionalFields() {
return new String[] {CLOSED};
return new String[] {NODE_A, NODE_B, CLOSED};
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public Transformer2WInputFactory() {

@Override
protected String[] getAdditionalFields() {
return new String[] {PARALLEL_DEVICES, TAP_POS, AUTO_TAP};
return new String[] {NODE_A, NODE_B, PARALLEL_DEVICES, TAP_POS, AUTO_TAP};
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,15 @@ public class Transformer3WInputFactory

private static final String TAP_POS = "tapPos";
private static final String AUTO_TAP = "autoTap";
private static final String NODE_C = "nodeC";

public Transformer3WInputFactory() {
super(Transformer3WInput.class);
}

@Override
protected String[] getAdditionalFields() {
return new String[] {PARALLEL_DEVICES, TAP_POS, AUTO_TAP};
return new String[] {NODE_A, NODE_B, NODE_C, PARALLEL_DEVICES, TAP_POS, AUTO_TAP};
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ public abstract class GraphicInputFactory<T extends GraphicInput, D extends Enti
private static final String GRAPHIC_LAYER = "graphicLayer";
private static final String PATH_LINE_STRING = "path";

@SafeVarargs
protected GraphicInputFactory(Class<? extends T>... allowedClasses) {
super(allowedClasses);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,15 @@
public final class LineGraphicInputFactory
extends GraphicInputFactory<LineGraphicInput, LineGraphicInputEntityData> {

private static final String LINE = "line";

public LineGraphicInputFactory() {
super(LineGraphicInput.class);
}

@Override
protected String[] getAdditionalFields() {
return new String[0];
return new String[] {LINE};
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,15 @@ public final class NodeGraphicInputFactory
extends GraphicInputFactory<NodeGraphicInput, NodeGraphicInputEntityData> {

private static final String POINT = "point";
private static final String NODE = "node";

public NodeGraphicInputFactory() {
super(NodeGraphicInput.class);
}

@Override
protected String[] getAdditionalFields() {
return new String[] {POINT};
return new String[] {POINT, NODE};
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
public class BmInputFactory
extends SystemParticipantInputEntityFactory<
BmInput, SystemParticipantTypedEntityData<BmTypeInput>> {
private static final String TYPE = "type";
private static final String MARKET_REACTION = "marketReaction";
private static final String COST_CONTROLLED = "costControlled";
private static final String FEED_IN_TARIFF = "feedInTariff";
Expand All @@ -30,7 +31,7 @@ public BmInputFactory() {

@Override
protected String[] getAdditionalFields() {
return new String[] {MARKET_REACTION, COST_CONTROLLED, FEED_IN_TARIFF};
return new String[] {TYPE, MARKET_REACTION, COST_CONTROLLED, FEED_IN_TARIFF};
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@

public class ChpInputFactory
extends SystemParticipantInputEntityFactory<ChpInput, ChpInputEntityData> {
private static final String THERMAL_BUS = "thermalBus";
private static final String TYPE = "type";
private static final String THERMAL_STORAGE = "thermalStorage";
private static final String MARKET_REACTION = "marketReaction";

public ChpInputFactory() {
Expand All @@ -23,7 +26,7 @@ public ChpInputFactory() {

@Override
protected String[] getAdditionalFields() {
return new String[] {MARKET_REACTION};
return new String[] {THERMAL_BUS, TYPE, THERMAL_STORAGE, MARKET_REACTION};
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,15 @@
public class EvInputFactory
extends SystemParticipantInputEntityFactory<
EvInput, SystemParticipantTypedEntityData<EvTypeInput>> {
private static final String TYPE = "type";

public EvInputFactory() {
super(EvInput.class);
}

@Override
protected String[] getAdditionalFields() {
return new String[0];
return new String[] {TYPE};
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,16 @@

public class HpInputFactory
extends SystemParticipantInputEntityFactory<HpInput, HpInputEntityData> {
private static final String TYPE = "type";
private static final String THERMAL_BUS = "thermalBus";

public HpInputFactory() {
super(HpInput.class);
}

@Override
protected String[] getAdditionalFields() {
return new String[0];
return new String[] {TYPE, THERMAL_BUS};
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,15 @@
public class StorageInputFactory
extends SystemParticipantInputEntityFactory<
StorageInput, SystemParticipantTypedEntityData<StorageTypeInput>> {
private static final String TYPE = "type";

public StorageInputFactory() {
super(StorageInput.class);
}

@Override
protected String[] getAdditionalFields() {
return new String[0];
return new String[] {TYPE};
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
public class WecInputFactory
extends SystemParticipantInputEntityFactory<
WecInput, SystemParticipantTypedEntityData<WecTypeInput>> {
private static final String TYPE = "type";
private static final String MARKET_REACTION = "marketReaction";

public WecInputFactory() {
Expand All @@ -25,7 +26,7 @@ public WecInputFactory() {

@Override
protected String[] getAdditionalFields() {
return new String[] {MARKET_REACTION};
return new String[] {TYPE, MARKET_REACTION};
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public CongestionResultFactory(DateTimeFormatter dateTimeFormatter) {

@Override
protected List<Set<String>> getFields(Class<?> entityClass) {
return List.of(newSet(TIME, INPUT_MODEL, TYPE, SUBGRID, MIN, MAX));
return List.of(newSet(TIME, INPUT_MODEL, TYPE, VALUE, SUBGRID, MIN, MAX));
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,10 @@ protected List<Set<String>> getFields(Class<?> entityClass) {
Set<String> minConstructorParams = newSet(TIME, INPUT_MODEL, IAMAG, IAANG, IBMAG, IBANG);

if (entityClass.equals(Transformer2WResult.class)) {
minConstructorParams = newSet(TIME, INPUT_MODEL, IAMAG, IAANG, IBMAG, IBANG, TAPPOS);
minConstructorParams = expandSet(minConstructorParams, TAPPOS);

} else if (entityClass.equals(Transformer3WResult.class)) {
minConstructorParams =
newSet(TIME, INPUT_MODEL, IAMAG, IAANG, IBMAG, IBANG, ICMAG, ICANG, TAPPOS);
minConstructorParams = expandSet(minConstructorParams, ICMAG, ICANG, TAPPOS);
}

return List.of(minConstructorParams);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ protected List<Set<String>> getFields(Class<?> entityClass) {
/// all result models have the same constructor except StorageResult
Set<String> minConstructorParams = newSet(TIME, INPUT_MODEL, POWER, REACTIVE_POWER);

if (entityClass.equals(StorageResult.class) || entityClass.equals(EvResult.class)) {
minConstructorParams = newSet(TIME, INPUT_MODEL, POWER, REACTIVE_POWER, SOC);
if (ElectricalEnergyStorageResult.class.isAssignableFrom(entityClass)) {
minConstructorParams = expandSet(minConstructorParams, SOC);
}

if (SystemParticipantWithHeatResult.class.isAssignableFrom(entityClass)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,11 @@ protected List<Set<String>> getFields(Class<?> entityClass) {
Set<String> minConstructorParams = newSet(TIME, INPUT_MODEL, Q_DOT);

if (entityClass.equals(ThermalHouseResult.class)) {
minConstructorParams = newSet(TIME, INPUT_MODEL, Q_DOT, INDOOR_TEMPERATURE);
minConstructorParams = expandSet(minConstructorParams, INDOOR_TEMPERATURE);
} else if (entityClass.equals(CylindricalStorageResult.class)) {
minConstructorParams = newSet(TIME, INPUT_MODEL, Q_DOT, ENERGY, FILL_LEVEL);
minConstructorParams = expandSet(minConstructorParams, ENERGY, FILL_LEVEL);
} else if (entityClass.equals(DomesticHotWaterStorageResult.class)) {
minConstructorParams = newSet(TIME, INPUT_MODEL, Q_DOT, ENERGY, FILL_LEVEL);
minConstructorParams = expandSet(minConstructorParams, ENERGY, FILL_LEVEL);
}

return List.of(minConstructorParams);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
abstract class AssetTypeInputEntityFactory<T extends AssetTypeInput>
extends UniqueEntityFactory<T, EntityData> {

@SafeVarargs
protected AssetTypeInputEntityFactory(Class<? extends T>... allowedClasses) {
super(allowedClasses);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public class SystemParticipantTypeInputFactory

// EvTypeInput
private static final String E_CONS = "eCons";
private static final String S_RATEDDC = "sRatedDC";
private static final String S_RATED_DC = "sRatedDC";
// BmTypeInput
private static final String ACTIVE_POWER_GRADIENT = "activePowerGradient";

Expand Down Expand Up @@ -73,7 +73,7 @@ protected List<Set<String>> getFields(Class<?> entityClass) {

Set<String> constructorParameters = null;
if (entityClass.equals(EvTypeInput.class)) {
constructorParameters = expandSet(standardConstructorParams, E_STORAGE, E_CONS);
constructorParameters = expandSet(standardConstructorParams, E_STORAGE, E_CONS, S_RATED_DC);
} else if (entityClass.equals(HpTypeInput.class)) {
constructorParameters = expandSet(standardConstructorParams, P_THERMAL);
} else if (entityClass.equals(BmTypeInput.class)) {
Expand Down Expand Up @@ -132,7 +132,8 @@ private SystemParticipantTypeInput buildEvTypeInput(
ComparableQuantity<SpecificEnergy> eCons =
data.getQuantity(E_CONS, StandardUnits.ENERGY_PER_DISTANCE);

ComparableQuantity<Power> sRatedDC = data.getQuantity(S_RATEDDC, StandardUnits.ACTIVE_POWER_IN);
ComparableQuantity<Power> sRatedDC =
data.getQuantity(S_RATED_DC, StandardUnits.ACTIVE_POWER_IN);

return new EvTypeInput(uuid, id, capEx, opEx, eStorage, eCons, sRated, cosPhi, sRatedDC);
}
Expand Down