Skip to content

Commit faa4715

Browse files
remove more storage attributes which aren't used any longer
1 parent 6b303ec commit faa4715

File tree

6 files changed

+7
-41
lines changed

6 files changed

+7
-41
lines changed

src/main/java/edu/ie3/datamodel/io/factory/typeinput/SystemParticipantTypeInputFactory.java

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -86,12 +86,7 @@ protected List<Set<String>> getFields(Class<?> entityClass) {
8686
expandSet(standardConstructorParams, ETA_EL, ETA_THERMAL, P_THERMAL, P_OWN);
8787
} else if (entityClass.equals(StorageTypeInput.class)) {
8888
constructorParameters =
89-
expandSet(
90-
standardConstructorParams,
91-
E_STORAGE,
92-
P_MAX,
93-
ACTIVE_POWER_GRADIENT,
94-
ETA);
89+
expandSet(standardConstructorParams, E_STORAGE, P_MAX, ACTIVE_POWER_GRADIENT, ETA);
9590
}
9691

9792
return Collections.singletonList(constructorParameters);
@@ -237,15 +232,6 @@ private SystemParticipantTypeInput buildStorageTypeInput(
237232
ComparableQuantity<Dimensionless> eta = data.getQuantity(ETA, StandardUnits.EFFICIENCY);
238233

239234
return new StorageTypeInput(
240-
uuid,
241-
id,
242-
capEx,
243-
opEx,
244-
eStorage,
245-
sRated,
246-
cosPhi,
247-
pMax,
248-
activePowerGradient,
249-
eta);
235+
uuid, id, capEx, opEx, eStorage, sRated, cosPhi, pMax, activePowerGradient, eta);
250236
}
251237
}

src/main/java/edu/ie3/datamodel/models/input/system/type/StorageTypeInput.java

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ public class StorageTypeInput extends SystemParticipantTypeInput {
2828
/** Efficiency of the charging and discharging process (typically in %) */
2929
private final ComparableQuantity<Dimensionless> eta;
3030

31-
3231
/**
3332
* @param uuid of the input entity
3433
* @param id of this type of Storage
@@ -93,8 +92,7 @@ public boolean equals(Object o) {
9392

9493
@Override
9594
public int hashCode() {
96-
return Objects.hash(
97-
super.hashCode(), eStorage, pMax, activePowerGradient, eta);
95+
return Objects.hash(super.hashCode(), eStorage, pMax, activePowerGradient, eta);
9896
}
9997

10098
@Override
@@ -145,9 +143,6 @@ private StorageTypeInputCopyBuilder(StorageTypeInput entity) {
145143
this.pMax = entity.getpMax();
146144
this.activePowerGradient = entity.getActivePowerGradient();
147145
this.eta = entity.getEta();
148-
this.dod = entity.getDod();
149-
this.lifeTime = entity.getLifeTime();
150-
this.lifeCycle = entity.getLifeCycle();
151146
}
152147

153148
public StorageTypeInputCopyBuilder seteStorage(ComparableQuantity<Energy> eStorage) {
@@ -235,10 +230,7 @@ public StorageTypeInput build() {
235230
getCosPhiRated(),
236231
pMax,
237232
activePowerGradient,
238-
eta,
239-
dod,
240-
lifeTime,
241-
lifeCycle);
233+
eta);
242234
}
243235

244236
@Override

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -499,7 +499,6 @@ private static List<Try<Void, InvalidEntityException>> checkStorageType(
499499
StorageTypeInput storageTypeInput) {
500500
List<Try<Void, InvalidEntityException>> exceptions = new ArrayList<>();
501501

502-
503502
exceptions.addAll(
504503
Try.ofVoid(
505504
InvalidEntityException.class,
@@ -511,8 +510,7 @@ private static List<Try<Void, InvalidEntityException>> checkStorageType(
511510
() ->
512511
detectNegativeQuantities(
513512
new Quantity<?>[] {
514-
storageTypeInput.getpMax(),
515-
storageTypeInput.getActivePowerGradient(),
513+
storageTypeInput.getpMax(), storageTypeInput.getActivePowerGradient(),
516514
},
517515
storageTypeInput),
518516
() ->

src/test/groovy/edu/ie3/datamodel/io/factory/typeinput/SystemParticipantTypeInputFactoryTest.groovy

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -283,8 +283,8 @@ class SystemParticipantTypeInputFactoryTest extends Specification implements Fac
283283

284284
then:
285285
input.failure
286-
input.exception.get().message == "The provided fields [capex, cosPhiRated, dod, estorage, eta, id, lifetime, opex, pmax, pmin, srated, uuid] are invalid for instance of 'StorageTypeInput'. \n" +
286+
input.exception.get().message == "The provided fields [capex, cosPhiRated, estorage, eta, id, opex, pmax, pmin, srated, uuid] are invalid for instance of 'StorageTypeInput'. \n" +
287287
"The following fields (without complex objects e.g. nodes, operators, ...) to be passed to a constructor of 'StorageTypeInput' are possible (NOT case-sensitive!):\n" +
288-
"0: [activePowerGradient, capex, cosPhiRated, eStorage, eta, id, opex, pMax, sRated, uuid] or [active_power_gradient, capex, cos_phi_rated, dod, e_storage, eta, id, life_cycle, life_time, opex, p_max, s_rated, uuid]\n"
288+
"0: [activePowerGradient, capex, cosPhiRated, eStorage, eta, id, opex, pMax, sRated, uuid] or [active_power_gradient, capex, cos_phi_rated, e_storage, eta, id, opex, p_max, s_rated, uuid]\n"
289289
}
290290
}

src/test/groovy/edu/ie3/datamodel/models/input/system/type/StorageTypeInputTest.groovy

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ class StorageTypeInputTest extends Specification {
2323
def alteredUnit = storageTypeInput.copy()
2424
.seteStorage(Quantities.getQuantity(90, ENERGY_IN))
2525
.setpMax(Quantities.getQuantity(15, ACTIVE_POWER_IN))
26-
.setLifeTime(Quantities.getQuantity(999999, LIFE_TIME))
2726
.build()
2827

2928
then:
@@ -38,9 +37,6 @@ class StorageTypeInputTest extends Specification {
3837
assert pMax == Quantities.getQuantity(15, ACTIVE_POWER_IN)
3938
assert activePowerGradient == storageTypeInput.activePowerGradient
4039
assert eta == storageTypeInput.eta
41-
assert dod == storageTypeInput.dod
42-
assert lifeTime == Quantities.getQuantity(999999, LIFE_TIME)
43-
assert lifeCycle == storageTypeInput.lifeCycle
4440
}
4541
}
4642

@@ -63,9 +59,6 @@ class StorageTypeInputTest extends Specification {
6359
assert pMax == storageTypeInput.pMax * 2d
6460
assert activePowerGradient == storageTypeInput.activePowerGradient
6561
assert eta == storageTypeInput.eta
66-
assert dod == storageTypeInput.dod
67-
assert lifeTime == storageTypeInput.lifeTime
68-
assert lifeCycle == storageTypeInput.lifeCycle
6962
}
7063
}
7164
}

src/test/groovy/edu/ie3/test/common/TypeTestData.groovy

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,6 @@ class TypeTestData extends GridTestData {
7070
Quantities.getQuantity(12.961, KILOWATT),
7171
Quantities.getQuantity(0.03, PU_PER_HOUR),
7272
Quantities.getQuantity(0.92, PU),
73-
Quantities.getQuantity(20d, PERCENT),
74-
Quantities.getQuantity(43800.0, HOUR),
75-
100000
7673
)
7774

7875
public static final WecCharacteristicInput wecCharacteristicInput = new WecCharacteristicInput("cP:{(10.00,0.05),(15.00,0.10),(20.00,0.20)}")

0 commit comments

Comments
 (0)