Skip to content

Group child assets in commodity_flows.csv #1242

@alexdewar

Description

@alexdewar

Since #1124, the commodity flows for assets with a common parent are identical. This means that we can just represent all these flows with just the flows for the parent in commodity_flows.csv. There will be a couple of changes to this file: firstly, the parent's flows will be the sum of the children's flows (i.e. num children * flow) and, secondly, parents have group IDs, not asset IDs. This means we will need a new group_id column, whose value is optional, and we'll need to make the existing asset_id column optional too (every row should have one or the other set, though).

One problem is that we currently strip out the flows for parent assets from the flow map when it's returned from the dispatch step (replacing it with the corresponding flows for its children), so this information will not be available at the point we want to write it to file. I think we can just leave the flows for parents in as the only place where this should be an issue is where we come to writing commodity_flows.csv. We will need to change that code to ignore child assets, though.

Metadata

Metadata

Assignees

Labels

muse xiiiTasks for the MUSE XIII engagement

Type

No type
No fields configured for issues without a type.

Projects

Status

👀 In review

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions