Open-EO / openeo-odc

Functions to map an openEO process graph to a job based on OpenDataCube and Xarray functions.
Apache License 2.0
1 stars 3 forks source link

Issue with process graphs with numbers instead of strings in process_id #7

Closed clausmichele closed 3 years ago

clausmichele commented 3 years ago

This simple process graph can't be parsed using openeo-odc:

{
  "process_graph": {
    "2": {
      "process_id": "save_result",
      "arguments": {
        "data": {
          "from_node": "3"
        },
        "format": "NETCDF"
      },
      "result": true
    },
    "3": {
      "process_id": "load_collection",
      "arguments": {
        "id": "S2_L2A_T32TPS",
        "spatial_extent": {
          "west": 11.114774461650697,
          "south": 46.06031036495747,
          "east": 11.137519595552675,
          "north": 46.07615051669467
        },
        "temporal_extent": [
          "2019-05-01T00:00:00Z",
          "2019-05-31T00:00:00Z"
        ],
        "bands": [
          "B02_10m",
          "B03_10m",
          "B04_10m"
        ],
        "properties": {}
      }
    }
  }
}

becuase it is translated like this:

3_1 = oeop.load_collection(odc_cube=cube, **{'product': 'S2_L2A_T32TPS', 'dask_chunks': {'time': 'auto', 'x': 1000, 'y': 1000}, 'x': (11.114774461650697, 11.137519595552675), 'y': (46.06031036495747, 46.07615051669467), 'time': ['2019-05-01T00:00:00Z', '2019-05-30T00:00:00Z'], 'measurements': ['B02_10m', 'B03_10m', 'B04_10m']})
2_0 = oeop.save_result(**{'data': 3_1, 'format': 'NETCDF'})

and Python can't assign variables starting with numbers: SyntaxError: can't assign to literal