Skip to content

Commit

Permalink
compute aggregated for object
Browse files Browse the repository at this point in the history
  • Loading branch information
paulboosz committed Oct 3, 2024
1 parent fef6c6f commit 189b3b2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions compute-aggregated.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ const elmApp = Elm.ComputeAggregated.init({
definitionsString: fs.readFileSync("public/data/impacts.json", "utf-8"),
textileProcessesString: fs.readFileSync(dataFiles.textileDetailed, "utf-8"),
foodProcessesString: fs.readFileSync(dataFiles.foodDetailed, "utf-8"),
objectProcessesString: fs.readFileSync(dataFiles.objectDetailed, "utf-8"),
},
});

Expand All @@ -33,19 +34,25 @@ elmApp.ports.export.subscribe(
foodProcesses,
textileProcessesOnlyAggregated,
foodProcessesOnlyAggregated,
objectProcesses,
objectProcessesOnlyAggregated,
}) => {
try {
exportJson(dataFiles.textileDetailed, textileProcesses);
exportJson(dataFiles.foodDetailed, foodProcesses);
exportJson(dataFiles.objectDetailed, objectProcesses);
exportJson(dataFiles.textileNoDetails, textileProcessesOnlyAggregated);
exportJson(dataFiles.foodNoDetails, foodProcessesOnlyAggregated);
exportJson(dataFiles.objectNoDetails, objectProcessesOnlyAggregated);
console.log(`
4 files exported to:
- ${dataFiles.textileDetailed}
- ${dataFiles.foodDetailed}
- ${dataFiles.objectDetailed}
- ${dataFiles.textileNoDetails}
- ${dataFiles.foodNoDetails}
- ${dataFiles.objectNoDetails}
⚠️ Be sure to commit the detailed impacts 'processes_impacts.json' files in the 'ecobalyse-private' repo`);
} catch (err) {
Expand Down
2 changes: 1 addition & 1 deletion data/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export_food:
@$(call DOCKER,bash -c "python3 food/export.py && npm run processes:build")

export_object:
@$(call DOCKER,bash -c "python3 object/export.py")
@$(call DOCKER,bash -c "python3 object/export.py && npm run processes:build")

compare_food:
@$(call DOCKER,python3 export.py compare)
Expand Down

0 comments on commit 189b3b2

Please sign in to comment.