Green-Software-Foundation / Green-Software-Foundation/if
[SCI-m] Incorrect error when `resources-total` param is missing
- Dominant language
- TypeScript
- Stars
- 183
- Forks
- 51
- PR merge metrics
- No merged PRs in 30d
Description
## Description of the Error
When `resources-total` param is missing from inputs and defaults, incorrect error message is received
## Expected Behaviour
Error message should be the following:
"resources-total" parameter is required.
Error code: invalid_union.
## Actual Behaviour
Received the following error
"vcpus-allocated" parameter is required. Error code: invalid_union.
## Steps to Reproduce
1. Run the manifest file (described below) , which includes sci-m plugin without `resources-total` param in inputs and defaults.
## Manifest File That Generated the Error
```yaml
name: sci-m
description: successful path
tags:
initialize:
#outputs: ['yaml']
plugins:
"sci-m": # a model that calculates m from te, tir, el, rr and rtor
method: SciM
verbose: false
path: "@grnsft/if-plugins"
tree:
children:
child:
pipeline:
- sci-m # duration & config -> embodied
defaults:
device/emissions-embodied: 1533.120 # gCO2eq
time-reserved: 3600 # 1hr in seconds
device/expected-lifespan: 94608000 # 3 years in seconds
resources-reserved: 1
# resources-total: 8
inputs:
- timestamp: 2023-07-06T00:00
duration: 3600
```
## Runtime Info
if-version: v0.3.2
os: macOS
os-version: '13.2'
node-version: 18.14.2
Contributor guide
Assessment
This issue has not been assessed yet.