@@ -1670,20 +1670,17 @@ def run_udf(args: dict, env: EvalEnv):
1670
1670
1671
1671
1672
1672
@process
1673
- def linear_scale_range (args : dict , env : EvalEnv ) -> DriverDataCube :
1674
- image_collection = extract_arg (args , 'x' )
1675
-
1676
- inputMin = extract_arg (args , "inputMin" )
1677
- inputMax = extract_arg (args , "inputMax" )
1678
- outputMax = args .get ("outputMax" , 1.0 )
1679
- outputMin = args .get ("outputMin" , 0.0 )
1680
- if not isinstance (image_collection , DriverDataCube ):
1681
- raise ProcessParameterInvalidException (
1682
- parameter = "data" , process = "linear_scale_range" ,
1683
- reason = f"Invalid data type { type (image_collection )!r} expected raster-cube."
1684
- )
1685
-
1686
- return image_collection .linear_scale_range (inputMin , inputMax , outputMin , outputMax )
1673
+ def linear_scale_range (args : ProcessArgs , env : EvalEnv ) -> DriverDataCube :
1674
+ # TODO: eliminate this top-level linear_scale_range process implementation (should be used as `apply` callback)
1675
+ _log .warning ("DEPRECATED: linear_scale_range usage directly on cube is deprecated/non-standard." )
1676
+ cube : DriverDataCube = args .get_required ("x" , expected_type = DriverDataCube )
1677
+ # Note: non-standard camelCase parameter names (https://github.com/Open-EO/openeo-processes/issues/302)
1678
+ input_min = args .get_required ("inputMin" )
1679
+ input_max = args .get_required ("inputMax" )
1680
+ output_min = args .get_optional ("outputMin" , default = 0.0 )
1681
+ output_max = args .get_optional ("outputMax" , default = 1.0 )
1682
+ # TODO linear_scale_range is defined on GeopysparkDataCube, but not on DriverDataCube
1683
+ return cube .linear_scale_range (input_min , input_max , output_min , output_max )
1687
1684
1688
1685
1689
1686
@process
0 commit comments