Add support for end dates/IDs to diff processing functions#304
Merged
lonvia merged 5 commits intoosmcode:masterfrom Oct 5, 2025
Merged
Add support for end dates/IDs to diff processing functions#304lonvia merged 5 commits intoosmcode:masterfrom
lonvia merged 5 commits intoosmcode:masterfrom
Conversation
Also moves some code that is shared between the two tools into a separate file.
The former cannot replace an existing file on Windows.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This adds a new parameter
end_idto the diff processing functions, which allows to define the precise ID when to stop downloading diffs. This gives more fine-grained control over the number of diffs downloaded thanmax_sizecan do.The tools pyosmium-get-changes and pyosmium-up-to-date get two new parameters where you can define the end date either with an ID or a date. The latter will automatically compute the appropriate ID for your convenience. Just keep in mind that date-to-ID conversions are always approximate. There is no guarantee that using
--end-datein one run and the same date as--start-datein the next run will result in continuous, non-overlapping diffs. Always use the returned ID as a base for the next run.Adds proper typing for the tool code and some tests for pyosmium-up-to-date. The tests in turn uncovered that file replacement doesn't work as expected on Windows. So fixed that.