Skip to content

Commit

Permalink
Merge branch 'main' into pre-commit-ci-update-config
Browse files Browse the repository at this point in the history
  • Loading branch information
RaczeQ authored Oct 25, 2024
2 parents 763c944 + 38613aa commit b304d3c
Show file tree
Hide file tree
Showing 27 changed files with 1,252 additions and 226 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ jobs:
key: mkdocs-osm-dev-cache-${{ runner.os }}
- name: Prepare DuckDB dependency
run: |
wget https://github.com/duckdb/duckdb/releases/download/v0.10.2/duckdb_cli-linux-amd64.zip
wget https://github.com/duckdb/duckdb/releases/download/v1.1.0/duckdb_cli-linux-amd64.zip
unzip duckdb_cli-linux-amd64.zip
chmod a+x ./duckdb
- name: Test required commands
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ jobs:
key: mkdocs-osm-dev-cache-${{ runner.os }}
- name: Prepare DuckDB dependency
run: |
wget https://github.com/duckdb/duckdb/releases/download/v0.10.2/duckdb_cli-linux-amd64.zip
wget https://github.com/duckdb/duckdb/releases/download/v1.1.0/duckdb_cli-linux-amd64.zip
unzip duckdb_cli-linux-amd64.zip
chmod a+x ./duckdb
- name: Test required commands
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/run-manual-pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: "3.12"
python-version: "3.10"
- uses: pdm-project/setup-pdm@v3
name: Setup PDM
with:
python-version: 3.12
python-version: "3.10"
architecture: x64
enable-pep582: true
cache: true
Expand Down
12 changes: 12 additions & 0 deletions .github/workflows/update_usage_plots.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,18 @@ jobs:
name: Update resources usage plots 📈 and create PR
runs-on: ubuntu-latest
steps:
- name: Remove unused software
run: |
echo "Available storage before:"
sudo df -h
echo
sudo rm -rf /usr/share/dotnet
sudo rm -rf /usr/local/lib/android
sudo rm -rf /opt/ghc
sudo rm -rf /opt/hostedtoolcache/CodeQL
echo "Available storage after:"
sudo df -h
echo
- uses: actions/checkout@v4
with:
fetch-depth: 0
Expand Down
11 changes: 7 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
default_stages: [commit]
default_stages: [pre-commit]
repos:
- repo: https://github.com/compilerla/conventional-pre-commit
rev: v3.4.0
Expand All @@ -12,12 +12,15 @@ repos:
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix, --show-fixes]
# TODO: Switch back to upstream docformatter
# after https://github.com/PyCQA/docformatter/issues/289 is fixed
- repo: https://github.com/PyCQA/docformatter
rev: v1.7.5
rev: eb1df34
# rev: v1.7.5
hooks:
- id: docformatter
additional_dependencies: [tomli]
args: ["--in-place", "--config", "./pyproject.toml"]
args: [--in-place, --config, ./pyproject.toml]
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.11.2
hooks:
Expand All @@ -36,7 +39,7 @@ repos:
hooks:
- id: nbstripout
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
rev: v5.0.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
Expand Down
38 changes: 37 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,36 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Changed

- Moved location of the OSM extracts providers to the global cache [#173](https://github.com/kraina-ai/quackosm/issues/173)

## [0.11.2] - 2024-10-14

### Added

- Option to pass a bounding box as a geometry filter in CLI [#169](https://github.com/kraina-ai/quackosm/issues/169)

### Changed

- Modified CLI descriptions and hid unnecessary default values [#169](https://github.com/kraina-ai/quackosm/issues/169)

## [0.11.1] - 2024-10-09

### Added

- Option to export to DuckDB database [#94](https://github.com/kraina-ai/quackosm/issues/119) (implemented by [@mwip](https://github.com/mwip))

## [0.11.0] - 2024-09-24

### Changed

- Bumped minimal DuckDB version to `1.1.0`
- Refactored geoparquet operations for compatibility with new DuckDB version
- Excluded `conftest.py` file from the final library build
- Replaced `unary_union` calls with `union_all()` on all GeoDataFrames
- Silenced `pooch` library warnings regarding empty SHA hash

## [0.10.0] - 2024-09-23

### Changed
Expand Down Expand Up @@ -373,7 +403,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Created QuackOSM repository
- Implemented PbfFileReader

[Unreleased]: https://github.com/kraina-ai/quackosm/compare/0.10.0...HEAD
[Unreleased]: https://github.com/kraina-ai/quackosm/compare/0.11.2...HEAD

[0.11.2]: https://github.com/kraina-ai/quackosm/compare/0.11.1...0.11.2

[0.11.1]: https://github.com/kraina-ai/quackosm/compare/0.11.0...0.11.1

[0.11.0]: https://github.com/kraina-ai/quackosm/compare/0.10.0...0.11.0

[0.10.0]: https://github.com/kraina-ai/quackosm/compare/0.9.4...0.10.0

Expand Down
14 changes: 4 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ QuackOSM supports **Python >= 3.9**

Required:

- `duckdb (>=0.10.2, <1.1.0)`: For all DuckDB operations on PBF files
- `duckdb (>=1.1.0)`: For all DuckDB operations on PBF files

- `pyarrow (>=16.0.0)`: For parquet files wrangling

Expand Down Expand Up @@ -148,9 +148,7 @@ way/993121275 {'building': 'yes', 'name': ... POLYGON ((7.43214 43.7481...
```python
>>> import duckdb
>>> duckdb.load_extension('spatial')
>>> duckdb.read_parquet(str(gpq_path)).project(
... "* REPLACE (ST_GeomFromWKB(geometry) AS geometry)"
... ).order("feature_id")
>>> duckdb.read_parquet(str(gpq_path)).order("feature_id")
┌──────────────────┬──────────────────────┬──────────────────────────────────────────────┐
│ feature_id │ tags │ geometry │
│ varchar │ map(varchar, varch… │ geometry │
Expand Down Expand Up @@ -270,9 +268,7 @@ way/998561139 {'barrier': 'bollard', 'bicyc... LINESTRING (12.45828 41.9...
```python
>>> import duckdb
>>> duckdb.load_extension('spatial')
>>> duckdb.read_parquet(str(gpq_path)).project(
... "* REPLACE (ST_GeomFromWKB(geometry) AS geometry)"
... ).order("feature_id")
>>> duckdb.read_parquet(str(gpq_path)).order("feature_id")
┌──────────────────┬──────────────────────┬──────────────────────────────────────────────┐
│ feature_id │ tags │ geometry │
│ varchar │ map(varchar, varch… │ geometry │
Expand Down Expand Up @@ -388,9 +384,7 @@ relation/3256168 {'building': 'yes', 'type': ... POLYGON ((12.46061 41.907...
```python
>>> import duckdb
>>> duckdb.load_extension('spatial')
>>> duckdb.read_parquet(str(gpq_path)).project(
... "* REPLACE (ST_GeomFromWKB(geometry) AS geometry)"
... ).order("feature_id")
>>> duckdb.read_parquet(str(gpq_path)).order("feature_id")
┌──────────────────┬────────────────────────────┬──────────────────────────────┐
│ feature_id │ tags │ geometry │
│ varchar │ map(varchar, varchar) │ geometry │
Expand Down
Binary file modified docs/assets/images/estonia_disk_spillage.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/assets/images/monaco_disk_spillage.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/assets/images/poland_disk_spillage.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 3 additions & 9 deletions examples/pbf_file_reader.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,7 @@
"connection.load_extension(\"parquet\")\n",
"connection.load_extension(\"spatial\")\n",
"\n",
"features_relation = connection.read_parquet(str(reykjavik_buildings_gpq)).project(\n",
" \"* REPLACE (ST_GeomFromWKB(geometry) AS geometry)\"\n",
")\n",
"features_relation = connection.read_parquet(str(reykjavik_buildings_gpq))\n",
"features_relation"
]
},
Expand Down Expand Up @@ -190,9 +188,7 @@
"metadata": {},
"outputs": [],
"source": [
"features_relation = connection.read_parquet(str(estonia_features_gpq)).project(\n",
" \"* REPLACE (ST_GeomFromWKB(geometry) AS geometry)\"\n",
")\n",
"features_relation = connection.read_parquet(str(estonia_features_gpq))\n",
"features_relation"
]
},
Expand Down Expand Up @@ -294,9 +290,7 @@
"metadata": {},
"outputs": [],
"source": [
"features_relation = connection.read_parquet(str(liechtenstein_features_gpq)).project(\n",
" \"* REPLACE (ST_GeomFromWKB(geometry) AS geometry)\"\n",
")\n",
"features_relation = connection.read_parquet(str(liechtenstein_features_gpq))\n",
"features_relation"
]
},
Expand Down
76 changes: 38 additions & 38 deletions pdm.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit b304d3c

Please sign in to comment.