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

tests for filter_labels missing #256

Open
clausmichele opened this issue May 30, 2024 · 3 comments
Open

tests for filter_labels missing #256

clausmichele opened this issue May 30, 2024 · 3 comments

Comments

@clausmichele
Copy link
Member

The implementation of filter_labels is here:

def filter_labels(data: RasterCube, condition: Callable, dimension: str) -> RasterCube:

However, I can't find any test or examples using it.

I would like to use it to filter specific dates from a datacube. Something similar to what is done here: https://github.com/Open-EO/openeo-community-examples/blob/815ab0cf4662a1b2be0881f55a9d4896467ed224/python/ParcelDelineation/Parcel%20delineation.ipynb

@ValentinaHutter @GeraldIr do you use filter_labels somewhere?

@ValentinaHutter
Copy link
Collaborator

ValentinaHutter commented Jun 7, 2024

Thanks for pointing this out! We do not use it, yet, but I tested it this week and found that:

"filter2": {
      "process_id": "filter_labels",
      "arguments": {
        "data": {
          "from_node": "load1"
        },
        "condition": {
          "process_graph": {
            "is1": {
              "process_id": "is_valid",
              "arguments": {
                "x": {
                  "from_parameter": "value"
                }
              },
              "result": true
            }
          }
        },
        "dimension": "t"
      }
    }
  • condition processes with two input parameters x and y currently do not run through, as the y is not parsed correctly. We could use the context parameter to do this.
  • using a condition process like eq currently does not work for strings or datetime objects, so we will need to check the comparison category for that. From the example, I would assume that you want to use the between process? Is that correct?

I think we can try to get these changes done in the next few weeks.

Meanwhile, does it make sense to you to use filter_temporal instead?

Also, to list all things that need to be done:

  • add tests for filter_labels

@clausmichele
Copy link
Member Author

Hi @ValentinaHutter, do you have plans to work on this? Being able to filter only specific dates is a feature which would be helpful to many. The use of filter_temporal is a workaround but for many dates generates an over-complex graph and it's also not trivial to implement client side.

@ValentinaHutter
Copy link
Collaborator

Sorry for the delay, I think I overlooked the message after I came back from holiday - I now updated the implementation, and added a test using the eq process, haven't tested it with a more complex process_graph, yet. I will update the process specification in eodcgmbh/openeo-processes soon to be compliant with the latest specs.

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

No branches or pull requests

2 participants