Green-Software-Foundation / if

Impact Framework
https://if.greensoftware.foundation/
MIT License
138 stars 39 forks source link

`MockObservations` adds its mock data to `outputs` instead of `inputs` #846

Closed jmcook1186 closed 1 week ago

jmcook1186 commented 2 months ago

Description of the Error

When you run mockObservations ina pipeline, it creates mock data and appends it to outputs, leaving the inputs set to null. We would prefer the mock observations plugin to add its mock data to the inputs array. This is important as we move IF to its phased execution because mockObservations will be part of the observe phase, which only adds data to the inputs array, not the compute phase that generates outputs.

Expected Behaviour

The data generated by mockObservations should be added to the inputs array and not the outputs array.

Actual Behaviour

The data generated by mockObservations is added to the outputs array and not the inputs array.

Steps to Reproduce

Run the following manifest:

name: mock
description: 
initialize:
  plugins: 
    mock-observations:
      path: 'builtin'
      method: MockObservations
      global-config:
        timestamp-from: '2024-03-05T00:00:04.000Z'
        timestamp-to: '2024-03-05T00:00:07.000Z'
        duration: 1
        components:
          - name: server-1
            cloud/instance-type: Standard_E64_v3
            cloud/region: westus3        
        generators:
          common:
            cloud/vendor: azure
          randint:
            cpu/energy:
              min: 1
              max: 99           
            mem/energy:
              min: 1
              max: 99
tree: 
  pipeline:
    - mock-observations
  defaults:
  config:
    group-by:
      group:
        - cloud/region
        - name
  inputs: null

Link to online environment

n/a

Manifest File That Generated the Error

see above

Links to Any Additional Code

n/a

Runtime Info

IF version 0.4.0 Ubuntu 20.04

jmcook1186 commented 1 month ago

Fix is blocked by migration to phased execution (currently importers have to add to outputs, not inputs)

zanete commented 1 month ago

@narekhovhannisyan can you confirm this is still an issue or not

narekhovhannisyan commented 2 weeks ago

@jmcook1186 this one is automatically handled by distinct execution which adds observation data to inputs instead of outputs (observe phase).