smart-geocubes 0.0.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (28) hide show
  1. smart_geocubes-0.0.1/.github/workflows/update_version.yml +131 -0
  2. smart_geocubes-0.0.1/.gitignore +16 -0
  3. smart_geocubes-0.0.1/.python-version +1 -0
  4. smart_geocubes-0.0.1/.vscode/settings.json +7 -0
  5. smart_geocubes-0.0.1/LICENSE +21 -0
  6. smart_geocubes-0.0.1/PKG-INFO +81 -0
  7. smart_geocubes-0.0.1/README.md +39 -0
  8. smart_geocubes-0.0.1/docs/getting_started.md +4 -0
  9. smart_geocubes-0.0.1/docs/index.md +8 -0
  10. smart_geocubes-0.0.1/docs/overrides/main.html +12 -0
  11. smart_geocubes-0.0.1/examples/usage.ipynb +105 -0
  12. smart_geocubes-0.0.1/mkdocs.yml +160 -0
  13. smart_geocubes-0.0.1/pyproject.toml +137 -0
  14. smart_geocubes-0.0.1/src/smart_geocubes/__init__.py +8 -0
  15. smart_geocubes-0.0.1/src/smart_geocubes/accessors/__init__.py +7 -0
  16. smart_geocubes-0.0.1/src/smart_geocubes/accessors/base.py +586 -0
  17. smart_geocubes-0.0.1/src/smart_geocubes/accessors/gee.py +141 -0
  18. smart_geocubes-0.0.1/src/smart_geocubes/accessors/stac.py +125 -0
  19. smart_geocubes-0.0.1/src/smart_geocubes/concurrency/__init__.py +7 -0
  20. smart_geocubes-0.0.1/src/smart_geocubes/concurrency/threading.py +96 -0
  21. smart_geocubes-0.0.1/src/smart_geocubes/datasets/__init__.py +8 -0
  22. smart_geocubes-0.0.1/src/smart_geocubes/datasets/arcticdem.py +276 -0
  23. smart_geocubes-0.0.1/src/smart_geocubes/datasets/tctrend.py +102 -0
  24. smart_geocubes-0.0.1/src/smart_geocubes/py.typed +0 -0
  25. smart_geocubes-0.0.1/src/smart_geocubes/storage.py +61 -0
  26. smart_geocubes-0.0.1/tests/test_arcticdem.py +100 -0
  27. smart_geocubes-0.0.1/tests/test_creation.py +122 -0
  28. smart_geocubes-0.0.1/uv.lock +3097 -0
@@ -0,0 +1,131 @@
1
+ name: Update Version
2
+
3
+ on:
4
+ workflow_dispatch:
5
+ inputs:
6
+ bump:
7
+ description: 'The version bump to apply [possible values: major, minor, patch]'
8
+ required: true
9
+ type: choice
10
+ options:
11
+ - patch
12
+ - minor
13
+ - major
14
+ publish:
15
+ description: 'Publish the package to GitHub releases and PyPI?'
16
+ required: false
17
+ type: boolean
18
+ default: true
19
+
20
+ jobs:
21
+ update-version:
22
+ runs-on: ubuntu-latest
23
+
24
+ permissions:
25
+ contents: write
26
+ id-token: write
27
+
28
+ env:
29
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
30
+
31
+ outputs:
32
+ VERSION: ${{ steps.update_version.outputs.tag-number }}
33
+
34
+ steps:
35
+ - name: Checkout repository
36
+ uses: actions/checkout@v4
37
+ with:
38
+ fetch-depth: 0
39
+
40
+ # Do a version bump on the package
41
+ - name: Update version by bumping git tag
42
+ id: update_version
43
+ uses: leonsteinhaeuser/git-tag-bump@v1.1.0
44
+ with:
45
+ args: >-
46
+ --bump ${{ github.event.inputs.bump }} --v-prefix --create --actor-name "GitHub Actions" --actor-mail "github-actions[bot]@users.noreply.github.com"
47
+
48
+ build-and-publish:
49
+ runs-on: ubuntu-latest
50
+ needs:
51
+ - update-version
52
+ permissions:
53
+ contents: write
54
+ id-token: write
55
+
56
+ if: github.event.inputs.publish
57
+
58
+ steps:
59
+ - name: Checkout repository
60
+ uses: actions/checkout@v4
61
+ with:
62
+ fetch-depth: 0
63
+
64
+ - name: Install uv
65
+ uses: astral-sh/setup-uv@v5
66
+ with:
67
+ version: '0.6.7'
68
+
69
+ - name: Set up Python
70
+ run: uv python install
71
+
72
+ - name: Build package
73
+ run: uv build
74
+
75
+ - name: Create GitHub Release
76
+ id: create_release
77
+ uses: actions/create-release@v1
78
+ env:
79
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
80
+ with:
81
+ tag_name: ${{ needs.update-version.outputs.VERSION }}
82
+ release_name: Release ${{ needs.update-version.outputs.VERSION }}
83
+ draft: false
84
+ prerelease: false
85
+
86
+ - name: Publish to PyPI
87
+ run: uv publish --trusted-publishing always
88
+
89
+ build-and-publish-docs:
90
+ runs-on: ubuntu-latest
91
+ needs:
92
+ - update-version
93
+
94
+ steps:
95
+ - name: Checkout repository
96
+ uses: actions/checkout@v2
97
+ with:
98
+ fetch-depth: 0
99
+
100
+ - name: Configure Git Credentials
101
+ run: |
102
+ git config user.name github-actions[bot]
103
+ git config user.email 41898282+github-actions[bot]@users.noreply.github.com
104
+
105
+ - name: Install uv
106
+ uses: astral-sh/setup-uv@v5
107
+ with:
108
+ version: '0.6.7'
109
+
110
+ - name: Set up Python
111
+ run: uv python install
112
+
113
+ - name: Get cache id
114
+ run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
115
+
116
+ - name: Cache dependencies
117
+ uses: actions/cache@v4
118
+ with:
119
+ key: mkdocs-material-${{ env.cache_id }}
120
+ path: .cache
121
+ restore-keys: |
122
+ mkdocs-material
123
+
124
+ - name: Install dependencies
125
+ run: uv sync --all-extras --group docs
126
+
127
+ - name: Install dependencies
128
+ run: uv sync --all-extras --group docs
129
+
130
+ - name: Publish documentation
131
+ run: uv run mike deploy --push --update-aliases ${{ needs.update-version.outputs.VERSION }} latest
@@ -0,0 +1,16 @@
1
+ # Python-generated files
2
+ __pycache__/
3
+ *.py[oc]
4
+ build/
5
+ dist/
6
+ wheels/
7
+ *.egg-info
8
+
9
+ # Virtual environments
10
+ .venv
11
+
12
+ # data
13
+ data
14
+
15
+ # Playground
16
+ playground.ipynb
@@ -0,0 +1 @@
1
+ 3.13.2
@@ -0,0 +1,7 @@
1
+ {
2
+ "python.testing.pytestArgs": [
3
+ "tests"
4
+ ],
5
+ "python.testing.unittestEnabled": false,
6
+ "python.testing.pytestEnabled": true
7
+ }
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Tobias Hölzer
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,81 @@
1
+ Metadata-Version: 2.4
2
+ Name: smart-geocubes
3
+ Version: 0.0.1
4
+ Summary: A high-performance library for intelligent loading and caching of remote geospatial raster data, built with xarray and zarr.
5
+ Project-URL: Documentation, https://relativityhd.github.io/smart-geocubes/latest/
6
+ Project-URL: Repository, https://github.com/relativityhd/smart-geocubes
7
+ Project-URL: Issues, https://github.com/relativityhd/smart-geocubes/issues
8
+ Author-email: relativityhd <tobiashoelzer@hotmail.com>
9
+ License-Expression: MIT
10
+ License-File: LICENSE
11
+ Classifier: Operating System :: OS Independent
12
+ Classifier: Programming Language :: Python :: 3
13
+ Requires-Python: >=3.11
14
+ Requires-Dist: geopandas>=1.0.1
15
+ Requires-Dist: icechunk<0.3,>=0.2.5
16
+ Requires-Dist: numcodecs<0.16,>=0.15.0
17
+ Requires-Dist: numpy<3,>=1.20
18
+ Requires-Dist: odc-geo<0.5,>=0.4.5
19
+ Requires-Dist: stopuhr>=0.0.3
20
+ Requires-Dist: xarray>=2025.1.1
21
+ Requires-Dist: zarr<4,>=3
22
+ Provides-Extra: dask
23
+ Requires-Dist: bokeh>=3.6.3; extra == 'dask'
24
+ Requires-Dist: dask>=2025.1.0; extra == 'dask'
25
+ Requires-Dist: distributed>=2025.1.0; extra == 'dask'
26
+ Provides-Extra: gee
27
+ Requires-Dist: earthengine-api>=1.1.5; extra == 'gee'
28
+ Requires-Dist: rasterio>=1.4.3; extra == 'gee'
29
+ Requires-Dist: rioxarray>=0.18.2; extra == 'gee'
30
+ Requires-Dist: xee>=0.0.20; extra == 'gee'
31
+ Provides-Extra: stac
32
+ Requires-Dist: odc-stac>=0.3.11; extra == 'stac'
33
+ Requires-Dist: pystac-client>=0.8.5; extra == 'stac'
34
+ Requires-Dist: pystac>=1.12.1; extra == 'stac'
35
+ Requires-Dist: xpystac>=0.1.3; extra == 'stac'
36
+ Provides-Extra: viz
37
+ Requires-Dist: cartopy>=0.24.1; extra == 'viz'
38
+ Requires-Dist: folium>=0.19.4; extra == 'viz'
39
+ Requires-Dist: mapclassify>=2.8.1; extra == 'viz'
40
+ Requires-Dist: matplotlib>=3.10.0; extra == 'viz'
41
+ Description-Content-Type: text/markdown
42
+
43
+ # Smart Geocubes
44
+
45
+ A high-performance library for intelligent loading and caching of remote geospatial raster data, built with xarray, zarr and icechunk.
46
+
47
+ ## Development
48
+
49
+ Install for everything:
50
+
51
+ ```sh
52
+ uv sync --all-extras --all-groups
53
+ ```
54
+
55
+ ### Roadmap
56
+
57
+ Features:
58
+
59
+ - [ ] STAC: Add dask download as optional
60
+ - [x] STAC: Make the progress-bar optional
61
+ - [ ] Overall: Add support for temporal axis
62
+ - [ ] Overall: Add support for 3D data
63
+ - [ ] Overall: Add support for 4D data
64
+ - [X] GEE Accessor
65
+ - [ ] Widen support for lat-lon data
66
+ - [ ] Support different x-y resolutions
67
+ - [ ] True threaded mode: multiple threads for downloading, one thread for writing, multiple for loading
68
+
69
+ Datasets:
70
+
71
+ - [X] ArcticDEM: increase readspeed by using extent files
72
+ - [X] TCTrend Dataset
73
+ - [ ] S2 Dataset
74
+ - [ ] Landsat Dataset
75
+
76
+ Admin:
77
+
78
+ - [X] Use StopUhr to measure performance
79
+ - [ ] Write documentation (sphinx or mkdocs)
80
+ - [ ] Add GitHub Action
81
+ - [ ] Publish to PyPy
@@ -0,0 +1,39 @@
1
+ # Smart Geocubes
2
+
3
+ A high-performance library for intelligent loading and caching of remote geospatial raster data, built with xarray, zarr and icechunk.
4
+
5
+ ## Development
6
+
7
+ Install for everything:
8
+
9
+ ```sh
10
+ uv sync --all-extras --all-groups
11
+ ```
12
+
13
+ ### Roadmap
14
+
15
+ Features:
16
+
17
+ - [ ] STAC: Add dask download as optional
18
+ - [x] STAC: Make the progress-bar optional
19
+ - [ ] Overall: Add support for temporal axis
20
+ - [ ] Overall: Add support for 3D data
21
+ - [ ] Overall: Add support for 4D data
22
+ - [X] GEE Accessor
23
+ - [ ] Widen support for lat-lon data
24
+ - [ ] Support different x-y resolutions
25
+ - [ ] True threaded mode: multiple threads for downloading, one thread for writing, multiple for loading
26
+
27
+ Datasets:
28
+
29
+ - [X] ArcticDEM: increase readspeed by using extent files
30
+ - [X] TCTrend Dataset
31
+ - [ ] S2 Dataset
32
+ - [ ] Landsat Dataset
33
+
34
+ Admin:
35
+
36
+ - [X] Use StopUhr to measure performance
37
+ - [ ] Write documentation (sphinx or mkdocs)
38
+ - [ ] Add GitHub Action
39
+ - [ ] Publish to PyPy
@@ -0,0 +1,4 @@
1
+ # Getting Started
2
+
3
+ Sorry, nothing to see here yet. Check back later!
4
+ Until then, check the [Reference](reference/smart_geocubes/index.md).
@@ -0,0 +1,8 @@
1
+ ---
2
+ hide:
3
+ - navigation
4
+ ---
5
+
6
+ # Smart-Geocubes
7
+
8
+ A high-performance library for intelligent loading and caching of remote geospatial raster data, built with xarray, zarr and icechunk.
@@ -0,0 +1,12 @@
1
+ {% extends "base.html" %}
2
+
3
+ {% block outdated %}
4
+ You're not viewing the latest version.
5
+ <a href="{{ '../' ~ base_url }}">
6
+ <strong>Click here to go to latest.</strong>
7
+ </a>
8
+ {% endblock %}
9
+
10
+ {% block announce %}
11
+ Smart-Geocubes is in early Alpha!
12
+ {% endblock %}
@@ -0,0 +1,105 @@
1
+ {
2
+ "cells": [
3
+ {
4
+ "cell_type": "markdown",
5
+ "metadata": {},
6
+ "source": [
7
+ "OUT-OF-DATE!"
8
+ ]
9
+ },
10
+ {
11
+ "cell_type": "code",
12
+ "execution_count": null,
13
+ "metadata": {},
14
+ "outputs": [],
15
+ "source": [
16
+ "# Use Case 1: Open a pre-configured dataset, e.g. ArcticDEM\n",
17
+ "\n",
18
+ "import xarray as xr\n",
19
+ "\n",
20
+ "from smart_geocubes.datasets import ArcticDEM32m\n",
21
+ "\n",
22
+ "ndvi: xr.DataArray = ...\n",
23
+ "\n",
24
+ "adem32 = ArcticDEM32m.load_like(ndvi, \"data/arcticdem/32m/\")\n",
25
+ "\n",
26
+ "assert ndvi.crs == adem32.crs, ndvi.shape == adem32.shape"
27
+ ]
28
+ },
29
+ {
30
+ "cell_type": "code",
31
+ "execution_count": null,
32
+ "metadata": {},
33
+ "outputs": [],
34
+ "source": [
35
+ "# Use Case 2: Open a pre-configured dataset, e.g. ArcticDEM, with a specific bounding box#\n",
36
+ "\n",
37
+ "from odc.geo.geobox import GeoBox\n",
38
+ "\n",
39
+ "from smart_geocubes.datasets import ArcticDEM32m\n",
40
+ "\n",
41
+ "geobox: GeoBox = ...\n",
42
+ "\n",
43
+ "adem32 = ArcticDEM32m.load(geobox, \"data/arcticdem/32m/\")"
44
+ ]
45
+ },
46
+ {
47
+ "cell_type": "code",
48
+ "execution_count": null,
49
+ "metadata": {},
50
+ "outputs": [],
51
+ "source": [
52
+ "# Use Case 3: Configure cache chunks and encoding for an existing dataset\n",
53
+ "\n",
54
+ "from odc.geo.geobox import GeoBox\n",
55
+ "\n",
56
+ "from smart_geocubes.datasets import ArcticDEM32m\n",
57
+ "\n",
58
+ "geobox: GeoBox = ...\n",
59
+ "\n",
60
+ "adem32 = ArcticDEM32m.load(geobox, \"data/arcticdem/32m/\", chunk_size=512, data_vars_encoding={\"zlib\": True})"
61
+ ]
62
+ },
63
+ {
64
+ "cell_type": "code",
65
+ "execution_count": null,
66
+ "metadata": {},
67
+ "outputs": [],
68
+ "source": [
69
+ "# Use Case 4: Define a new dataset with a custom configuration\n",
70
+ "from typing import ClassVar\n",
71
+ "\n",
72
+ "from odc.geo.geobox import GeoBox\n",
73
+ "\n",
74
+ "from smart_geocubes.accessors import STACAccessor\n",
75
+ "\n",
76
+ "\n",
77
+ "class MyDataset(STACAccessor):\n",
78
+ " \"\"\"Custom STAC dataset.\"\"\"\n",
79
+ "\n",
80
+ " chunk_size = 512\n",
81
+ " data_vars_encoding: ClassVar[dict] = {\"zlib\": True}\n",
82
+ " stac_api_url = \"https://example.com/stac\"\n",
83
+ " collection = \"my-collection\"\n",
84
+ "\n",
85
+ "\n",
86
+ "geobox: GeoBox = ...\n",
87
+ "\n",
88
+ "adem32 = MyDataset.load(geobox, \"data/arcticdem/32m/\")"
89
+ ]
90
+ }
91
+ ],
92
+ "metadata": {
93
+ "kernelspec": {
94
+ "display_name": ".venv",
95
+ "language": "python",
96
+ "name": "python3"
97
+ },
98
+ "language_info": {
99
+ "name": "python",
100
+ "version": "3.11.10"
101
+ }
102
+ },
103
+ "nbformat": 4,
104
+ "nbformat_minor": 2
105
+ }
@@ -0,0 +1,160 @@
1
+ site_name: Smart-Geocubes
2
+ site_url: https://relativityhd.github.io/smart-geocubes
3
+ site_author: Tobias Hölzer
4
+ site_description: >
5
+ A high-performance library for intelligent loading and caching of remote geospatial raster data, built with xarray, zarr and icechunk.
6
+
7
+ repo_name: smart-geocubes
8
+ repo_url: https://github.com/relativityhd/smart-geocubes
9
+ edit_uri: edit/main/docs/
10
+
11
+ nav:
12
+ - Home: index.md
13
+ - Getting Started: getting_started.md
14
+
15
+ theme:
16
+ name: material
17
+ language: en
18
+ custom_dir: docs/overrides
19
+ icon:
20
+ repo: fontawesome/brands/github
21
+ edit: material/pencil
22
+ view: material/eye
23
+ palette:
24
+ # Palette toggle for automatic mode
25
+ - media: '(prefers-color-scheme)'
26
+ primary: lime
27
+ accent: green
28
+ toggle:
29
+ icon: material/brightness-auto
30
+ name: Switch to light mode
31
+
32
+ # Palette toggle for light mode
33
+ - scheme: default
34
+ media: '(prefers-color-scheme: light)'
35
+ primary: lime
36
+ accent: green
37
+ toggle:
38
+ icon: material/brightness-7
39
+ name: Switch to dark mode
40
+
41
+ # Palette toggle for dark mode
42
+ - scheme: slate
43
+ media: '(prefers-color-scheme: dark)'
44
+ primary: lime
45
+ accent: green
46
+ toggle:
47
+ icon: material/brightness-4
48
+ name: Switch to system preference
49
+ font:
50
+ text: Montserrat
51
+ code: Roboto Mono
52
+ features:
53
+ - navigation.instant
54
+ - navigation.instant.progress
55
+ - navigation.tracking
56
+ - navigation.tabs
57
+ - navigation.tabs.sticky
58
+ - navigation.indexes
59
+ - toc.follow
60
+ - navigation.top
61
+ - search.suggest
62
+ - search.highlight
63
+ - search.share
64
+ - navigation.footer
65
+ - content.action.edit
66
+ - content.code.copy
67
+ - content.code.annotate
68
+ plugins:
69
+ - glightbox
70
+ - mkdocstrings:
71
+ handlers:
72
+ python:
73
+ paths:
74
+ - 'src'
75
+ inventories:
76
+ - https://docs.python.org/3/objects.inv
77
+ - https://docs.xarray.dev/en/stable/objects.inv
78
+ - https://numpy.org/doc/stable/objects.inv
79
+ options:
80
+ docstring_section_style: list # or "table"
81
+ docstring_style: 'google'
82
+ filters: ['!^_']
83
+ heading_level: 1
84
+ merge_init_into_class: true
85
+ parameter_headings: true
86
+ separate_signature: true
87
+ show_root_heading: true
88
+ show_signature_annotations: true
89
+ show_symbol_type_heading: true
90
+ show_symbol_type_toc: true
91
+ summary: true
92
+ - api-autonav:
93
+ modules: ['src/smart_geocubes']
94
+ - autorefs:
95
+ resolve_closest: true
96
+ - privacy:
97
+ enabled: !ENV [CI, false]
98
+ - search:
99
+ lang: en
100
+ - social:
101
+ enabled: !ENV [CI, false]
102
+ - git-revision-date-localized:
103
+ enabled: !ENV [CI, false]
104
+ enable_creation_date: true
105
+ type: date
106
+ - git-committers:
107
+ enabled: !ENV [CI, false]
108
+ repository: relativityhd/smart-geocubes
109
+ branch: main
110
+ extra:
111
+ version:
112
+ provider: mike
113
+ default: latest
114
+ alias: true
115
+ social:
116
+ - icon: fontawesome/brands/github
117
+ name: GitHub
118
+ link: https://github.com/relativityhd/smart-geocubes
119
+ - icon: fontawesome/brands/python
120
+ name: PyPI
121
+ link: https://pypi.org/project/smart-geocubes
122
+ consent:
123
+ title: Cookie consent
124
+ description: >-
125
+ We use cookies to recognize your repeated visits and preferences, as well
126
+ as to measure the effectiveness of our documentation and whether users
127
+ find what they're searching for. With your consent, you're helping us to
128
+ make our documentation better.
129
+ cookies:
130
+ fonts:
131
+ name: Google Fonts
132
+ checked: false
133
+ github:
134
+ name: GitHub
135
+ checked: false
136
+ actions:
137
+ - accept
138
+ - manage
139
+ - reject
140
+ copyright: >
141
+ Copyright &copy; 2025 Tobias Hölzer -
142
+ <a href="#__consent">Change cookie settings</a>
143
+ markdown_extensions:
144
+ - pymdownx.highlight:
145
+ anchor_linenums: true
146
+ line_spans: __span
147
+ pygments_lang_class: true
148
+ - pymdownx.tasklist:
149
+ custom_checkbox: true
150
+ - pymdownx.inlinehilite
151
+ - pymdownx.snippets
152
+ - pymdownx.superfences
153
+ - pymdownx.details
154
+ - attr_list
155
+ - admonition
156
+ - tables
157
+ - def_list
158
+ - toc:
159
+ permalink: true
160
+ title: Table of Contents