fix: use custom type pydantic class to wrap ndarray and avoid validation problem #487
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
ECALC-965
fixes #482
Have you remembered and considered?
docs/docs/changelog/next.md
)docs/docs/migration_guides/
)BREAKING:
in footer or!
in header, if breakingECALC-XXXX
)Why is this pull request needed?
When users are using eCalc directly on CLI, they will be met with a few warnings that will most likely be difficult for them to understand, so we should either handle them or silence them.
What does this pull request change?
The problem is caused by sending numpy.ndarrays directly into pydantic, giving validation problems. Avoiding the problem using custom type PydanticNDArray to wrap numpy.ndarray, and use that type instead of numpy.ndarray directly.
A more long term solution is to return List and Float from core.
Issues related to this change:
https://equinor-ecalc.atlassian.net/browse/ECALC-965?atlOrigin=eyJpIjoiNjUxNmVlMmY4ZWEyNGU5YzhmN2RhM2MyZTY0NGE2OWYiLCJwIjoiaiJ9