Open-EO / openeo-processes

Interoperable processes for openEO's big Earth observation cloud processing.
https://processes.openeo.org
Apache License 2.0
48 stars 15 forks source link

array_interpolate_linear: clarification of return values #333

Closed zcernigoj closed 2 years ago

zcernigoj commented 2 years ago

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 commented 2 years ago

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.

zcernigoj commented 2 years ago

Thanks, the changes make it clear now.