Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

openeo grass driver: fix apply process #104

Merged
merged 3 commits into from
Aug 11, 2021
Merged

openeo grass driver: fix apply process #104

merged 3 commits into from
Aug 11, 2021

Conversation

metzm
Copy link
Collaborator

@metzm metzm commented Jul 27, 2021

fix parsing of the process graph inside the apply process definition

@metzm metzm requested review from mmacata and griembauer July 27, 2021 20:56
metzm and others added 2 commits July 28, 2021 11:01
@griembauer
Copy link
Collaborator

Thanks, I also added a basename parameter to t.rast.mapcalc, because it will fail without it. Local testing was successful with the operators in OPERATOR_DICT and FN_DICT. However, using apply with two different datasets seems not to be possible at the moment, as arguments["data"] is explicitly parsed in this PR and constructions like the following cannot be validated:

[...]
    "apply1": {
      "process_id": "apply",
      "arguments": {
        "data": {
          "from_node": "loadcollection1"
        },
        "process": {
          "process_graph": {
            "lte1": {
              "process_id": "subtract",
              "arguments": {
                "x": 1,
                "y": {
                  "from_argument": "data"
                }
              },
              "result": true
            }
          }
        }
      }
# how to pass two datasets as data arguments to the following node?
    },
    "apply2": {
      "process_id": "apply",
      "arguments": {
        "data1": {
          "from_node": "loadcollection1"
        },
        "data2": {
          "from_node": "apply1"
        },
        "process": {
          "process_graph": {
            "lte1": {
              "process_id": "divide",
              "arguments": {
                "x": {
                  "from_argument": "data1"
                },
                "y": {
                  "from_argument": "data2"
                }
              },
              "result": true
            }
          }
        }
      }
    },
[...]

Validation then yields:

{
  "id": "2021-07-28T11:45:12.380149",
  "code": "Bad Request",
  "message": "'NoneType' object has no attribute 'output_objects'",
  "links": []

However this may be subject to a dedicated PR.

@metzm
Copy link
Collaborator Author

metzm commented Jul 28, 2021

apply (Apply a process to each pixel) is one of the officially defined openeo processes: https://processes.openeo.org/#apply and takes only one single datacube as input. Passing two datasets is not allowed because it would violate the API.

What you have in mind with several datasets as input would be in openeo an array of raster-cubes which is not defined in https://github.com/Open-EO/openeo-processes/blob/master/meta/subtype-schemas.json but we might need such arrays of raster-cubes as input for some of our backend-specific processes.

Copy link
Collaborator

@mmacata mmacata left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Please merge.

@metzm metzm merged commit 3e84d72 into master Aug 11, 2021
@metzm metzm deleted the apply_process branch August 11, 2021 17:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants