-
Notifications
You must be signed in to change notification settings - Fork 12
Open
Labels
💎 enhancementNew feature or requestNew feature or request🔀 refactorChange things to leave it the sameChange things to leave it the same🧼 cleanupClean code / aesthetic changesClean code / aesthetic changes
Description
Refactor CO2Record to only include necessary trace fields
Problem
Currently, CO2Record stores all trace record fields, including timestamp fields (submit, start, complete) and other fields that are not needed for CO₂ calculation.
When CO2Records are combined via plus(), some of these fields (like timestamps) accumulate as lists, causing:
- Nextflow validation warnings:
DEBUG nextflow.trace.TraceRecord - Not a valid trace value -- field: 'submit'; value: '[1771840416539, 1771840432042]'; format: 'null'
- Potential data inconsistencies
- Larger and harder-to-predict CO2Record objects
Proposed Long-term Solution
Refactor CO2Record so it only includes the trace record fields actually needed for CO₂ computation. This would involve:
- Defining a whitelist of allowed trace fields for CO2 calculation.
- Updating all
CO2Recordconstructors to only store these fields. - Removing aggregation logic for unneeded fields in
plus()and related methods. - Updating tests to only expect these fields in the CO2Record output.
Benefits:
- Clear separation of concerns: CO2Record = CO₂ metrics only
- Prevents similar issues with timestamp and irrelevant fields
- Smaller, more predictable objects for reporting and aggregation
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
💎 enhancementNew feature or requestNew feature or request🔀 refactorChange things to leave it the sameChange things to leave it the same🧼 cleanupClean code / aesthetic changesClean code / aesthetic changes