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

feat: Semantic temporal filter evaluation 🎁 #56

Open
wants to merge 17 commits into
base: main
Choose a base branch
from

Conversation

fkroeber
Copy link
Collaborator

@fkroeber fkroeber commented Oct 1, 2024

Description

Current situation

The temporal extent of the loaded data is determined exclusively via the context parameter time that needs to be passed to the QueryProcessor. If the data is further subset temporally within a recipe, all data would first be loaded in order to subsequently filter it temporally.

New feature

The execution of the QueryProcessor via recipe.execute() has an optional preceding FilterProcessor which is switched on by default (filter_check=True). The FilterProcessor evaluates the recipe for possible temporal filter operations in order to analyse which data actually needs to be loaded for the result calculation. The FilterProcessor uses a semantic evaluation of the recipe to filter the metadata in advance to the extent necessary in terms of time. The FilterProcessor evaluates the entire recipe for temporal filter operations and keeps track of the data layers that are affected by these filter operations.

-> For further information please find the corresponding descriptions in the demo/processor.ipnyb.

Type of change

Select one or more relevant options:

  • Bug fix (change which fixes a bug reported in a specific issue)
  • New feature (change which adds a feature requested in a specific issue)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update (improved documentation for existing functionality in the package)
  • Repository update (change related to non-package files or structures in the GitHub repository)

Tbd

  • Check if FilterProcessor works correctly for ODCCube in case of static (=timeless) layers: It's anticipated that the temporal filter processing itself shouldn't be a problem - after all: unless filter_time() is explicitly called on a static layer, nothing will be filtered by the FilterProcessor. However the retrieval of metadata via .retrieve_metadata() as a necessary prerequisite for FilterProcessor may cause problems in case of static layers. Since the available ODC testcube environment on the workstation didn't provide any static layers, this hasn't be investigated closer so far.

Checklist:

  • I have read and understood the contributor guidelines of this project
  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I ran all demo notebooks locally and there where no errors

@fkroeber
Copy link
Collaborator Author

fkroeber commented Oct 1, 2024

I recommend to squash-merge this PR, since the individual commits are not particularly meaningful

@fkroeber
Copy link
Collaborator Author

fkroeber commented Oct 1, 2024

Regarding testing the new feature:

  • There is a notebook called filter_tests.ipynb assessing the general functionality of the FilterProcessor (by running a set of recipes and evaluating the filtered timestamps against the correct result, which has been manually declared for each recipe). I suggest to keep this notebook as a support material during the merge.
  • Further tests including the actual metadata retrieval from an actual data cube (STACCube or ODCCube) have been carried out. Since the reproducibility of these tests requires a setup beyond what is provided in the semantique package, they are not included as part of the PR. However, if someone wants to take a look at the ODCCube testing on the workstation env, the following does at least contain the relevant notebook and env files: ODC_tests.zip

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.

1 participant