Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update explain feature #996

Merged
merged 4 commits into from
Aug 29, 2024
Merged

Update explain feature #996

merged 4 commits into from
Aug 29, 2024

Conversation

manushak
Copy link
Contributor

Types of changes

  • Enhancement (project structure, spelling, grammar, formatting)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

A description of the changes proposed in the Pull Request

@manushak manushak self-assigned this Aug 28, 2024
@manushak manushak linked an issue Aug 28, 2024 that may be closed by this pull request
3 tasks
@jmcook1186
Copy link
Contributor

jmcook1186 commented Aug 28, 2024

Hi @manushak just checked this out and started using it - there's one important behaviour that does not seem to be supported - it's the case where we have two parameters with the same name but different units - this should throw an error, but it seems to overwrite and persist the last-defined version.

e.g. in this manifest there is a deliberately duplicated parameter across two plugins (time-reserved) and I've made the value different from the default hardcoded in the sci-embodied plugin source code. I'd expect explain to detect that the two instances of time-reserved have different units and throw an error.

name: sci-embodied
description: successful path
tags:
initialize:
  plugins:
    "sci-embodied": # a model that calculates m from te, tir, el, rr and rtor
      method: SciEmbodied
      path: "builtin"
    sum:
      method: Sum
      path: "builtin"
      config:
        input-parameters: ["time-reserved", "resources-total"]
        output-parameter: "result"
      parameter-metadata:
        inputs:
          time-reserved:
            description: "carbon emitted due to an application's execution"
            unit: "mins"
            aggregation-method: 'sum'       

explainer: true
tree:
  children:
    child:
      pipeline:
        compute:
          - sci-embodied # duration & config -> embodied
          - sum
      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

The current behaviour is correct only if the units for the two identically named parameters are the same.

@jmcook1186 jmcook1186 merged commit 79aad35 into main Aug 29, 2024
2 checks passed
@jmcook1186 jmcook1186 deleted the explain-rework branch August 29, 2024 08:46
This was referenced Oct 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rework explain feature
3 participants