PerFileBaseConverter - #207
Open
ivorbosloper wants to merge 6 commits into
Open
Conversation
…easing memory requirements for large data sets
Collaborator
Author
|
@m-mohr There's a highly relevant part here that fixes the hilbert-sort . Would be great to see this on main before other people start publishing new data sets in the wrong sort-order... |
There was a problem hiding this comment.
Pull request overview
Adds per-file conversion and streaming GeoParquet merging to reduce peak memory usage for large datasets.
Changes:
- Introduces Hilbert-sorted, batched merging of converted parts.
- Migrates Spain’s converter to the new pipeline and HCAT/admin mixins.
- Prevents temporary part files from being uploaded.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
pyproject.toml |
Updates Vecorel dependency. |
fiboa_cli/publish.py |
Excludes part files from uploads. |
fiboa_cli/datasets/es.py |
Adopts per-file conversion and updated mappings. |
fiboa_cli/datasets/data-files/es_cl_prv.csv |
Completes Spanish province data. |
fiboa_cli/datasets/commons/hcat.py |
Tightens mapping validation. |
fiboa_cli/conversion/per_file.py |
Implements per-file conversion and merging. |
CHANGELOG.md |
Documents the feature and fixes formatting. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+57
to
+59
| part = os.path.join(dirname, f"{filename}_{index}_part{ext}") | ||
| part_files.append(part) | ||
| if os.path.exists(part): |
| write_kwargs = {"compression": compression} | ||
| if compression_level is not None: | ||
| write_kwargs["compression_level"] = compression_level | ||
| writer = pq.ParquetWriter(output_file, out_schema, **write_kwargs) |
Comment on lines
+156
to
+157
| if col.get("bbox") is not None: | ||
| bboxes.append(col["bbox"]) |
Comment on lines
+160
to
+167
| merged_bbox = None | ||
| if bboxes: | ||
| merged_bbox = ( | ||
| min(b[0] for b in bboxes), | ||
| min(b[1] for b in bboxes), | ||
| max(b[2] for b in bboxes), | ||
| max(b[3] for b in bboxes), | ||
| ) |
| **kwargs, | ||
| ) | ||
|
|
||
| # Multi-source: convert each URI to its own GeoParquet part, then merge. |
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.
Per-file migration and merging the result, decreasing memory requirements for large data sets.
Depends on a new release of Vecorel