Green-Software-Foundation / if

Impact Framework
https://if.greensoftware.foundation/
MIT License
145 stars 40 forks source link

Error: pipelineCopy.shift is not a function #922

Closed u31120408 closed 2 months ago

u31120408 commented 2 months ago

Following the quickstart guide at https://if.greensoftware.foundation/users/quick-start/, I cannot get the tool working for the given example.

Environment (using macOS 14.5)

Installed modules % npm -g list
/Users/<...>/.nvm/versions/node/v20.16.0/lib ├── @grnsft/if-plugins@v0.3.2 ├── @grnsft/if-unofficial-plugins@v0.3.1 ├── @grnsft/if@0.5.0 ├── corepack@0.28.2 └── npm@10.8.1

Using manifest file from https://if.greensoftware.foundation/users/quick-start

name: basic-demo
description:
tags:
initialize:
  plugins:
    teads-curve:
      path: '@grnsft/if-unofficial-plugins'
      method: TeadsCurve
      global-config:
        interpolation: spline
tree:
  children:
    child-0:
      defaults:
        cpu/thermal-design-power: 100
      pipeline:
        observe:
        regroup:
        compute:
          - teads-curve
      inputs:
        - timestamp: 2023-07-06T00:00
          duration: 1
          cpu/utilization: 20
        - timestamp: 2023-07-06T00:01
          duration: 1
          cpu/utilization: 80
        - timestamp: 2023-07-06T00:02
          duration: 1
          cpu/utilization: 20

Executing if-run --manifest basic-demo-from-doc.yml throws the error

[2024-07-26 10:33:44.879 AM] error:     pipelineCopy.shift is not a function
TypeError:      pipelineCopy.shift is not a function
    at computeNode (/Users/<...>/.nvm/versions/node/v20.16.0/lib/node_modules/@grnsft/if/build/lib/compute.js:57:41)
    at traverse (/Users/<...>/.nvm/versions/node/v20.16.0/lib/node_modules/@grnsft/if/build/lib/compute.js:14:15)
    at computeNode (/Users/<...>/.nvm/versions/node/v20.16.0/lib/node_modules/@grnsft/if/build/lib/compute.js:46:16)
    at compute (/Users/<...>/.nvm/versions/node/v20.16.0/lib/node_modules/@grnsft/if/build/lib/compute.js:87:11)
    at impactEngine (/Users/<...>/.nvm/versions/node/v20.16.0/lib/node_modules/@grnsft/if/build/index.js:30:58)
jmcook1186 commented 2 months ago

HI - thanks for raising the issue - pinging @manushak and @narekhovhannisyan to investigate while I'm out of office.

narekhovhannisyan commented 2 months ago

@kathleen-vanassche-aca Hi, thanks for reporting! Documentation is a bit ahead at the moment (phased execution will be available in the next release which is coming later this week).

For now you can try without phased execution:

name: basic-demo
description:
tags:
initialize:
  plugins:
    teads-curve:
      path: '@grnsft/if-unofficial-plugins'
      method: TeadsCurve
      global-config:
        interpolation: spline
tree:
  children:
    child-0:
      defaults:
        cpu/thermal-design-power: 100
      pipeline:
        - teads-curve
      inputs:
        - timestamp: 2023-07-06T00:00
          duration: 1
          cpu/utilization: 20
        - timestamp: 2023-07-06T00:01
          duration: 1
          cpu/utilization: 80
        - timestamp: 2023-07-06T00:02
          duration: 1
          cpu/utilization: 20
narekhovhannisyan commented 2 months ago

Hi @kathleen-vanassche-aca, v0.6.0 release is already published so you can try phased execution!

zanete commented 2 months ago

@narekhovhannisyan could you confirm this is no longer an issue so we can close the ticket? 🙏

jmcook1186 commented 2 months ago

Closing as fixed