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

array_interpolate_linear: clarification of return values #333

Closed
zcernigoj opened this issue Mar 8, 2022 · 2 comments
Closed

array_interpolate_linear: clarification of return values #333

zcernigoj opened this issue Mar 8, 2022 · 2 comments

Comments

@zcernigoj
Copy link

zcernigoj commented Mar 8, 2022

Process ID: array_interpolate_linear

Describe the issue:
The documentation (https://docs.openeo.cloud/processes/?#array_interpolate_linear) says that the return value for this process can be array or null.

Return Value
An array with no-data values being replaced with interpolated values. If not at least 2 numerical values are available in the array, the array stays the same.

Data type: number, null

The problem is that it's not really clear when a null should be returned.

E.g. it doesn't say if the null should be propagated if data itself is null.
For an empty array I would assume that an empty array should be returned ("If not at least 2 numerical values are available in the array, the array stays the same.")

Proposed solution:
Add more info to the documentation / change the documentation.

Additional context:
/

@m-mohr
Copy link
Member

m-mohr commented Mar 8, 2022

Good catch. Actually, the return value is completely wrong. It should be array<number|null> instead and then I think it should be clearer what happens, right? See the commit above for the fix.

For an empty array I would assume that an empty array should be returned

Correct. That's captured by "If not at least 2 numerical values are available in the array, the array stays the same."

All inputs for data that are non-array should result in an error.

@m-mohr m-mohr closed this as completed Mar 8, 2022
@zcernigoj
Copy link
Author

Thanks, the changes make it clear now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants