@powercalc/power-router 1.0.43 → 1.0.44
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -89,12 +89,6 @@ export class CommonTimestamps {
|
|
|
89
89
|
const dur = Duration.fromISO(best).as("milliseconds");
|
|
90
90
|
const data: DataPoint[] = all[best];
|
|
91
91
|
const sourceTimes = data.map((item) => item.time);
|
|
92
|
-
/*
|
|
93
|
-
console.log('all', new Date(all[best][0].time))
|
|
94
|
-
console.log('data', new Date(data[0].time), new Date(data[data.length -1].time))
|
|
95
|
-
console.log('newTimes', new Date(newTimes[0]), new Date(newTimes[newTimes.length -1]))
|
|
96
|
-
console.log('sourceTimes', new Date(sourceTimes[0]), new Date(sourceTimes[sourceTimes.length -1]))
|
|
97
|
-
*/
|
|
98
92
|
const result = new Array(newTimes.length);
|
|
99
93
|
|
|
100
94
|
newTimes.forEach((time, i) => {
|
|
@@ -162,15 +156,6 @@ export class CommonTimestamps {
|
|
|
162
156
|
|
|
163
157
|
// Calculate time distance in milliseconds
|
|
164
158
|
const timeDistance = utcEndTime.toMillis() - utcStartTime.toMillis();
|
|
165
|
-
if (timeDistance < duration) {
|
|
166
|
-
console.log(
|
|
167
|
-
"timeDistance",
|
|
168
|
-
timeDistance,
|
|
169
|
-
duration,
|
|
170
|
-
startIsoString,
|
|
171
|
-
endIsoString
|
|
172
|
-
);
|
|
173
|
-
}
|
|
174
159
|
// Create an array with time distance duration in UTC time using Luxon
|
|
175
160
|
const timeSteps: number[] = [];
|
|
176
161
|
for (let i = 0; i <= timeDistance; i += duration) {
|
|
@@ -46,7 +46,6 @@ export class EurostatAPI {
|
|
|
46
46
|
private async fetchData(url: string, type: string, unit: string): Promise<any> {
|
|
47
47
|
const response = await fetch(url);
|
|
48
48
|
const data: any = await response.json();
|
|
49
|
-
console.log(data, type, unit);
|
|
50
49
|
try {
|
|
51
50
|
const time = Object.keys(data.dimension.time.category.index);
|
|
52
51
|
return {
|
|
@@ -72,16 +71,13 @@ export class EurostatAPI {
|
|
|
72
71
|
const select = `${chartType}/${freq}.${nrg_bal}.${siec}.${unit}`;
|
|
73
72
|
const rest = `?format=JSON&lang=en&startPeriod=2015-01&endPeriod=2050-12`;
|
|
74
73
|
const url = `${baseUrl}${select}${geo}${rest}`;
|
|
75
|
-
// console.log(url)
|
|
76
74
|
promises.push(this.fetchData(url, type, unit))
|
|
77
75
|
}
|
|
78
76
|
const res = await Promise.all(promises)
|
|
79
|
-
// console.log('---res---', res)
|
|
80
77
|
let merged: any = {};
|
|
81
78
|
res.forEach(item => {
|
|
82
79
|
merged = { ...merged, ...item };
|
|
83
80
|
})
|
|
84
|
-
// console.log('---merged----', merged)
|
|
85
81
|
return merged; // this.removeElGas(merged);
|
|
86
82
|
}
|
|
87
83
|
}
|
|
@@ -108,7 +108,6 @@ export class EdifactParser {
|
|
|
108
108
|
const timeDistance = utcEndTime.toMillis() - utcStartTime.toMillis();
|
|
109
109
|
if (timeDistance < duration && timeSerie.Period.length !== 1) {
|
|
110
110
|
console.log('timeDistance', timeDistance, duration, startIsoString, endIsoString)
|
|
111
|
-
console.log(JSON.stringify(timeSerie.Period.length, null, 2))
|
|
112
111
|
}
|
|
113
112
|
if (timeDistance > duration) {
|
|
114
113
|
//console.log('timeDistance2', timeDistance, duration, startIsoString, endIsoString)
|