Emissions CSV export#1753
Conversation
… and create boutique DE RF module to keep edge cases in one spot
…ular references for Marshall
…co2_output_production_emissions_fossil and spec
…ce of ccs_capture_rate. Update spec
1b41948 to
f67417e
Compare
…pport, and emissions CSV endpoints
f67417e to
a60a0e2
Compare
…thod as direct_co2_input_utilisation_fossil is sufficient
noracato
left a comment
There was a problem hiding this comment.
Very elegant solution with the transform attribute. Nice find!
Specs look good as well! Great work
…_utilised and emissions_lulucf_removals checks from spec
…tors and subsectors.
…now it covers more cases
|
ETEngine should generally only be touched by devs. The specs are fast internal tests to see if the code is behaving correctly under different cases and circumstances. I will revert the commit for you. |
…e test fixture of the direct_emissions_csv
|
Seems to look good! @noracato could you do a final review of Andreu's changes? If approved, we can merge it. |
…ns specs to use faster mock-based approach
| # | ||
| # @return [String] 'Other GHG' or 'CO2' | ||
| def ghg_carrier | ||
| inputs.map { |s| s.carrier&.key }.include?(:other_ghg) ? 'Other GHG' : 'CO2' |
There was a problem hiding this comment.
| inputs.map { |s| s.carrier&.key }.include?(:other_ghg) ? 'Other GHG' : 'CO2' | |
| inputs.map { |s| s.carrier&.key }.include?(:other_ghg) ? :other_ghg : :co2 |
It would be good to keep the symbol here instead of the string, so we can reuse the method later in the Qernel.
You are converting all node attributes to strings anyways in the serializer, so they will land well in the CSV. We will lose the capitalisation, but I hope everybody can live with that.
Context
As part of the emissions project we want to be able to export the emissions data in a CSV. The existing ConfiguredCSVSerializer serializes graph data to CSV based on a YAML config in ETSource, but it only supported simple query-based columns. The emissions export requires iterating over nodes in a group and reading attributes directly from each node, including support for both the energy and molecules graphs.
Implemented changes
Expanded ConfiguredCSVSerializer to support two new column types:
Other changes:
period:parameter (:presentor:future) to the serializer to select which graph to use for node expansion. Existing column types (present, future, unit, query) are unaffected.emissions_presentandemissions_futureCSV endpoints backed by a newemissions_csv.ymlconfig in ETSource.Related
This effort is in 3 places but only 2 of them have PRs (to merge back into the general emissions branch)
Checklist