Skip to content

Commit

Permalink
Merge pull request #1066 from Green-Software-Foundation/fix-multiple-…
Browse files Browse the repository at this point in the history
…aggregatino

Fix multiple aggregation
  • Loading branch information
narekhovhannisyan authored Oct 31, 2024
2 parents 7011a2c + 4b9d14e commit f4259da
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
1 change: 0 additions & 1 deletion src/if-run/lib/compute.ts
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,6 @@ const computeNode = async (node: Node, params: ComputeParams): Promise<any> => {
debugLogger.setExecutingPluginName(pluginName);

outputStorage = await plugin.execute(outputStorage, nodeConfig);
console.log(outputStorage);
debugLogger.setExecutingPluginName();

node.outputs = outputStorage;
Expand Down
3 changes: 2 additions & 1 deletion src/if-run/lib/initialize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import * as path from 'node:path';
import {ERRORS} from '@grnsft/if-core/utils';
import {PluginInterface} from '@grnsft/if-core/types';

import {storeAggregationMetrics} from './aggregate';

import {logger} from '../../common/util/logger';
import {memoizedLog} from '../util/log-memoize';
import {pluginStorage} from '../util/plugin-storage';
Expand All @@ -11,7 +13,6 @@ import {CONFIG, STRINGS} from '../config';

import {Context, PluginOptions} from '../../common/types/manifest';
import {PluginStorageInterface} from '../types/plugin-storage';
import {storeAggregationMetrics} from './aggregate';

const {
PluginInitializationError,
Expand Down
4 changes: 2 additions & 2 deletions src/if-run/util/aggregation-helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@ export const aggregateOutputsIntoOne = (
const aggregationType = isTemporal ? 'component' : 'time';

if (aggregationParams[aggregationType] === 'none') {
return acc;
continue;
}

if (aggregationParams[aggregationType] === 'copy') {
acc[metric] = output[metric];
return acc;
continue;
}

acc[metric] = acc[metric] ?? 0;
Expand Down

0 comments on commit f4259da

Please sign in to comment.