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

[FEATURE] Enable transforming of value types #543

Closed
7 tasks
rhazn opened this issue Apr 11, 2024 · 0 comments · Fixed by #557
Closed
7 tasks

[FEATURE] Enable transforming of value types #543

rhazn opened this issue Apr 11, 2024 · 0 comments · Fixed by #557
Assignees
Labels
enhancement New feature or request softwarecampus Issues related to the Softwarecampus grant

Comments

@rhazn
Copy link
Contributor

rhazn commented Apr 11, 2024

User Story

  1. As a {user}
  2. I want {to change the value type of data}
  3. So that {I can save it correctly}

User Acceptance Criteria

  • A X as Y operator exists that takes the input X and returns it parsed as built in value type Y (see https://jvalue.github.io/jayvee/docs/user/valuetypes/builtin-valuetypes)
    • Alternatively, multiple asDecimal X unary operators for every built in value type
  • Transforms can define different value types for inputs and outputs (this should already work)
  • TableTransformer blocks with transforms that change value types for the same columns work

Examples

See the following model with open data from SWC: https://github.com/jvalue/SWC2-JValue-OCDE-Case1/blob/main/models/12781142/refractiveIndicesAndDielectricConstantsModel.jv

  • The column values contains numeric data like this: [123]
  • The goal is to save it as integer: 123
  • The [RemoveClosingBraces](https://github.com/jvalue/SWC2-JValue-OCDE-Case1/blob/main/models/12781142/refractiveIndicesAndDielectricConstantsModel.jv#L53) transform removes the braces (but returns the value as a text 😢 )
  • The [ClosingBracesRemover](https://github.com/jvalue/SWC2-JValue-OCDE-Case1/blob/main/models/12781142/refractiveIndicesAndDielectricConstantsModel.jv#L90) block applies it to the pipeline
  • The [RemoveClosingBraces](https://github.com/jvalue/SWC2-JValue-OCDE-Case1/blob/main/models/12781142/refractiveIndicesAndDielectricConstantsModel.jv#L53) transform should return the value as an integer using the following expression: parse (valueWithBraces replace /\]/ with "") as integer

Notes

Definitions of Done

  • A PR has been opened and accepted
  • All user acceptance criteria are met
  • All tests are passing
@rhazn rhazn added enhancement New feature or request softwarecampus Issues related to the Softwarecampus grant labels Apr 11, 2024
@TungstnBallon TungstnBallon linked a pull request Apr 27, 2024 that will close this issue
@TungstnBallon TungstnBallon self-assigned this Apr 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request softwarecampus Issues related to the Softwarecampus grant
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants