Simplify SCI model code to use a single parameter for functional-unit
#705
Labels
fix
PR fixes a bug or improves something
functional-unit
#705
What
Simplify the SCI model code so that it accepts a single parameter representing
functional-unit
instead of two (functional-unit
andfunctional-unit-time
) .Why
SCI is a core feature that has to be as easy as possible to build into pipelines. The current implementation puts some unnecessary burden on the user that could be abstracted away or implemented in separate plugins.
Context
When we first built the SCI plugin we wanted to be able to normalize carbon values to any functional unit, including functional units that are just units of time. We also wanted to be able to support composites of some functional unit and time such as
requests/month
. We ended up supporting this by using two distinct parameters:functional-unit
andfunctional-unit-time
.Instead, we can just use
functional-unit
, which should come from global-level config. The value offunctional-unit
should be a string.It should be assumed that
functional-unit
is a string that precisely matches the name of some value found ininputs
, in which case the value associated with that parameter should be used as a scaling factor. If the given string does not match a key in the input data, we should error out.In summary, remove the time manipulation features from the current SCI plugin. Also remove any logic related to
operational-carbon
andembodied-carbon
- instead make it a hard requirement thatcarbon
is present - if it is not found, then error out.The plugin should ONLY divide the given
carbon
value by the specifiedfunctional-unit
.Prerequisites/resources
sci
plugin should be migrated intobuiltins
(see Migratesci
plugin tobuiltins
#704 )SoW (scope of work)
operational-carbon
andembodied-carbon
logicAcceptance criteria
functional-unit
the parameter should be a string
GIVEN the changes have been merged
WHEN the following manifest is executed (providing a valid functional unit) :
THEN the following output should be generated (providing carbon per request in each timestep):
WHEN the following manifest is executed (normalizing to
functional-unit
whenduration
is not equal to 1):THEN
the following output should be generated (notice the SCI is just the carbon divided by requests, with no modification due to
duration
):WHEN the following manifest is executed (defining a
functional-unit
that is missing ininputs
) :THEN Impact Framework should error out.
The text was updated successfully, but these errors were encountered: