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

Zero tolerant plugins #859

Merged
merged 20 commits into from
Jun 27, 2024
Merged

Zero tolerant plugins #859

merged 20 commits into from
Jun 27, 2024

Conversation

narekhovhannisyan
Copy link
Member

@narekhovhannisyan narekhovhannisyan commented Jun 24, 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

@narekhovhannisyan narekhovhannisyan marked this pull request as draft June 24, 2024 09:52
@narekhovhannisyan narekhovhannisyan self-assigned this Jun 24, 2024
@narekhovhannisyan narekhovhannisyan linked an issue Jun 24, 2024 that may be closed by this pull request
8 tasks
@narekhovhannisyan narekhovhannisyan marked this pull request as ready for review June 24, 2024 12:50
@narekhovhannisyan narekhovhannisyan requested review from jmcook1186 and manushak and removed request for jmcook1186 June 24, 2024 12:50
@jmcook1186
Copy link
Contributor

looks good @narekhovhannisyan , except zero-minus-one yields 1 instead of -1 when i run the manifest from the issue ticket.

@narekhovhannisyan
Copy link
Member Author

narekhovhannisyan commented Jun 24, 2024

@jmcook1186 it's because of typo in your manifest (you plugin uses sum instead of subtract)
please use this fixed one

name: generics
description: a pipeline that does arbitrary calculations using our generic arithmetic builtins
tags:
initialize:
  plugins:
    "sum-zero-and-one":
      path: "builtin"
      method: Sum
      global-config:
        input-parameters:
          - some-value
          - zero-value
        output-parameter: one-plus-zero
    "sum-zero-and-zero":
      path: "builtin"
      method: Sum
      global-config:
        input-parameters:
          - zero-value
          - zero-value
        output-parameter: zero-plus-zero
    "subtract-one-and-zero":
      path: "builtin"
      method: Subtract
      global-config:
        input-parameters:
          - some-value
          - zero-value
        output-parameter: one-minus-zero
    "subtract-zero-and-zero":
      path: "builtin"
      method: Sum
      global-config:
        input-parameters:
          - zero-value
          - zero-value
        output-parameter: zero-minus-zero
    "subtract-zero-and-one":
      path: "builtin"
      method: Subtract
      global-config:
        input-parameters:
          - zero-value
          - some-value
        output-parameter: zero-minus-one
    "coefficient-one-times-zero":
      path: "builtin"
      method: Coefficient
      global-config:
        input-parameter: zero-value
        coefficient: 1
        output-parameter: zero-times-one-coefficient
    "coefficient-zero-times-one":
      path: "builtin"
      method: Coefficient
      global-config:
        input-parameter: some-value
        coefficient: 0
        output-parameter: one-times-zero-coefficient
    "coefficient-zero-times-zero":
      path: "builtin"
      method: Coefficient
      global-config:
        input-parameter: zero-value
        coefficient: 0
        output-parameter: zero-times-zero-coefficient
    "multiply-one-times-zero":
      path: "builtin"
      method: Multiply
      global-config:
        input-parameters: ["some-value", "zero-value"]
        output-parameter: "one-times-zero"
    "multiply-zero-times-one":
      path: "builtin"
      method: Multiply
      global-config:
        input-parameters: ["zero-value", "zero-value"]
        output-parameter: "zero-times-one"
    exponent-one-to-zero:
      method: Exponent
      path: 'builtin'
      global-config:
        input-parameter: 'some-value'
        exponent: 0
        output-parameter: 'one-raised-to-zero-power'
    exponent-zero-to-zero:
      method: Exponent
      path: 'builtin'
      global-config:
        input-parameter: 'zero-value'
        exponent: 0
        output-parameter: 'zero-raised-to-zero-power'
    exponent-zero-to-one:
      method: Exponent
      path: 'builtin'
      global-config:
        input-parameter: 'zero-value'
        exponent: 1
        output-parameter: 'zero-raised-to-first-power'
    "sci":
      path: "builtin"
      method: Sci
      global-config:
        functional-unit: "zero-value"
tree:
  children:
    child-1:
      pipeline:
        - sum-zero-and-one
        - sum-zero-and-zero
        - subtract-one-and-zero
        - subtract-zero-and-zero
        - subtract-zero-and-one
        - coefficient-one-times-zero
        - coefficient-zero-times-one
        - coefficient-zero-times-zero
        - multiply-one-times-zero
        - multiply-zero-times-one
        - exponent-one-to-zero
        - exponent-zero-to-one
        - exponent-zero-to-zero
        # - sci
      config:
      defaults:
      inputs:
        - timestamp: "2023-12-12T00:00:00.000Z"
          duration: 1
          some-value: 1
          zero-value: 0

@jmcook1186
Copy link
Contributor

Got it - thanks

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.

lgtm!

@jmcook1186 jmcook1186 merged commit 2fc1aff into main Jun 27, 2024
2 checks passed
@jmcook1186 jmcook1186 deleted the zero-tolerant-plugins branch June 27, 2024 13:57
This was referenced Jun 28, 2024
@github-actions github-actions bot mentioned this pull request Aug 9, 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.

Ensure builtins do not panic when they see zeros
3 participants