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

date_between: inconsistent with filter_temporal half-openess #500

Open
soxofaan opened this issue Apr 5, 2024 · 4 comments
Open

date_between: inconsistent with filter_temporal half-openess #500

soxofaan opened this issue Apr 5, 2024 · 4 comments

Comments

@soxofaan
Copy link
Member

soxofaan commented Apr 5, 2024

This confusion came up in a discussion with @VictorVerhaert:
date_between handles the temporal extent as left+right closed by default:

date_between(string x, string min, string max, ?boolean exclude_max = false) : boolean|null

By default, this process checks whether x is later than or equal to min and before or equal to max.

This is not in line with the left-closed definition of the temporal extents in filter_temporal, load_collection, load_stac, ...

@soxofaan
Copy link
Member Author

soxofaan commented Apr 5, 2024

A naive fix is flipping the default of exclude_max to true, but this is of course a breaking change.

This is an experimental process, but we have indication that it is already being used.
For example it is being used in https://github.com/Open-EO/openeo-community-examples/blob/main/python/ParcelDelineation/Parcel%20delineation.ipynb

@jdries
Copy link
Contributor

jdries commented Apr 5, 2024

It's indeed used by 2 or 3 users, but my feeling is that they are not necessarily affected, so I would consider to just fix it.

@m-mohr
Copy link
Member

m-mohr commented May 16, 2024

This is aligned with the between process, which is also defaulting to inclusive bounds and has the same signature, including the exclude_max parameter.
Does this really need a fix? It can be changed at any time through the parameter.

@soxofaan
Copy link
Member Author

soxofaan commented Jun 4, 2024

another option:

leave as-is:

date_between(string x, string min, string max, ?boolean exclude_max = false) :  boolean|null

but add

date_within(string x, temporal-interval:array<string|null> extent): boolean|null

Where the interval is handled left-closed (per definition of the temporal-interval subtype), as in all the other places (load_collection, filter_temporal, load_stac).
Counter-argument is that this might be confusing, but it should be straightforward to catch/report issues client side as date_between requires at least 3 arguments while date_within requires exactly 2 arguments

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants