Open-EO / openeo-geotrellis-extensions

Java/Scala extensions for Geotrellis, for use with OpenEO GeoPySpark backend.
Apache License 2.0
5 stars 3 forks source link

Floating point constants get interpreted as doubles #287

Closed jdries closed 5 months ago

jdries commented 5 months ago

Python always works in float64 by default, so when a user uses a constant like 1.0 in a computation, the result ends up in float64, even if this is not required by the precision provided.

To save memory, it seems better to be more conservative and try to stay in float32 if possible.

Part of the problem is also caused by the implementation of array_create, which does not force datatypes to something constant.