ObjectNat 1.2.2__tar.gz → 1.3.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 (37) hide show
  1. objectnat-1.3.1/PKG-INFO +202 -0
  2. objectnat-1.3.1/README.rst +179 -0
  3. {objectnat-1.2.2 → objectnat-1.3.1}/pyproject.toml +23 -15
  4. {objectnat-1.2.2 → objectnat-1.3.1}/src/objectnat/_config.py +43 -47
  5. objectnat-1.3.1/src/objectnat/_version.py +1 -0
  6. {objectnat-1.2.2 → objectnat-1.3.1}/src/objectnat/methods/coverage_zones/graph_coverage.py +11 -4
  7. {objectnat-1.2.2 → objectnat-1.3.1}/src/objectnat/methods/coverage_zones/radius_voronoi_coverage.py +4 -2
  8. {objectnat-1.2.2 → objectnat-1.3.1}/src/objectnat/methods/coverage_zones/stepped_coverage.py +20 -10
  9. {objectnat-1.2.2 → objectnat-1.3.1}/src/objectnat/methods/isochrones/isochrones.py +31 -11
  10. {objectnat-1.2.2 → objectnat-1.3.1}/src/objectnat/methods/noise/noise_simulation.py +15 -14
  11. {objectnat-1.2.2 → objectnat-1.3.1}/src/objectnat/methods/noise/noise_simulation_simplified.py +10 -9
  12. {objectnat-1.2.2 → objectnat-1.3.1}/src/objectnat/methods/point_clustering/cluster_points_in_polygons.py +3 -3
  13. objectnat-1.3.1/src/objectnat/methods/provision/provision.py +213 -0
  14. {objectnat-1.2.2 → objectnat-1.3.1}/src/objectnat/methods/provision/provision_model.py +323 -348
  15. {objectnat-1.2.2 → objectnat-1.3.1}/src/objectnat/methods/utils/graph_utils.py +5 -5
  16. {objectnat-1.2.2 → objectnat-1.3.1}/src/objectnat/methods/utils/math_utils.py +32 -32
  17. {objectnat-1.2.2 → objectnat-1.3.1}/src/objectnat/methods/visibility/visibility_analysis.py +9 -17
  18. objectnat-1.2.2/PKG-INFO +0 -116
  19. objectnat-1.2.2/README.md +0 -92
  20. objectnat-1.2.2/src/objectnat/_version.py +0 -1
  21. objectnat-1.2.2/src/objectnat/methods/provision/provision.py +0 -121
  22. {objectnat-1.2.2 → objectnat-1.3.1}/LICENSE.txt +0 -0
  23. {objectnat-1.2.2 → objectnat-1.3.1}/src/objectnat/__init__.py +0 -0
  24. {objectnat-1.2.2 → objectnat-1.3.1}/src/objectnat/_api.py +0 -0
  25. {objectnat-1.2.2 → objectnat-1.3.1}/src/objectnat/methods/__init__.py +0 -0
  26. {objectnat-1.2.2 → objectnat-1.3.1}/src/objectnat/methods/coverage_zones/__init__.py +0 -0
  27. {objectnat-1.2.2 → objectnat-1.3.1}/src/objectnat/methods/isochrones/__init__.py +0 -0
  28. {objectnat-1.2.2 → objectnat-1.3.1}/src/objectnat/methods/isochrones/isochrone_utils.py +0 -0
  29. {objectnat-1.2.2 → objectnat-1.3.1}/src/objectnat/methods/noise/__init__.py +0 -0
  30. {objectnat-1.2.2 → objectnat-1.3.1}/src/objectnat/methods/noise/noise_init_data.py +0 -0
  31. {objectnat-1.2.2 → objectnat-1.3.1}/src/objectnat/methods/noise/noise_reduce.py +0 -0
  32. {objectnat-1.2.2 → objectnat-1.3.1}/src/objectnat/methods/point_clustering/__init__.py +0 -0
  33. {objectnat-1.2.2 → objectnat-1.3.1}/src/objectnat/methods/provision/__init__.py +0 -0
  34. {objectnat-1.2.2 → objectnat-1.3.1}/src/objectnat/methods/provision/provision_exceptions.py +0 -0
  35. {objectnat-1.2.2 → objectnat-1.3.1}/src/objectnat/methods/utils/__init__.py +0 -0
  36. {objectnat-1.2.2 → objectnat-1.3.1}/src/objectnat/methods/utils/geom_utils.py +0 -0
  37. {objectnat-1.2.2 → objectnat-1.3.1}/src/objectnat/methods/visibility/__init__.py +0 -0
@@ -0,0 +1,202 @@
1
+ Metadata-Version: 2.4
2
+ Name: ObjectNat
3
+ Version: 1.3.1
4
+ Summary: ObjectNat is an open-source library created for geospatial analysis created by IDU team
5
+ License: BSD-3-Clause
6
+ License-File: LICENSE.txt
7
+ Author: DDonnyy
8
+ Author-email: 63115678+DDonnyy@users.noreply.github.com
9
+ Requires-Python: >=3.11,<3.13
10
+ Classifier: License :: OSI Approved :: BSD License
11
+ Classifier: Programming Language :: Python :: 3
12
+ Classifier: Programming Language :: Python :: 3.11
13
+ Classifier: Programming Language :: Python :: 3.12
14
+ Requires-Dist: geopandas (>=1.0.1,<2.0.0)
15
+ Requires-Dist: loguru (>=0.7.3,<0.8.0)
16
+ Requires-Dist: networkx (>=3.4.2,<4.0.0)
17
+ Requires-Dist: numpy (>=2.1.3,<3.0.0)
18
+ Requires-Dist: pandas (>=2.2.0,<3.0.0)
19
+ Requires-Dist: scikit-learn (>=1.4.0,<2.0.0)
20
+ Requires-Dist: tqdm (>=4.66.2,<5.0.0)
21
+ Description-Content-Type: text/x-rst
22
+
23
+ ObjectNat
24
+ =========
25
+
26
+ Object-oriented Network Analysis Tools
27
+ --------------------------------------
28
+
29
+ .. |badge-black| image:: https://img.shields.io/badge/code%20style-black-000000.svg
30
+ :target: https://github.com/psf/black
31
+ :alt: Code style: black
32
+
33
+ .. |badge-pypi| image:: https://img.shields.io/pypi/v/objectnat.svg
34
+ :target: https://pypi.org/project/objectnat/
35
+ :alt: PyPI version
36
+
37
+ .. |badge-ci| image:: https://github.com/IDUclub/ObjectNat/actions/workflows/ci_pipeline.yml/badge.svg
38
+ :target: https://github.com/IDUclub/ObjectNat/actions/workflows/ci_pipeline.yml
39
+ :alt: CI
40
+
41
+ .. |badge-codecov| image:: https://codecov.io/gh/DDonnyy/ObjectNat/graph/badge.svg?token=K6JFSJ02GU
42
+ :target: https://codecov.io/gh/DDonnyy/ObjectNat
43
+ :alt: Coverage
44
+
45
+ .. |badge-license| image:: https://img.shields.io/badge/license-BSD--3--Clause-blue.svg
46
+ :target: https://opensource.org/licenses/BSD-3-Clause
47
+ :alt: License
48
+
49
+ .. |badge-docs| image:: https://img.shields.io/badge/docs-latest-4aa0d5?logo=readthedocs
50
+ :target: https://iduclub.github.io/ObjectNat/
51
+ :alt: Docs
52
+
53
+ |badge-black| |badge-pypi| |badge-ci| |badge-codecov| |badge-license| |badge-docs|
54
+
55
+ `РИДМИ (Russian) <https://github.com/IDUclub/ObjectNat/blob/master/README_RU.rst>`__
56
+
57
+ .. image:: https://raw.githubusercontent.com/IDUclub/ObjectNat/master/docs/_static/ONlogo.svg
58
+ :align: center
59
+ :width: 400
60
+ :alt: ObjectNat logo
61
+
62
+
63
+ **ObjectNat** is an open-source library developed by the **IDU** team
64
+ for spatial and network analysis in urban studies.
65
+ The library provides tools for analyzing **accessibility**, **visibility**,
66
+ **noise propagation**, and **service provision**.
67
+ ----
68
+
69
+ Key Features
70
+ ------------
71
+
72
+ Each feature includes a **Jupyter Notebook example** and **full documentation**.
73
+
74
+ 1. **Isochrones and Transport Accessibility**
75
+
76
+ Isochrones represent areas reachable from an origin point within a specified time along a transport network.
77
+ This feature allows the analysis of transport accessibility using pedestrian, road,
78
+ public transport, or multimodal graphs.
79
+
80
+ The library supports several methods for building isochrones:
81
+
82
+ - **Basic isochrones**: display a single zone reachable within a specified time.
83
+ - **Step isochrones**: divide the accessibility area into time intervals (e.g., 3, 5, 10 minutes).
84
+
85
+
86
+ 📘 `Example <https://iduclub.github.io/ObjectNat/methods/examples/isochrones.html>`__
87
+ 🔗 `Documentation <https://iduclub.github.io/ObjectNat/methods/isochrones.html>`__
88
+
89
+ 2. **Graph Coverage Zones from Points**
90
+
91
+ A function for generating **coverage areas** from a set of origin points using a transport network.
92
+ It computes the area reachable from each point by **travel time** or **distance**,
93
+ then builds polygons using **Voronoi diagrams** and clips them by a given boundary if specified.
94
+
95
+ 📘 `Example <https://iduclub.github.io/ObjectNat/methods/examples/coverage.html>`__
96
+ 🔗 `Documentation <https://iduclub.github.io/ObjectNat/methods/coverage.html>`__
97
+
98
+ 3. **Service Provision Analysis**
99
+
100
+ A function to evaluate how well residential buildings and their populations are provided
101
+ with services (e.g., schools, clinics) that have limited **capacity**
102
+ and a defined **accessibility threshold** (in minutes or meters).
103
+ The function models the **balance between supply and demand**,
104
+ assessing how well services meet the needs of nearby buildings within an acceptable time.
105
+
106
+ 📘 `Example <https://iduclub.github.io/ObjectNat/methods/examples/provision.html>`__
107
+ 🔗 `Documentation <https://iduclub.github.io/ObjectNat/methods/provision.html>`__
108
+
109
+ 4. **Visibility Analysis**
110
+
111
+ A function for evaluating visibility from a given point or set of points to nearby buildings within a given radius.
112
+ It is used to assess visual accessibility in urban environments.
113
+ A module is also implemented for computing **visibility coverage zones**
114
+ using a dense observer grid (recommended ~1000 points with a 10–20 m spacing).
115
+ Points can be generated along the transport network and distributed across its edges.
116
+
117
+ 📘 `Example <https://iduclub.github.io/ObjectNat/methods/examples/visibility.html>`__
118
+ 🔗 `Documentation <https://iduclub.github.io/ObjectNat/methods/visibility.html>`__
119
+
120
+ 5. **Noise Simulation & Noise Frame**
121
+
122
+ Simulation of noise propagation from sources, taking into account **obstacles**, **vegetation**,
123
+ and **environmental factors**.
124
+
125
+ 📘 `Example <https://iduclub.github.io/ObjectNat/methods/examples/noise.html>`__
126
+ 🔗 `Documentation <https://iduclub.github.io/ObjectNat/methods/noise.html>`__
127
+ 🧠 `Detailed theory <https://github.com/DDonnyy/ObjectNat/wiki/Noise-simulation>`__
128
+
129
+ 6. **Point Clusterization**
130
+
131
+ A function for constructing **cluster polygons** based on a set of points using:
132
+
133
+ - Minimum **distance** between points.
134
+ - Minimum **number of points** in a cluster.
135
+
136
+ The function can also compute the **ratio of service types** in each cluster
137
+ for spatial analysis of service composition.
138
+
139
+ 📘 `Example <https://iduclub.github.io/ObjectNat/methods/examples/clustering.html>`__
140
+ 🔗 `Documentation <https://iduclub.github.io/ObjectNat/methods/clustering.html>`__
141
+
142
+ ----
143
+
144
+ City Graphs via *IduEdu*
145
+ ------------------------
146
+
147
+ For optimal performance, **ObjectNat** is recommended to be used with graphs
148
+ created by the `IduEdu <https://github.com/IDUclub/IduEdu>`_ library.
149
+
150
+ **IduEdu** is an open-source Python library designed for building and processing
151
+ complex urban networks based on OpenStreetMap data.
152
+
153
+
154
+ **IduEdu** can be installed via ``pip``::
155
+
156
+ pip install IduEdu
157
+
158
+ Example usage::
159
+
160
+ from iduedu import get_4326_boundary, get_intermodal_graph
161
+
162
+ poly = get_4326_boundary(osm_id=1114252)
163
+ G_intermodal = get_intermodal_graph(territory=poly, clip_by_territory=True)
164
+
165
+ ----
166
+
167
+ Installation
168
+ ------------
169
+
170
+ **ObjectNat** can be installed via ``pip``::
171
+
172
+ pip install ObjectNat
173
+
174
+ ----
175
+
176
+ Configuration
177
+ -------------
178
+
179
+ You can adjust logging and progress bar output using the config module::
180
+
181
+ from objectnat import config
182
+
183
+ config.change_logger_lvl("INFO") # mute debug logs
184
+ config.set_enable_tqdm(False) # disable tqdm progress bars
185
+
186
+ ----
187
+
188
+ Contacts
189
+ --------
190
+
191
+ - `NCCR <https://actcognitive.org/>`_ — National Center for Cognitive Research
192
+ - `IDU <https://idu.itmo.ru/>`_ — Institute of Design and Urban Studies
193
+ - `Natalya Chichkova <https://t.me/nancy_nat>`_ — Project Manager
194
+ - `Danila Oleynikov (Donny) <https://t.me/ddonny_dd>`_ — Lead Software Engineer
195
+
196
+ ----
197
+
198
+ Publications
199
+ ------------
200
+
201
+ Coming soon.
202
+
@@ -0,0 +1,179 @@
1
+ ObjectNat
2
+ =========
3
+
4
+ Object-oriented Network Analysis Tools
5
+ --------------------------------------
6
+
7
+ .. |badge-black| image:: https://img.shields.io/badge/code%20style-black-000000.svg
8
+ :target: https://github.com/psf/black
9
+ :alt: Code style: black
10
+
11
+ .. |badge-pypi| image:: https://img.shields.io/pypi/v/objectnat.svg
12
+ :target: https://pypi.org/project/objectnat/
13
+ :alt: PyPI version
14
+
15
+ .. |badge-ci| image:: https://github.com/IDUclub/ObjectNat/actions/workflows/ci_pipeline.yml/badge.svg
16
+ :target: https://github.com/IDUclub/ObjectNat/actions/workflows/ci_pipeline.yml
17
+ :alt: CI
18
+
19
+ .. |badge-codecov| image:: https://codecov.io/gh/DDonnyy/ObjectNat/graph/badge.svg?token=K6JFSJ02GU
20
+ :target: https://codecov.io/gh/DDonnyy/ObjectNat
21
+ :alt: Coverage
22
+
23
+ .. |badge-license| image:: https://img.shields.io/badge/license-BSD--3--Clause-blue.svg
24
+ :target: https://opensource.org/licenses/BSD-3-Clause
25
+ :alt: License
26
+
27
+ .. |badge-docs| image:: https://img.shields.io/badge/docs-latest-4aa0d5?logo=readthedocs
28
+ :target: https://iduclub.github.io/ObjectNat/
29
+ :alt: Docs
30
+
31
+ |badge-black| |badge-pypi| |badge-ci| |badge-codecov| |badge-license| |badge-docs|
32
+
33
+ `РИДМИ (Russian) <https://github.com/IDUclub/ObjectNat/blob/master/README_RU.rst>`__
34
+
35
+ .. image:: https://raw.githubusercontent.com/IDUclub/ObjectNat/master/docs/_static/ONlogo.svg
36
+ :align: center
37
+ :width: 400
38
+ :alt: ObjectNat logo
39
+
40
+
41
+ **ObjectNat** is an open-source library developed by the **IDU** team
42
+ for spatial and network analysis in urban studies.
43
+ The library provides tools for analyzing **accessibility**, **visibility**,
44
+ **noise propagation**, and **service provision**.
45
+ ----
46
+
47
+ Key Features
48
+ ------------
49
+
50
+ Each feature includes a **Jupyter Notebook example** and **full documentation**.
51
+
52
+ 1. **Isochrones and Transport Accessibility**
53
+
54
+ Isochrones represent areas reachable from an origin point within a specified time along a transport network.
55
+ This feature allows the analysis of transport accessibility using pedestrian, road,
56
+ public transport, or multimodal graphs.
57
+
58
+ The library supports several methods for building isochrones:
59
+
60
+ - **Basic isochrones**: display a single zone reachable within a specified time.
61
+ - **Step isochrones**: divide the accessibility area into time intervals (e.g., 3, 5, 10 minutes).
62
+
63
+
64
+ 📘 `Example <https://iduclub.github.io/ObjectNat/methods/examples/isochrones.html>`__
65
+ 🔗 `Documentation <https://iduclub.github.io/ObjectNat/methods/isochrones.html>`__
66
+
67
+ 2. **Graph Coverage Zones from Points**
68
+
69
+ A function for generating **coverage areas** from a set of origin points using a transport network.
70
+ It computes the area reachable from each point by **travel time** or **distance**,
71
+ then builds polygons using **Voronoi diagrams** and clips them by a given boundary if specified.
72
+
73
+ 📘 `Example <https://iduclub.github.io/ObjectNat/methods/examples/coverage.html>`__
74
+ 🔗 `Documentation <https://iduclub.github.io/ObjectNat/methods/coverage.html>`__
75
+
76
+ 3. **Service Provision Analysis**
77
+
78
+ A function to evaluate how well residential buildings and their populations are provided
79
+ with services (e.g., schools, clinics) that have limited **capacity**
80
+ and a defined **accessibility threshold** (in minutes or meters).
81
+ The function models the **balance between supply and demand**,
82
+ assessing how well services meet the needs of nearby buildings within an acceptable time.
83
+
84
+ 📘 `Example <https://iduclub.github.io/ObjectNat/methods/examples/provision.html>`__
85
+ 🔗 `Documentation <https://iduclub.github.io/ObjectNat/methods/provision.html>`__
86
+
87
+ 4. **Visibility Analysis**
88
+
89
+ A function for evaluating visibility from a given point or set of points to nearby buildings within a given radius.
90
+ It is used to assess visual accessibility in urban environments.
91
+ A module is also implemented for computing **visibility coverage zones**
92
+ using a dense observer grid (recommended ~1000 points with a 10–20 m spacing).
93
+ Points can be generated along the transport network and distributed across its edges.
94
+
95
+ 📘 `Example <https://iduclub.github.io/ObjectNat/methods/examples/visibility.html>`__
96
+ 🔗 `Documentation <https://iduclub.github.io/ObjectNat/methods/visibility.html>`__
97
+
98
+ 5. **Noise Simulation & Noise Frame**
99
+
100
+ Simulation of noise propagation from sources, taking into account **obstacles**, **vegetation**,
101
+ and **environmental factors**.
102
+
103
+ 📘 `Example <https://iduclub.github.io/ObjectNat/methods/examples/noise.html>`__
104
+ 🔗 `Documentation <https://iduclub.github.io/ObjectNat/methods/noise.html>`__
105
+ 🧠 `Detailed theory <https://github.com/DDonnyy/ObjectNat/wiki/Noise-simulation>`__
106
+
107
+ 6. **Point Clusterization**
108
+
109
+ A function for constructing **cluster polygons** based on a set of points using:
110
+
111
+ - Minimum **distance** between points.
112
+ - Minimum **number of points** in a cluster.
113
+
114
+ The function can also compute the **ratio of service types** in each cluster
115
+ for spatial analysis of service composition.
116
+
117
+ 📘 `Example <https://iduclub.github.io/ObjectNat/methods/examples/clustering.html>`__
118
+ 🔗 `Documentation <https://iduclub.github.io/ObjectNat/methods/clustering.html>`__
119
+
120
+ ----
121
+
122
+ City Graphs via *IduEdu*
123
+ ------------------------
124
+
125
+ For optimal performance, **ObjectNat** is recommended to be used with graphs
126
+ created by the `IduEdu <https://github.com/IDUclub/IduEdu>`_ library.
127
+
128
+ **IduEdu** is an open-source Python library designed for building and processing
129
+ complex urban networks based on OpenStreetMap data.
130
+
131
+
132
+ **IduEdu** can be installed via ``pip``::
133
+
134
+ pip install IduEdu
135
+
136
+ Example usage::
137
+
138
+ from iduedu import get_4326_boundary, get_intermodal_graph
139
+
140
+ poly = get_4326_boundary(osm_id=1114252)
141
+ G_intermodal = get_intermodal_graph(territory=poly, clip_by_territory=True)
142
+
143
+ ----
144
+
145
+ Installation
146
+ ------------
147
+
148
+ **ObjectNat** can be installed via ``pip``::
149
+
150
+ pip install ObjectNat
151
+
152
+ ----
153
+
154
+ Configuration
155
+ -------------
156
+
157
+ You can adjust logging and progress bar output using the config module::
158
+
159
+ from objectnat import config
160
+
161
+ config.change_logger_lvl("INFO") # mute debug logs
162
+ config.set_enable_tqdm(False) # disable tqdm progress bars
163
+
164
+ ----
165
+
166
+ Contacts
167
+ --------
168
+
169
+ - `NCCR <https://actcognitive.org/>`_ — National Center for Cognitive Research
170
+ - `IDU <https://idu.itmo.ru/>`_ — Institute of Design and Urban Studies
171
+ - `Natalya Chichkova <https://t.me/nancy_nat>`_ — Project Manager
172
+ - `Danila Oleynikov (Donny) <https://t.me/ddonny_dd>`_ — Lead Software Engineer
173
+
174
+ ----
175
+
176
+ Publications
177
+ ------------
178
+
179
+ Coming soon.
@@ -1,41 +1,49 @@
1
1
  [tool.poetry]
2
2
  name = "ObjectNat"
3
- version = "1.2.2"
3
+ version = "1.3.1"
4
4
  description = "ObjectNat is an open-source library created for geospatial analysis created by IDU team"
5
5
  license = "BSD-3-Clause"
6
6
  authors = ["DDonnyy <63115678+DDonnyy@users.noreply.github.com>"]
7
- readme = "README.md"
7
+ readme = "README.rst"
8
8
 
9
9
  packages = [{ include = "objectnat", from = "src" }]
10
10
 
11
11
  [tool.poetry.dependencies]
12
- python = ">=3.10,<3.13"
12
+ python = ">=3.11,<3.13"
13
13
  numpy = "^2.1.3"
14
14
  pandas = "^2.2.0"
15
15
  geopandas = "^1.0.1"
16
16
  tqdm = "^4.66.2"
17
- pandarallel = "^1.6.5"
18
17
  networkx = "^3.4.2"
19
18
  scikit-learn = "^1.4.0"
20
19
  loguru = "^0.7.3"
21
20
 
21
+
22
+ [tool.poetry.group.test.dependencies]
23
+ pytest = "^8.3.5"
24
+ pytest-cov = "^6.0.0"
25
+ folium = "^0.19.5"
26
+ matplotlib = "^3.10.1"
27
+ mapclassify = "^2.8.1"
28
+ iduedu = "^1.0.0"
29
+
22
30
  [tool.poetry.group.dev.dependencies]
23
- iduedu = "^0.5.0"
24
31
  pyarrow = "^19.0.1"
25
32
  black = "^24.2.0"
26
33
  pylint = "^3.0.3"
27
34
  isort = "^5.13.2"
28
35
  jupyter = "^1.0.0"
29
- pytest = "^8.3.5"
30
- pytest-cov = "^6.0.0"
31
36
  pre-commit = "^4.2.0"
32
- folium = "^0.19.5"
33
- matplotlib = "^3.10.1"
34
- mapclassify = "^2.8.1"
35
- mkdocs = "^1.6.1"
36
- mkdocstrings = {extras = ["python"], version = "^0.29.1"}
37
- mkdocs-material = "^9.6.14"
38
- mike = "^2.1.3"
37
+
38
+ [tool.poetry.group.docs.dependencies]
39
+ sphinx = "^8.0.0"
40
+ furo = "^2025.9.25"
41
+ myst-nb = "^1.1.0"
42
+ sphinx-autodoc-typehints = "^3.2.0"
43
+ sphinx-copybutton = "^0.5.2"
44
+ sphinx-design = "^0.6.0"
45
+ myst-parser = "^4.0.1"
46
+ linkify-it-py = "^2.0.3"
39
47
 
40
48
  [build-system]
41
49
  requires = ["poetry-core"]
@@ -43,7 +51,7 @@ build-backend = "poetry.core.masonry.api"
43
51
 
44
52
  [tool.black]
45
53
  line-length = 120
46
- target-version = ['py310']
54
+ target-version = ['py311']
47
55
 
48
56
  [tool.pylint.format]
49
57
  max-line-length = 120
@@ -1,47 +1,43 @@
1
- import sys
2
- from typing import Literal
3
-
4
- from loguru import logger
5
-
6
-
7
- class Config:
8
- """
9
- A configuration class to manage global settings for the application, such as Overpass API URL,
10
- timeouts, and logging options.
11
-
12
- Attributes
13
- ----------
14
- enable_tqdm_bar : bool
15
- Enables or disables progress bars (via tqdm). Defaults to True.
16
- logger : Logger
17
- Logging instance to handle application logging.
18
-
19
- Methods
20
- -------
21
- change_logger_lvl(lvl: Literal["TRACE", "DEBUG", "INFO", "WARN", "ERROR"])
22
- Changes the logging level to the specified value.
23
- set_enable_tqdm(enable: bool)
24
- Enables or disables progress bars in the application.
25
- """
26
-
27
- def __init__(
28
- self,
29
- enable_tqdm_bar=True,
30
- ):
31
- self.enable_tqdm_bar = enable_tqdm_bar
32
- self.logger = logger
33
- self.pandarallel_use_file_system = False
34
-
35
- def change_logger_lvl(self, lvl: Literal["TRACE", "DEBUG", "INFO", "WARN", "ERROR"]):
36
- self.logger.remove()
37
- self.logger.add(sys.stderr, level=lvl)
38
-
39
- def set_enable_tqdm(self, enable: bool):
40
- self.enable_tqdm_bar = enable
41
-
42
- def set_pandarallel_use_file_system(self, enable: bool):
43
- self.pandarallel_use_file_system = enable
44
-
45
-
46
- config = Config()
47
- config.change_logger_lvl("INFO")
1
+ import sys
2
+ from typing import Literal
3
+
4
+ from loguru import logger
5
+
6
+
7
+ class Config:
8
+ """
9
+ A configuration class to manage global settings for the application, such as Overpass API URL,
10
+ timeouts, and logging options.
11
+
12
+ Attributes
13
+ ----------
14
+ enable_tqdm_bar : bool
15
+ Enables or disables progress bars (via tqdm). Defaults to True.
16
+ logger : Logger
17
+ Logging instance to handle application logging.
18
+
19
+ Methods
20
+ -------
21
+ change_logger_lvl(lvl: Literal["TRACE", "DEBUG", "INFO", "WARN", "ERROR"])
22
+ Changes the logging level to the specified value.
23
+ set_enable_tqdm(enable: bool)
24
+ Enables or disables progress bars in the application.
25
+ """
26
+
27
+ def __init__(
28
+ self,
29
+ enable_tqdm_bar=True,
30
+ ):
31
+ self.enable_tqdm_bar = enable_tqdm_bar
32
+ self.logger = logger
33
+
34
+ def change_logger_lvl(self, lvl: Literal["TRACE", "DEBUG", "INFO", "WARN", "ERROR"]):
35
+ self.logger.remove()
36
+ self.logger.add(sys.stderr, level=lvl)
37
+
38
+ def set_enable_tqdm(self, enable: bool):
39
+ self.enable_tqdm_bar = enable
40
+
41
+
42
+ config = Config()
43
+ config.change_logger_lvl("INFO")
@@ -0,0 +1 @@
1
+ VERSION = "1.3.1"
@@ -27,20 +27,27 @@ def get_graph_coverage(
27
27
  4. Combining reachability information with Voronoi cells
28
28
  5. Clipping results to specified zone boundary
29
29
 
30
- Parameters:
30
+ Args:
31
31
  gdf_to (gpd.GeoDataFrame):
32
32
  Source points to which coverage is calculated.
33
+
33
34
  nx_graph (nx.Graph):
34
35
  NetworkX graph representing the transportation network.
35
- weight_type (Literal["time_min", "length_meter"]):
36
- Edge attribute to use as weight for path calculations.
36
+
37
+ weight_type:
38
+ Type of edge weight to use for path calculation:
39
+
40
+ - ``"time_min"``: Edge travel time in minutes
41
+ - ``"length_meter"``: Edge length in meters
42
+
37
43
  weight_value_cutoff (float):
38
44
  Maximum weight value for path calculations (e.g., max travel time/distance).
45
+
39
46
  zone (gpd.GeoDataFrame):
40
47
  Boundary polygon to clip the resulting coverage zones. If None, concave hull of reachable nodes will be used.
41
48
 
42
49
  Returns:
43
- (gpd.GeoDataFrame):
50
+ gpd.GeoDataFrame:
44
51
  GeoDataFrame with coverage zones polygons, each associated with its source point, returns in the same CRS
45
52
  as original gdf_from.
46
53
 
@@ -6,16 +6,18 @@ def get_radius_coverage(gdf_from: gpd.GeoDataFrame, radius: float, resolution: i
6
6
  """
7
7
  Calculate radius-based coverage zones using Voronoi polygons.
8
8
 
9
- Parameters:
9
+ Args:
10
10
  gdf_from (gpd.GeoDataFrame):
11
11
  Source points for which coverage zones are calculated.
12
+
12
13
  radius (float):
13
14
  Maximum coverage radius in meters.
15
+
14
16
  resolution (int):
15
17
  Number of segments used to approximate quarter-circle in buffer (default=32).
16
18
 
17
19
  Returns:
18
- (gpd.GeoDataFrame):
20
+ gpd.GeoDataFrame:
19
21
  GeoDataFrame with smoothed coverage zone polygons in the same CRS as original gdf_from.
20
22
 
21
23
  Notes:
@@ -31,30 +31,40 @@ def get_stepped_graph_coverage(
31
31
  4. Aggregates zones into stepped coverage layers
32
32
  5. Optionally clips results to a boundary zone
33
33
 
34
- Parameters:
34
+ Args:
35
35
  gdf_to (gpd.GeoDataFrame):
36
36
  Source points from which stepped coverage is calculated.
37
+
37
38
  nx_graph (nx.Graph):
38
39
  NetworkX graph representing the transportation network.
39
- weight_type (Literal["time_min", "length_meter"]):
40
+
41
+ weight_type:
40
42
  Type of edge weight to use for path calculation:
41
- - "time_min": Edge travel time in minutes
42
- - "length_meter": Edge length in meters
43
- step_type (Literal["voronoi", "separate"]):
43
+
44
+ - ``"time_min"``: Edge travel time in minutes
45
+ - ``"length_meter"``: Edge length in meters
46
+
47
+ step_type:
44
48
  Method for generating stepped zones:
45
- - "voronoi": Stepped zones based on Voronoi polygons around graph nodes
46
- - "separate": Independent buffer zones per step
49
+
50
+ - ``"voronoi"``: Stepped zones based on Voronoi polygons around graph nodes
51
+ - ``"separate"``: Independent buffer zones per step
52
+
47
53
  weight_value_cutoff (float, optional):
48
54
  Maximum weight value (e.g., max travel time or distance) to limit the coverage extent.
55
+
49
56
  zone (gpd.GeoDataFrame, optional):
50
57
  Optional boundary polygon to clip resulting stepped zones. If None, concave hull of reachable area is used.
58
+
51
59
  step (float, optional):
52
60
  Step interval for coverage zone construction. Defaults to:
53
- - 100 meters for distance-based weight
54
- - 1 minute for time-based weight
61
+
62
+ - 100 meters for distance-based weight
63
+ - 1 minute for time-based weight
55
64
 
56
65
  Returns:
57
- (gpd.GeoDataFrame): GeoDataFrame with polygons representing stepped coverage zones for each input point,
66
+ gpd.GeoDataFrame:
67
+ GeoDataFrame with polygons representing stepped coverage zones for each input point,
58
68
  annotated by step range.
59
69
 
60
70
  Notes: