Green-Software-Foundation / if-plugins

Impact Framework models owned and maintained by the GSF
MIT License
25 stars 17 forks source link

Query - How do we have dynamic `inputs` values in manifest file before pipeline execution? #88

Closed pangteckchun closed 7 months ago

pangteckchun commented 7 months ago

Hi, would like to know what is the suggested way to get say timestamp and duration input parameters programmatically into a manifest file before kicking off an pipeline run? This is so we can derive a SCI for an app, based on a desired time period but this values will be user-driven and dynamic. Today when we test, we "hardcode" them as inputs in the manifest file.

Thank you! TC

jmcook1186 commented 7 months ago

Hi @pangteckchun - for this you can use the MockObservations plugin. You can provide a start and end time (as ISO 8061 strings) and the duration of each timestep - the plugin will then generate an array of observations with timestamps spaced according to that config. You can also add other arbitrary data to the mock input array using the other plugin parameters. See here: https://github.com/Green-Software-Foundation/if-plugins/blob/main/src/lib/mock-observations/README.md

pangteckchun commented 7 months ago

Hi James, thank you for the suggestion. What we need is to have the timestamp and duration values populated into the manifest file as fields, then we will run ie on the command line against that manifest file. So MockObervations does not fulfill that need.

In this case, we might then dynamically generate the entire manifest file before running ie command. The timestamp and duration values will come from user selected inputs and we will generate the manifest file accordingly for the inputs[] section.

Thanks again! I am closing this thread.