Skip to content

Commit 02e9885

Browse files
committed
refactor: simplify total synthetic component
1 parent f72a1c6 commit 02e9885

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

measure/src/main/java/net/laprun/sustainability/power/analysis/total/TotalSyntheticComponent.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,9 @@ public TotalSyntheticComponent(SensorMetadata metadata, SensorUnit expectedResul
2323
final var totalComponents = Arrays.stream(totalComponentIndices)
2424
.mapToObj(i -> toTotalComponent(metadata, i, errors))
2525
.toArray(TotalComponent[]::new);
26-
final String description = Arrays.stream(totalComponents)
27-
.map(TotalComponent::name)
28-
.collect(Collectors.joining(" + ", "Aggregated total from (", ")"));
2926
final String name = Arrays.stream(totalComponents)
3027
.map(TotalComponent::name)
31-
.collect(Collectors.joining("_", "total", ""));
28+
.collect(Collectors.joining(" + ", "total (", ")"));
3229
final var isAttributed = metadata.components().values().stream()
3330
.map(SensorMetadata.ComponentMetadata::isAttributed)
3431
.reduce(Boolean::logicalAnd).orElse(false);
@@ -48,7 +45,7 @@ public TotalSyntheticComponent(SensorMetadata metadata, SensorUnit expectedResul
4845
throw new IllegalArgumentException(errors.formatErrors());
4946
}
5047

51-
this.metadata = new SensorMetadata.ComponentMetadata(name, description, isAttributed, expectedResultUnit);
48+
this.metadata = new SensorMetadata.ComponentMetadata(name, "Aggregated " + name, isAttributed, expectedResultUnit);
5249
}
5350

5451
private double convertToExpectedUnit(double value) {

0 commit comments

Comments
 (0)