geo-explorer 0.1.7__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.
- geo_explorer-0.1.7/LICENSE +21 -0
- geo_explorer-0.1.7/LICENSE.md +21 -0
- geo_explorer-0.1.7/PKG-INFO +191 -0
- geo_explorer-0.1.7/README.md +155 -0
- geo_explorer-0.1.7/pyproject.toml +199 -0
- geo_explorer-0.1.7/src/geo_explorer/__init__.py +2 -0
- geo_explorer-0.1.7/src/geo_explorer/assets/chroma.min.js +58 -0
- geo_explorer-0.1.7/src/geo_explorer/assets/copy_export.js +18 -0
- geo_explorer-0.1.7/src/geo_explorer/assets/on_each_feature.js +68 -0
- geo_explorer-0.1.7/src/geo_explorer/assets/stylesheet.css +3 -0
- geo_explorer-0.1.7/src/geo_explorer/fs.py +57 -0
- geo_explorer-0.1.7/src/geo_explorer/geo_explorer.py +1534 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2022 Statistics Norway
|
|
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,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2023 Statistics Norway
|
|
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,191 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: geo-explorer
|
|
3
|
+
Version: 0.1.7
|
|
4
|
+
Summary: Explore geodata interactively.
|
|
5
|
+
Home-page: https://github.com/statisticsnorway/geo-explorer
|
|
6
|
+
License: MIT
|
|
7
|
+
Author: Morten Letnes
|
|
8
|
+
Author-email: morten.letnes@ssb.no
|
|
9
|
+
Requires-Python: >=3.11,<4
|
|
10
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
11
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
12
|
+
Classifier: Programming Language :: Python :: 3
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
15
|
+
Classifier: Topic :: Scientific/Engineering :: GIS
|
|
16
|
+
Requires-Dist: dash (>=3.1.1)
|
|
17
|
+
Requires-Dist: dash-bootstrap-components (>=2.0.3)
|
|
18
|
+
Requires-Dist: dash-leaflet (>=1.1.3)
|
|
19
|
+
Requires-Dist: fsspec (>=2025.5.1)
|
|
20
|
+
Requires-Dist: geopandas (>=0.14.0)
|
|
21
|
+
Requires-Dist: jenkspy (>=0.3.2)
|
|
22
|
+
Requires-Dist: matplotlib (>=3.7.0)
|
|
23
|
+
Requires-Dist: numpy (>=1.26.4)
|
|
24
|
+
Requires-Dist: pandas (>=2.2.1)
|
|
25
|
+
Requires-Dist: pyarrow (>=20.0.0)
|
|
26
|
+
Requires-Dist: pyproj (>=3.6.1)
|
|
27
|
+
Requires-Dist: rtree (>=1.0.1)
|
|
28
|
+
Requires-Dist: shapely (>=2.0.1)
|
|
29
|
+
Requires-Dist: ssb-sgis (>=1.2.10)
|
|
30
|
+
Requires-Dist: typing-extensions (>=4.11.0)
|
|
31
|
+
Project-URL: Changelog, https://github.com/statisticsnorway/geo-explorer/releases
|
|
32
|
+
Project-URL: Documentation, https://statisticsnorway.github.io/geo-explorer
|
|
33
|
+
Project-URL: Repository, https://github.com/statisticsnorway/geo-explorer
|
|
34
|
+
Description-Content-Type: text/markdown
|
|
35
|
+
|
|
36
|
+
# geo-explorer
|
|
37
|
+
|
|
38
|
+
Explore geodata interactively.
|
|
39
|
+
|
|
40
|
+
Opprettet av:
|
|
41
|
+
ort <ort@ssb.no>
|
|
42
|
+
|
|
43
|
+
---
|
|
44
|
+
|
|
45
|
+
To install, use one of:
|
|
46
|
+
|
|
47
|
+
```shell
|
|
48
|
+
poetry add ssb-sgis
|
|
49
|
+
pip install ssb-sgis
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## GeoExplorer
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
```python
|
|
56
|
+
from geo_explorer import GeoExplorer
|
|
57
|
+
from geo_explorer import LocalFileSystem
|
|
58
|
+
explorer = GeoExplorer(
|
|
59
|
+
start_dir="C:/users/ort/OneDrive - Statistisk sentralbyrå/data",
|
|
60
|
+
file_system=LocalFileSystem(),
|
|
61
|
+
port=8055,
|
|
62
|
+
)
|
|
63
|
+
explorer.run(debug=True)
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
Run locally:
|
|
67
|
+
|
|
68
|
+
```python
|
|
69
|
+
from geo_explorer import GeoExplorer
|
|
70
|
+
from geo_explorer import LocalFileSystem
|
|
71
|
+
explorer = GeoExplorer(
|
|
72
|
+
start_dir="C:/users/user/data",
|
|
73
|
+
file_system=LocalFileSystem(),
|
|
74
|
+
port=None,
|
|
75
|
+
)
|
|
76
|
+
explorer.run()
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
## Developer information
|
|
81
|
+
|
|
82
|
+
### Git LFS
|
|
83
|
+
|
|
84
|
+
The data in the testdata directory is stored with [Git LFS](https://git-lfs.com/).
|
|
85
|
+
Make sure `git-lfs` is installed and that you have run the command `git lfs install`
|
|
86
|
+
at least once. You only need to run this once per user account.
|
|
87
|
+
|
|
88
|
+
### Dependencies
|
|
89
|
+
|
|
90
|
+
[Poetry](https://python-poetry.org/) is used for dependency management. Install
|
|
91
|
+
poetry and run the command below from the root directory to install the dependencies.
|
|
92
|
+
|
|
93
|
+
```shell
|
|
94
|
+
poetry install -E test --no-root
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
### Tests
|
|
98
|
+
|
|
99
|
+
Use the following command from the root directory to run the tests:
|
|
100
|
+
|
|
101
|
+
```shell
|
|
102
|
+
poetry run pytest # from root directory
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
For VS Code there are extensions for opening a python script as Jupyter Notebook,
|
|
106
|
+
for example:
|
|
107
|
+
[Jupytext for Notebooks](https://marketplace.visualstudio.com/items?itemName=donjayamanne.vscode-jupytext).
|
|
108
|
+
|
|
109
|
+
### Code quality
|
|
110
|
+
|
|
111
|
+
Run 'ruff' on all files with safe fixes:
|
|
112
|
+
|
|
113
|
+
```shell
|
|
114
|
+
poetry run ruff check --fix .
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
### Formatting
|
|
118
|
+
|
|
119
|
+
Format the code with `black` and `isort` by running the following command from the
|
|
120
|
+
root directory:
|
|
121
|
+
|
|
122
|
+
```shell
|
|
123
|
+
poetry run black .
|
|
124
|
+
poetry run isort .
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
### Pre-commit hooks
|
|
128
|
+
|
|
129
|
+
We are using [pre-commit hooks](https://pre-commit.com/) to make sure the code is
|
|
130
|
+
correctly formatted and consistent before committing. Use the following command from
|
|
131
|
+
the root directory in the repo to install the pre-commit hooks:
|
|
132
|
+
|
|
133
|
+
```shell
|
|
134
|
+
poetry run pre-commit install
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
It then checks the changed files before committing. You can run the pre-commit checks
|
|
138
|
+
on all files by using this command:
|
|
139
|
+
|
|
140
|
+
```shell
|
|
141
|
+
poetry run pre-commit run --all-files
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
### Documentation
|
|
145
|
+
|
|
146
|
+
To generate the API-documentation locally, run the following command from the root
|
|
147
|
+
directory:
|
|
148
|
+
|
|
149
|
+
```shell
|
|
150
|
+
poetry run sphinx-build -W docs docs/_build
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
Then open the file `docs/_build/index.html`.
|
|
154
|
+
|
|
155
|
+
To check and run the docstrings examples, run this command:
|
|
156
|
+
|
|
157
|
+
```shell
|
|
158
|
+
poetry run xdoctest --command=all ./src/sgis
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
## Contributing
|
|
162
|
+
|
|
163
|
+
Contributions are very welcome.
|
|
164
|
+
To learn more, see the [Contributor Guide].
|
|
165
|
+
|
|
166
|
+
## License
|
|
167
|
+
|
|
168
|
+
Distributed under the terms of the [MIT license][license],
|
|
169
|
+
_SSB sgis_ is free and open source software.
|
|
170
|
+
|
|
171
|
+
## Issues
|
|
172
|
+
|
|
173
|
+
If you encounter any problems,
|
|
174
|
+
please [file an issue] along with a detailed description.
|
|
175
|
+
|
|
176
|
+
## Credits
|
|
177
|
+
|
|
178
|
+
This project was generated from [Statistics Norway]'s [SSB PyPI Template].
|
|
179
|
+
|
|
180
|
+
[statistics norway]: https://www.ssb.no/en
|
|
181
|
+
[pypi]: https://pypi.org/
|
|
182
|
+
[ssb pypi template]: https://github.com/statisticsnorway/ssb-pypitemplate
|
|
183
|
+
[file an issue]: https://github.com/statisticsnorway/ssb-sgis/issues
|
|
184
|
+
[pip]: https://pip.pypa.io/
|
|
185
|
+
|
|
186
|
+
<!-- github-only -->
|
|
187
|
+
|
|
188
|
+
[license]: https://github.com/statisticsnorway/ssb-sgis/blob/main/LICENSE
|
|
189
|
+
[contributor guide]: https://github.com/statisticsnorway/ssb-sgis/blob/main/CONTRIBUTING.md
|
|
190
|
+
[reference guide]: https://statisticsnorway.github.io/ssb-sgis/reference.html
|
|
191
|
+
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
# geo-explorer
|
|
2
|
+
|
|
3
|
+
Explore geodata interactively.
|
|
4
|
+
|
|
5
|
+
Opprettet av:
|
|
6
|
+
ort <ort@ssb.no>
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
To install, use one of:
|
|
11
|
+
|
|
12
|
+
```shell
|
|
13
|
+
poetry add ssb-sgis
|
|
14
|
+
pip install ssb-sgis
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## GeoExplorer
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
```python
|
|
21
|
+
from geo_explorer import GeoExplorer
|
|
22
|
+
from geo_explorer import LocalFileSystem
|
|
23
|
+
explorer = GeoExplorer(
|
|
24
|
+
start_dir="C:/users/ort/OneDrive - Statistisk sentralbyrå/data",
|
|
25
|
+
file_system=LocalFileSystem(),
|
|
26
|
+
port=8055,
|
|
27
|
+
)
|
|
28
|
+
explorer.run(debug=True)
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
Run locally:
|
|
32
|
+
|
|
33
|
+
```python
|
|
34
|
+
from geo_explorer import GeoExplorer
|
|
35
|
+
from geo_explorer import LocalFileSystem
|
|
36
|
+
explorer = GeoExplorer(
|
|
37
|
+
start_dir="C:/users/user/data",
|
|
38
|
+
file_system=LocalFileSystem(),
|
|
39
|
+
port=None,
|
|
40
|
+
)
|
|
41
|
+
explorer.run()
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
## Developer information
|
|
46
|
+
|
|
47
|
+
### Git LFS
|
|
48
|
+
|
|
49
|
+
The data in the testdata directory is stored with [Git LFS](https://git-lfs.com/).
|
|
50
|
+
Make sure `git-lfs` is installed and that you have run the command `git lfs install`
|
|
51
|
+
at least once. You only need to run this once per user account.
|
|
52
|
+
|
|
53
|
+
### Dependencies
|
|
54
|
+
|
|
55
|
+
[Poetry](https://python-poetry.org/) is used for dependency management. Install
|
|
56
|
+
poetry and run the command below from the root directory to install the dependencies.
|
|
57
|
+
|
|
58
|
+
```shell
|
|
59
|
+
poetry install -E test --no-root
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### Tests
|
|
63
|
+
|
|
64
|
+
Use the following command from the root directory to run the tests:
|
|
65
|
+
|
|
66
|
+
```shell
|
|
67
|
+
poetry run pytest # from root directory
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
For VS Code there are extensions for opening a python script as Jupyter Notebook,
|
|
71
|
+
for example:
|
|
72
|
+
[Jupytext for Notebooks](https://marketplace.visualstudio.com/items?itemName=donjayamanne.vscode-jupytext).
|
|
73
|
+
|
|
74
|
+
### Code quality
|
|
75
|
+
|
|
76
|
+
Run 'ruff' on all files with safe fixes:
|
|
77
|
+
|
|
78
|
+
```shell
|
|
79
|
+
poetry run ruff check --fix .
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### Formatting
|
|
83
|
+
|
|
84
|
+
Format the code with `black` and `isort` by running the following command from the
|
|
85
|
+
root directory:
|
|
86
|
+
|
|
87
|
+
```shell
|
|
88
|
+
poetry run black .
|
|
89
|
+
poetry run isort .
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
### Pre-commit hooks
|
|
93
|
+
|
|
94
|
+
We are using [pre-commit hooks](https://pre-commit.com/) to make sure the code is
|
|
95
|
+
correctly formatted and consistent before committing. Use the following command from
|
|
96
|
+
the root directory in the repo to install the pre-commit hooks:
|
|
97
|
+
|
|
98
|
+
```shell
|
|
99
|
+
poetry run pre-commit install
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
It then checks the changed files before committing. You can run the pre-commit checks
|
|
103
|
+
on all files by using this command:
|
|
104
|
+
|
|
105
|
+
```shell
|
|
106
|
+
poetry run pre-commit run --all-files
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
### Documentation
|
|
110
|
+
|
|
111
|
+
To generate the API-documentation locally, run the following command from the root
|
|
112
|
+
directory:
|
|
113
|
+
|
|
114
|
+
```shell
|
|
115
|
+
poetry run sphinx-build -W docs docs/_build
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
Then open the file `docs/_build/index.html`.
|
|
119
|
+
|
|
120
|
+
To check and run the docstrings examples, run this command:
|
|
121
|
+
|
|
122
|
+
```shell
|
|
123
|
+
poetry run xdoctest --command=all ./src/sgis
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
## Contributing
|
|
127
|
+
|
|
128
|
+
Contributions are very welcome.
|
|
129
|
+
To learn more, see the [Contributor Guide].
|
|
130
|
+
|
|
131
|
+
## License
|
|
132
|
+
|
|
133
|
+
Distributed under the terms of the [MIT license][license],
|
|
134
|
+
_SSB sgis_ is free and open source software.
|
|
135
|
+
|
|
136
|
+
## Issues
|
|
137
|
+
|
|
138
|
+
If you encounter any problems,
|
|
139
|
+
please [file an issue] along with a detailed description.
|
|
140
|
+
|
|
141
|
+
## Credits
|
|
142
|
+
|
|
143
|
+
This project was generated from [Statistics Norway]'s [SSB PyPI Template].
|
|
144
|
+
|
|
145
|
+
[statistics norway]: https://www.ssb.no/en
|
|
146
|
+
[pypi]: https://pypi.org/
|
|
147
|
+
[ssb pypi template]: https://github.com/statisticsnorway/ssb-pypitemplate
|
|
148
|
+
[file an issue]: https://github.com/statisticsnorway/ssb-sgis/issues
|
|
149
|
+
[pip]: https://pip.pypa.io/
|
|
150
|
+
|
|
151
|
+
<!-- github-only -->
|
|
152
|
+
|
|
153
|
+
[license]: https://github.com/statisticsnorway/ssb-sgis/blob/main/LICENSE
|
|
154
|
+
[contributor guide]: https://github.com/statisticsnorway/ssb-sgis/blob/main/CONTRIBUTING.md
|
|
155
|
+
[reference guide]: https://statisticsnorway.github.io/ssb-sgis/reference.html
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
[tool.poetry]
|
|
2
|
+
name = "geo-explorer"
|
|
3
|
+
version = "0.1.7"
|
|
4
|
+
description = "Explore geodata interactively."
|
|
5
|
+
authors = ["Morten Letnes <morten.letnes@ssb.no>"]
|
|
6
|
+
license = "MIT"
|
|
7
|
+
readme = "README.md"
|
|
8
|
+
homepage = "https://github.com/statisticsnorway/geo-explorer"
|
|
9
|
+
repository = "https://github.com/statisticsnorway/geo-explorer"
|
|
10
|
+
documentation = "https://statisticsnorway.github.io/geo-explorer"
|
|
11
|
+
packages = [{ include = "geo_explorer", from = "src" }]
|
|
12
|
+
classifiers = [
|
|
13
|
+
"Development Status :: 5 - Production/Stable",
|
|
14
|
+
"Topic :: Scientific/Engineering :: GIS",
|
|
15
|
+
]
|
|
16
|
+
|
|
17
|
+
[tool.poetry.urls]
|
|
18
|
+
Changelog = "https://github.com/statisticsnorway/geo-explorer/releases"
|
|
19
|
+
|
|
20
|
+
[tool.poetry.dependencies]
|
|
21
|
+
python = ">=3.11,<4"
|
|
22
|
+
geopandas = ">=0.14.0"
|
|
23
|
+
ssb-sgis = ">=1.2.10"
|
|
24
|
+
jenkspy = ">=0.3.2"
|
|
25
|
+
matplotlib = ">=3.7.0"
|
|
26
|
+
numpy = ">=1.26.4"
|
|
27
|
+
pandas = ">=2.2.1"
|
|
28
|
+
pyarrow = ">=20.0.0"
|
|
29
|
+
pyproj = ">=3.6.1"
|
|
30
|
+
rtree = ">=1.0.1"
|
|
31
|
+
shapely = ">=2.0.1"
|
|
32
|
+
typing-extensions = ">=4.11.0"
|
|
33
|
+
dash = ">=3.1.1"
|
|
34
|
+
dash-bootstrap-components = ">=2.0.3"
|
|
35
|
+
dash-leaflet = ">=1.1.3"
|
|
36
|
+
fsspec = ">=2025.5.1"
|
|
37
|
+
|
|
38
|
+
[tool.poetry.group.dev.dependencies]
|
|
39
|
+
pygments = ">=2.10.0"
|
|
40
|
+
black = { extras = ["jupyter"], version = ">=23.1.0" }
|
|
41
|
+
coverage = { extras = ["toml"], version = ">=6.2" }
|
|
42
|
+
darglint = ">=1.8.1"
|
|
43
|
+
furo = ">=2021.11.12"
|
|
44
|
+
mypy = ">=0.930"
|
|
45
|
+
pre-commit = ">=2.16.0"
|
|
46
|
+
pre-commit-hooks = ">=4.1.0"
|
|
47
|
+
ruff = ">=0.0.284"
|
|
48
|
+
owslib = ">=0.34.0"
|
|
49
|
+
pillow = ">=11.0.0"
|
|
50
|
+
pytest = ">=6.2.5"
|
|
51
|
+
sphinx = ">=6.2.1"
|
|
52
|
+
sphinx-autobuild = ">=2021.3.14"
|
|
53
|
+
sphinx-autodoc-typehints = ">=1.24.0"
|
|
54
|
+
sphinx-click = ">=3.0.2"
|
|
55
|
+
typeguard = ">=2.13.3"
|
|
56
|
+
xdoctest = { extras = ["colors"], version = ">=0.15.10" }
|
|
57
|
+
myst-parser = { version = ">=0.16.1" }
|
|
58
|
+
deptry = ">=0.8.0"
|
|
59
|
+
isort = ">=5.13.2"
|
|
60
|
+
jupyter = ">=1.0.0"
|
|
61
|
+
jupytext = ">=1.16.1"
|
|
62
|
+
pytest-cov = ">=5.0.0"
|
|
63
|
+
pandas-stubs = ">=2.2.1.240316"
|
|
64
|
+
types-requests = ">=2.31.0.20240406"
|
|
65
|
+
# bitsandbytes not released for macos for version > 0.42
|
|
66
|
+
bitsandbytes = { version = "0.42.0", markers = "sys_platform == 'darwin'" }
|
|
67
|
+
|
|
68
|
+
[tool.pytest.ini_options]
|
|
69
|
+
pythonpath = ["src"]
|
|
70
|
+
|
|
71
|
+
[tool.coverage.paths]
|
|
72
|
+
source = ["src", "*/site-packages"]
|
|
73
|
+
tests = ["tests", "*/tests"]
|
|
74
|
+
|
|
75
|
+
[tool.coverage.run]
|
|
76
|
+
branch = true
|
|
77
|
+
source = ["geo-explorer", "tests"]
|
|
78
|
+
relative_files = true
|
|
79
|
+
|
|
80
|
+
[tool.coverage.report]
|
|
81
|
+
show_missing = true
|
|
82
|
+
fail_under = 50
|
|
83
|
+
|
|
84
|
+
[tool.mypy]
|
|
85
|
+
strict = false
|
|
86
|
+
warn_unreachable = true
|
|
87
|
+
pretty = true
|
|
88
|
+
show_column_numbers = true
|
|
89
|
+
show_error_context = true
|
|
90
|
+
|
|
91
|
+
[[tool.mypy.overrides]]
|
|
92
|
+
module = [
|
|
93
|
+
"geopandas.*",
|
|
94
|
+
"jenkspy.*",
|
|
95
|
+
"pyarrow.*",
|
|
96
|
+
"shapely.*",
|
|
97
|
+
"sklearn.neighbors.*",
|
|
98
|
+
"xyzservices.*",
|
|
99
|
+
]
|
|
100
|
+
ignore_missing_imports = true
|
|
101
|
+
|
|
102
|
+
[tool.ruff]
|
|
103
|
+
force-exclude = true # Apply excludes to pre-commit
|
|
104
|
+
show-fixes = true
|
|
105
|
+
src = ["src", "tests"]
|
|
106
|
+
target-version = "py311" # Minimum Python version supported
|
|
107
|
+
include = ["*.py", "*.pyi", "**/pyproject.toml", "*.ipynb"]
|
|
108
|
+
extend-exclude = [
|
|
109
|
+
"__pycache__",
|
|
110
|
+
"old",
|
|
111
|
+
".ipynb_checkpoints",
|
|
112
|
+
"noxfile.py",
|
|
113
|
+
"docs/conf.py",
|
|
114
|
+
]
|
|
115
|
+
|
|
116
|
+
# Ruff rules may be customized as desired: https://docs.astral.sh/ruff/rules/
|
|
117
|
+
[tool.ruff.lint]
|
|
118
|
+
select = [
|
|
119
|
+
"A", # prevent using keywords that clobber python builtins
|
|
120
|
+
"ANN", # check type annotations
|
|
121
|
+
"B", # bugbear: security warnings
|
|
122
|
+
"D", # documentation
|
|
123
|
+
"E", # pycodestyle
|
|
124
|
+
"F", # pyflakes
|
|
125
|
+
"ISC", # implicit string concatenation
|
|
126
|
+
"UP", # alert you when better syntax is available in your python version
|
|
127
|
+
"RUF", # the ruff developer's own rules
|
|
128
|
+
]
|
|
129
|
+
ignore = [
|
|
130
|
+
"ANN002", # Typehint *args
|
|
131
|
+
"ANN003", # Typehint **kwargs
|
|
132
|
+
"ANN101", # Supress missing-type-self.
|
|
133
|
+
"ANN102", # Supress missing-type-cls.
|
|
134
|
+
"ANN202", # Don't requiere return type annotation for private functions.
|
|
135
|
+
"ANN401", # Allow type annotation with type Any.
|
|
136
|
+
"D100", # Supress undocumented-public-module. Only doc of public api required.
|
|
137
|
+
"E402", # Supress module-import-not-at-top-of-file, needed in jupyter notebooks.
|
|
138
|
+
"E501", # Supress line-too-long warnings: trust black's judgement on this one.
|
|
139
|
+
"D104", # Missing docstring in public package
|
|
140
|
+
"RUF018", # Avoid assignment expressions in `assert` statements
|
|
141
|
+
"RUF005", # Consider `["_cluster", *by]` instead of concatenation
|
|
142
|
+
"F841", # Local variable is assigned to but never used
|
|
143
|
+
"B019", # Use of `functools.lru_cache` or `functools.cache` on methods can lead to memory leaks
|
|
144
|
+
"UP038", # Use `X | Y` in `isinstance` call instead of `(X, Y)`
|
|
145
|
+
"B023", # Function definition does not bind loop variable
|
|
146
|
+
"ANN001", # TODO temporary. Missing type annotation for function argument ...
|
|
147
|
+
"D103", # TODO temporary. Missing docstring in public function
|
|
148
|
+
"B018", # Found useless expression
|
|
149
|
+
"E712", # Avoid equality comparisons to `True`; use `if x:` for truth checks (because 'is' doesn't work with numpy/pandas)
|
|
150
|
+
]
|
|
151
|
+
|
|
152
|
+
[tool.ruff.lint.isort]
|
|
153
|
+
force-single-line = true
|
|
154
|
+
|
|
155
|
+
[tool.ruff.lint.mccabe]
|
|
156
|
+
max-complexity = 15
|
|
157
|
+
|
|
158
|
+
[tool.ruff.lint.pydocstyle]
|
|
159
|
+
convention = "google" # You can also use "numpy".
|
|
160
|
+
|
|
161
|
+
[tool.ruff.lint.pep8-naming]
|
|
162
|
+
classmethod-decorators = ["classmethod", "validator", "root_validator", "pydantic.validator"]
|
|
163
|
+
|
|
164
|
+
[tool.ruff.lint.per-file-ignores]
|
|
165
|
+
"*/__init__.py" = ["F401"]
|
|
166
|
+
"**/tests/*" = [
|
|
167
|
+
"ANN001", # type annotations don't add value for test functions
|
|
168
|
+
"ANN002", # type annotations don't add value for test functions
|
|
169
|
+
"ANN003", # type annotations don't add value for test functions
|
|
170
|
+
"ANN201", # type annotations don't add value for test functions
|
|
171
|
+
"ANN204", # type annotations don't add value for test functions
|
|
172
|
+
"ANN205", # type annotations don't add value for test functions
|
|
173
|
+
"ANN206", # type annotations don't add value for test functions
|
|
174
|
+
"D100", # docstrings are overkill for test functions
|
|
175
|
+
"D101",
|
|
176
|
+
"D102",
|
|
177
|
+
"D103",
|
|
178
|
+
"S101", # asserts are encouraged in pytest
|
|
179
|
+
]
|
|
180
|
+
|
|
181
|
+
[tool.jupytext]
|
|
182
|
+
formats = "ipynb,auto:percent"
|
|
183
|
+
notebook_metadata_filter = "jupytext.text_representation,-jupytext.text_representation.jupytext_version,-widgets,-varInspector,-kernelspec"
|
|
184
|
+
cell_metadata_filter = "-all"
|
|
185
|
+
|
|
186
|
+
[tool.isort]
|
|
187
|
+
profile = "black"
|
|
188
|
+
force_single_line = true
|
|
189
|
+
skip_gitignore = true
|
|
190
|
+
# The line below is needed for jupyter notebooks stored as .py in percent format.
|
|
191
|
+
# See https://github.com/PyCQA/isort/issues/1338 for details
|
|
192
|
+
treat_comments_as_code = ["# %%"]
|
|
193
|
+
|
|
194
|
+
[tool.deptry.per_rule_ignores]
|
|
195
|
+
DEP001 = ["geo-explorer", "nox", "nox_poetry"] # packages available by default
|
|
196
|
+
|
|
197
|
+
[build-system]
|
|
198
|
+
requires = ["poetry-core"]
|
|
199
|
+
build-backend = "poetry.core.masonry.api"
|