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

choose start date automatically, based on end date + period #33

Merged
merged 6 commits into from
Jun 7, 2024

Conversation

tyrasd
Copy link
Member

@tyrasd tyrasd commented Jan 19, 2024

Sometimes it can be annoying that the timestamps in a query results are foremost based on the start date: especially for larger periods (e.g. a yearly interval), the difference between the last included timestamp in the query and the latest available OSM data in the database/ohsome-API can be quite large. Typically, it is more desirable to get the most recent available data.

This PR solves this by calculating the start data automatically (if not manually set), based on the given end date and the given period.

  • the start date is kept empty by default; only the end date is filled in with the latest available date of the data base (via metadata request)
  • if the start date is not set manually, it is calculated manually such that start + n*period ~= end, see Data Freeze to 2023-10-07 #32 (comment). (Typically it will work out such that the determined start date matches the end date exactly, but there are some edge cases like February 29 on non-leap years, or a 31th of a month with <31 days, which may result in a few days of variance.)

@tyrasd tyrasd added the enhancement New feature or request label Jan 19, 2024
@tyrasd tyrasd requested review from mcauer and joker234 January 19, 2024 15:05
@tyrasd tyrasd force-pushed the feature/automatic-start-date branch from 3d24e13 to 4761ee2 Compare May 17, 2024 12:31
@tyrasd tyrasd force-pushed the feature/automatic-start-date branch from 4761ee2 to 43d9752 Compare May 17, 2024 12:34
Copy link

sonarcloud bot commented May 17, 2024

Quality Gate Failed Quality Gate failed

Failed conditions
23.5% Coverage on New Code (required ≥ 80%)

See analysis details on SonarCloud

@tyrasd tyrasd merged commit 41706ba into main Jun 7, 2024
1 check was pending
@tyrasd tyrasd deleted the feature/automatic-start-date branch June 7, 2024 08:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant