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

Enhance plugins with an inline arithmetic feature #1004

Merged
merged 43 commits into from
Sep 17, 2024
Merged

Conversation

manushak
Copy link
Contributor

@manushak manushak commented Sep 6, 2024

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

  • Adds inline arithmetic expressions to use basic mathematical operations directly within config parameters or inputs values in the manifest.
  • An inline arithmetic expression should start with = and must include one of the symbols *, +, -, or /. If an arithmetic operation is performed between constants (e.g., 2 * 2), the result is calculated without needing the = sign.
config:
  'input-parameter': '= 2 * carbon'
  coefficient: 2 * 2
  'output-parameter': '= 2 * "carbon-product"'
---
inputs:
  - timestamp: '2023-08-06T00:00'
    duration: 3600 * 60
    carbon: 30

@manushak manushak self-assigned this Sep 6, 2024
Copy link
Contributor

@jmcook1186 jmcook1186 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sgtm!

@zanete zanete linked an issue Sep 9, 2024 that may be closed by this pull request
4 tasks
@manushak manushak marked this pull request as draft September 9, 2024 12:54
@manushak manushak marked this pull request as ready for review September 16, 2024 10:56
manushak and others added 20 commits September 17, 2024 11:33
narekhovhannisyan and others added 22 commits September 17, 2024 11:33
Signed-off-by: James Crowley <[email protected]>
Signed-off-by: manushak <[email protected]>
appendGroup already returns acc merged anyway

Signed-off-by: James Crowley <[email protected]>
Signed-off-by: manushak <[email protected]>
only when appending - otherwise outputs are lost if not already grouped.

Signed-off-by: James Crowley <[email protected]>
Signed-off-by: manushak <[email protected]>
DCO Remediation Commit <[email protected]>

Hereby add my Signed-off-by to this commit: dd1cfb0
Hereby add my Signed-off-by to this commit: 575ecee
Hereby add my Signed-off-by to this commit: a841b3a

Signed-off-by: manushak <[email protected]>
only when appending - otherwise outputs are lost if not already grouped.

Signed-off-by: James Crowley <[email protected]>
@manushak manushak merged commit 79a0ec4 into main Sep 17, 2024
2 checks passed
@manushak manushak deleted the inline-arithmetic branch September 17, 2024 08:19
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.

Make "inline" arithmetic work in manifests
4 participants