gee-community/geemap

Javascript to Python conversion for function arguments specified as dictionary

spatialthoughts opened this issue · 0 comments

geemap's Javascript to Python code converter needs a minor fix. When converting Javascript code having function arguments specified as a dictionary, they need to be prefixed with ** to make them valid kwargs in Python.

The current converter produces code such as below

stats = image.reduceRegion({
    'reducer': ee.Reducer.mean(),
    'geometry': geometry,
    'scale': 10,
    'maxPixels': 1e10
    })

The correct output needs to have ** prefixed.

stats = image.reduceRegion(**{
    'reducer': ee.Reducer.mean(),
    'geometry': geometry,
    'scale': 10,
    'maxPixels': 1e10
    })