verus 1.0.0__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 (88) hide show
  1. verus-1.0.0/.github/workflows/static.yml +118 -0
  2. verus-1.0.0/.gitignore +180 -0
  3. verus-1.0.0/.readthedocs.yml +16 -0
  4. verus-1.0.0/CHANGELOG.md +36 -0
  5. verus-1.0.0/LICENSE +21 -0
  6. verus-1.0.0/PKG-INFO +166 -0
  7. verus-1.0.0/README.md +108 -0
  8. verus-1.0.0/changelog_instructions.md +45 -0
  9. verus-1.0.0/docs/BUILDINSTRUCTIONS.md +174 -0
  10. verus-1.0.0/docs/Makefile +20 -0
  11. verus-1.0.0/docs/build_docs.sh +46 -0
  12. verus-1.0.0/docs/generate_api_docs.py +154 -0
  13. verus-1.0.0/docs/make.bat +35 -0
  14. verus-1.0.0/docs/source/api/index.rst +9 -0
  15. verus-1.0.0/docs/source/api/modules.rst +7 -0
  16. verus-1.0.0/docs/source/api/verus.analyzer.rst +8 -0
  17. verus-1.0.0/docs/source/api/verus.cache.rst +8 -0
  18. verus-1.0.0/docs/source/api/verus.clustering.kmeans.rst +8 -0
  19. verus-1.0.0/docs/source/api/verus.clustering.optics.rst +8 -0
  20. verus-1.0.0/docs/source/api/verus.clustering.rst +15 -0
  21. verus-1.0.0/docs/source/api/verus.data.extraction.rst +8 -0
  22. verus-1.0.0/docs/source/api/verus.data.rst +15 -0
  23. verus-1.0.0/docs/source/api/verus.data.timewindow.rst +8 -0
  24. verus-1.0.0/docs/source/api/verus.grid.hexagon.rst +8 -0
  25. verus-1.0.0/docs/source/api/verus.grid.rst +14 -0
  26. verus-1.0.0/docs/source/api/verus.rst +27 -0
  27. verus-1.0.0/docs/source/api/verus.utils.config.rst +8 -0
  28. verus-1.0.0/docs/source/api/verus.utils.logger.rst +8 -0
  29. verus-1.0.0/docs/source/api/verus.utils.rst +15 -0
  30. verus-1.0.0/docs/source/api/verus.utils.timer.rst +8 -0
  31. verus-1.0.0/docs/source/api/verus.verus.rst +8 -0
  32. verus-1.0.0/docs/source/concepts/index.rst +12 -0
  33. verus-1.0.0/docs/source/concepts/potis.rst +54 -0
  34. verus-1.0.0/docs/source/concepts/time_windows.rst +93 -0
  35. verus-1.0.0/docs/source/concepts/vulnerability_computation.rst +91 -0
  36. verus-1.0.0/docs/source/concepts/vulnerability_zones.rst +65 -0
  37. verus-1.0.0/docs/source/conf.py +69 -0
  38. verus-1.0.0/docs/source/development.rst +47 -0
  39. verus-1.0.0/docs/source/examples/clustering_example.rst +48 -0
  40. verus-1.0.0/docs/source/examples/extract_poi_example.rst +34 -0
  41. verus-1.0.0/docs/source/examples/index.rst +16 -0
  42. verus-1.0.0/docs/source/examples/vulnerability_index_example.rst +28 -0
  43. verus-1.0.0/docs/source/index.rst +40 -0
  44. verus-1.0.0/docs/source/quickstart.rst +67 -0
  45. verus-1.0.0/docs/source/tutorials/advanced_clustering.rst +166 -0
  46. verus-1.0.0/docs/source/tutorials/basic_usage.rst +118 -0
  47. verus-1.0.0/docs/source/tutorials/index.rst +9 -0
  48. verus-1.0.0/docs/source/tutorials/time_window_analysis.rst +171 -0
  49. verus-1.0.0/docs/templates/index.rst +9 -0
  50. verus-1.0.0/docs/templates/modules.rst +7 -0
  51. verus-1.0.0/docs/templates/verus.rst +27 -0
  52. verus-1.0.0/notebooks/examples/basic_usage.ipynb +12512 -0
  53. verus-1.0.0/notebooks/examples/clustering_example.ipynb +35760 -0
  54. verus-1.0.0/notebooks/examples/extract_poi_example.ipynb +366 -0
  55. verus-1.0.0/notebooks/examples/vulnerability_index_example.ipynb +162 -0
  56. verus-1.0.0/notebooks/experiments/01-Porto.ipynb +3233 -0
  57. verus-1.0.0/notebooks/experiments/02-Lisbon.ipynb +3759 -0
  58. verus-1.0.0/notebooks/experiments/03-Paris.ipynb +3947 -0
  59. verus-1.0.0/pyproject.toml +89 -0
  60. verus-1.0.0/setup.cfg +4 -0
  61. verus-1.0.0/src/figures/les2banner.png +0 -0
  62. verus-1.0.0/src/figures/verus_logo.png +0 -0
  63. verus-1.0.0/src/requirements.txt +43 -0
  64. verus-1.0.0/src/verus/__init__.py +46 -0
  65. verus-1.0.0/src/verus/_version.py +21 -0
  66. verus-1.0.0/src/verus/clustering/__init__.py +19 -0
  67. verus-1.0.0/src/verus/clustering/kmeans.py +925 -0
  68. verus-1.0.0/src/verus/clustering/optics.py +795 -0
  69. verus-1.0.0/src/verus/data/__init__.py +20 -0
  70. verus-1.0.0/src/verus/data/extraction.py +864 -0
  71. verus-1.0.0/src/verus/data/timewindow.py +729 -0
  72. verus-1.0.0/src/verus/grid/__init__.py +19 -0
  73. verus-1.0.0/src/verus/grid/hexagon.py +563 -0
  74. verus-1.0.0/src/verus/utils/__init__.py +20 -0
  75. verus-1.0.0/src/verus/utils/logger.py +192 -0
  76. verus-1.0.0/src/verus/utils/timer.py +220 -0
  77. verus-1.0.0/src/verus/verus.py +1277 -0
  78. verus-1.0.0/src/verus.egg-info/PKG-INFO +166 -0
  79. verus-1.0.0/src/verus.egg-info/SOURCES.txt +86 -0
  80. verus-1.0.0/src/verus.egg-info/dependency_links.txt +1 -0
  81. verus-1.0.0/src/verus.egg-info/requires.txt +33 -0
  82. verus-1.0.0/src/verus.egg-info/top_level.txt +3 -0
  83. verus-1.0.0/test/test_extraction.py +153 -0
  84. verus-1.0.0/test/test_hexagon.py +118 -0
  85. verus-1.0.0/test/test_kmeans.py +240 -0
  86. verus-1.0.0/test/test_optics.py +280 -0
  87. verus-1.0.0/test/test_timewindow.py +114 -0
  88. verus-1.0.0/test/test_vulnerability.py +105 -0
@@ -0,0 +1,118 @@
1
+ # Simple workflow for deploying static content to GitHub Pages
2
+ name: Deploy Documentation to Pages
3
+
4
+ on:
5
+ # Runs on pushes targeting the default branch
6
+ push:
7
+ branches: ["main"]
8
+
9
+ # Allows you to run this workflow manually from the Actions tab
10
+ workflow_dispatch:
11
+
12
+ # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
13
+ permissions:
14
+ contents: read
15
+ pages: write
16
+ id-token: write
17
+
18
+ # Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
19
+ # However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
20
+ concurrency:
21
+ group: "pages"
22
+ cancel-in-progress: false
23
+
24
+ jobs:
25
+ # Single deploy job since we're just deploying
26
+ deploy:
27
+ environment:
28
+ name: github-pages
29
+ url: ${{ steps.deployment.outputs.page_url }}
30
+ runs-on: ubuntu-latest
31
+ steps:
32
+ - name: Checkout
33
+ uses: actions/checkout@v4
34
+
35
+ - name: Set up Python
36
+ uses: actions/setup-python@v5
37
+ with:
38
+ python-version: "3.10"
39
+
40
+ - name: Install dependencies
41
+ run: |
42
+ python -m pip install --upgrade pip
43
+ # Install all documentation dependencies
44
+ pip install sphinx sphinx-rtd-theme sphinx-autodoc-typehints nbsphinx
45
+ # If you have a requirements file, also install it
46
+ if [ -f requirements.txt ]; then
47
+ pip install -r requirements.txt
48
+ fi
49
+ # Display installed packages for debugging
50
+ pip freeze
51
+
52
+ - name: Build documentation
53
+ run: |
54
+ mkdir -p docs/source
55
+
56
+ # Check and modify existing conf.py if needed
57
+ if [ -f docs/source/conf.py ]; then
58
+ # Backup the original file
59
+ cp docs/source/conf.py docs/source/conf.py.bak
60
+
61
+ # Check for problematic extensions and create a simplified version if found
62
+ if grep -q "sphinx_autodoc_typehints" docs/source/conf.py; then
63
+ echo "Fixing conf.py by removing problematic extensions"
64
+ # Create a simplified conf.py
65
+ echo 'project = "VERUS"' > docs/source/conf.py
66
+ echo 'copyright = "2025, LES2 Team"' >> docs/source/conf.py
67
+ echo 'author = "oão Carlos N. Bittencourt"' >> docs/source/conf.py
68
+ echo 'extensions = ["sphinx.ext.autodoc", "sphinx.ext.viewcode"]' >> docs/source/conf.py
69
+ echo 'html_theme = "sphinx_rtd_theme"' >> docs/source/conf.py
70
+ fi
71
+ else
72
+ # Create minimal conf.py if it doesn't exist
73
+ echo 'project = "VERUS"' > docs/source/conf.py
74
+ echo 'copyright = "2025, LES2 Team"' >> docs/source/conf.py
75
+ echo 'author = "João Carlos N. Bittencourt"' >> docs/source/conf.py
76
+ echo 'extensions = ["sphinx.ext.autodoc", "sphinx.ext.viewcode"]' >> docs/source/conf.py
77
+ echo 'html_theme = "sphinx_rtd_theme"' >> docs/source/conf.py
78
+ fi
79
+
80
+ # Create minimal index.rst if it doesn't exist
81
+ if [ ! -f docs/source/index.rst ]; then
82
+ echo 'VERUS Documentation' > docs/source/index.rst
83
+ echo '===================' >> docs/source/index.rst
84
+ echo '' >> docs/source/index.rst
85
+ echo 'Welcome to VERUS documentation.' >> docs/source/index.rst
86
+ echo '' >> docs/source/index.rst
87
+ echo 'Contents' >> docs/source/index.rst
88
+ echo '========' >> docs/source/index.rst
89
+ echo '' >> docs/source/index.rst
90
+ echo '.. toctree::' >> docs/source/index.rst
91
+ echo ' :maxdepth: 2' >> docs/source/index.rst
92
+ echo '' >> docs/source/index.rst
93
+ fi
94
+
95
+ # Display the content of conf.py for debugging
96
+ echo "Content of conf.py:"
97
+ cat docs/source/conf.py
98
+
99
+ # Build the documentation
100
+ cd docs
101
+ mkdir -p _build/html
102
+ sphinx-build -b html source _build/html
103
+
104
+ # Create .nojekyll file to prevent GitHub from using Jekyll
105
+ touch _build/html/.nojekyll
106
+
107
+ - name: Setup Pages
108
+ uses: actions/configure-pages@v4
109
+
110
+ - name: Upload artifact
111
+ uses: actions/upload-pages-artifact@v3
112
+ with:
113
+ # Upload the sphinx build directory
114
+ path: "docs/_build/html"
115
+
116
+ - name: Deploy to GitHub Pages
117
+ id: deployment
118
+ uses: actions/deploy-pages@v4
verus-1.0.0/.gitignore ADDED
@@ -0,0 +1,180 @@
1
+ # OS
2
+ .DS_store
3
+ *cache
4
+
5
+ # Result files
6
+ *.html
7
+ *.geojson
8
+ *.csv
9
+
10
+ # Byte-compiled / optimized / DLL files
11
+ __pycache__/
12
+ *.py[cod]
13
+ *$py.class
14
+
15
+ # C extensions
16
+ *.so
17
+
18
+ # Distribution / packaging
19
+ .Python
20
+ build/
21
+ develop-eggs/
22
+ dist/
23
+ downloads/
24
+ eggs/
25
+ .eggs/
26
+ lib/
27
+ lib64/
28
+ parts/
29
+ sdist/
30
+ var/
31
+ wheels/
32
+ share/python-wheels/
33
+ *.egg-info/
34
+ .installed.cfg
35
+ *.egg
36
+ MANIFEST
37
+
38
+ # PyInstaller
39
+ # Usually these files are written by a python script from a template
40
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
41
+ *.manifest
42
+ *.spec
43
+
44
+ # Installer logs
45
+ pip-log.txt
46
+ pip-delete-this-directory.txt
47
+
48
+ # Unit test / coverage reports
49
+ htmlcov/
50
+ .tox/
51
+ .nox/
52
+ .coverage
53
+ .coverage.*
54
+ .cache
55
+ nosetests.xml
56
+ coverage.xml
57
+ *.cover
58
+ *.py,cover
59
+ .hypothesis/
60
+ .pytest_cache/
61
+ cover/
62
+
63
+ # Translations
64
+ *.mo
65
+ *.pot
66
+
67
+ # Django stuff:
68
+ *.log
69
+ local_settings.py
70
+ db.sqlite3
71
+ db.sqlite3-journal
72
+
73
+ # Flask stuff:
74
+ instance/
75
+ .webassets-cache
76
+
77
+ # Scrapy stuff:
78
+ .scrapy
79
+
80
+ # Sphinx documentation
81
+ docs/_build/
82
+
83
+ # PyBuilder
84
+ .pybuilder/
85
+ target/
86
+
87
+ # Jupyter Notebook
88
+ .ipynb_checkpoints
89
+
90
+ # IPython
91
+ profile_default/
92
+ ipython_config.py
93
+
94
+ # pyenv
95
+ # For a library or package, you might want to ignore these files since the code is
96
+ # intended to run in multiple environments; otherwise, check them in:
97
+ # .python-version
98
+
99
+ # pipenv
100
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
101
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
102
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
103
+ # install all needed dependencies.
104
+ #Pipfile.lock
105
+
106
+ # UV
107
+ # Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
108
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
109
+ # commonly ignored for libraries.
110
+ #uv.lock
111
+
112
+ # poetry
113
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
114
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
115
+ # commonly ignored for libraries.
116
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
117
+ #poetry.lock
118
+
119
+ # pdm
120
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
121
+ #pdm.lock
122
+ # pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
123
+ # in version control.
124
+ # https://pdm.fming.dev/latest/usage/project/#working-with-version-control
125
+ .pdm.toml
126
+ .pdm-python
127
+ .pdm-build/
128
+
129
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
130
+ __pypackages__/
131
+
132
+ # Celery stuff
133
+ celerybeat-schedule
134
+ celerybeat.pid
135
+
136
+ # SageMath parsed files
137
+ *.sage.py
138
+
139
+ # Environments
140
+ .env
141
+ .venv
142
+ env/
143
+ venv/
144
+ ENV/
145
+ env.bak/
146
+ venv.bak/
147
+
148
+ # Spyder project settings
149
+ .spyderproject
150
+ .spyproject
151
+
152
+ # Rope project settings
153
+ .ropeproject
154
+
155
+ # mkdocs documentation
156
+ /site
157
+
158
+ # mypy
159
+ .mypy_cache/
160
+ .dmypy.json
161
+ dmypy.json
162
+
163
+ # Pyre type checker
164
+ .pyre/
165
+
166
+ # pytype static type analyzer
167
+ .pytype/
168
+
169
+ # Cython debug symbols
170
+ cython_debug/
171
+
172
+ # PyCharm
173
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
174
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
175
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
176
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
177
+ #.idea/
178
+
179
+ # PyPI configuration file
180
+ .pypirc
@@ -0,0 +1,16 @@
1
+ version: 2
2
+
3
+ sphinx:
4
+ configuration: docs/source/conf.py
5
+
6
+ formats:
7
+ - pdf
8
+ - epub
9
+
10
+ python:
11
+ version: "3.8"
12
+ install:
13
+ - method: pip
14
+ path: .
15
+ extra_requirements:
16
+ - docs
@@ -0,0 +1,36 @@
1
+ # Changelog
2
+
3
+ All notable changes to the VERUS project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [Unreleased]
9
+
10
+ ### Added
11
+
12
+ - Initial documentation for core concepts
13
+ - Support for time-based vulnerability assessment
14
+
15
+ ## [0.1.0] - 2025-03-13
16
+
17
+ ### Added
18
+
19
+ - Initial release of VERUS framework
20
+ - Core functionality for Points of Temporal Influence (PoTIs)
21
+ - Vulnerability zone calculation with hexagonal grid support
22
+ - Time window-based analysis
23
+ - Data extraction from OpenStreetMap
24
+ - Basic visualization tools
25
+ - Gaussian and inverse weighted distance methods for vulnerability calculation
26
+ - Clustering pipeline using OPTICS and KMeans algorithms
27
+
28
+ ### Known Issues
29
+
30
+ - Limited support for time windows
31
+ - Main function can expose more parameters for experimentation
32
+ - PoI filtering to select really influential points is not yet implemented
33
+
34
+ ### Future Improvements
35
+
36
+ - Implement a CLI for easier usage of the framework
verus-1.0.0/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 João Carlos N. Bittencourt
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.
verus-1.0.0/PKG-INFO ADDED
@@ -0,0 +1,166 @@
1
+ Metadata-Version: 2.2
2
+ Name: verus
3
+ Version: 1.0.0
4
+ Summary: A scientific tool to extract and analyze urban spatiotemporal vulnerability.
5
+ Author-email: "João Carlos N. Bittencourt" <joaocarlos@ufrb.edu.br>
6
+ Maintainer: LES2 FEUP faculty memebers
7
+ License: MIT License
8
+ Project-URL: Homepage, https://github.com/les2feup/verus
9
+ Project-URL: Bug Tracker, https://github.com/les2feup/verus/issues
10
+ Project-URL: Documentation, https://les2feup.github.io/verus/
11
+ Project-URL: Code Repository, https://github.com/les2feup/verus
12
+ Keywords: GIS,Vulnerability,Assessment,OpenStreetMap,Clustering
13
+ Classifier: Programming Language :: Python :: 3
14
+ Classifier: Programming Language :: Python :: 3.8
15
+ Classifier: Programming Language :: Python :: 3.9
16
+ Classifier: Programming Language :: Python :: 3.10
17
+ Classifier: License :: OSI Approved :: MIT License
18
+ Classifier: Operating System :: OS Independent
19
+ Classifier: Development Status :: 5 - Production/Stable
20
+ Classifier: Intended Audience :: Science/Research
21
+ Classifier: Intended Audience :: Developers
22
+ Classifier: Topic :: Scientific/Engineering :: GIS
23
+ Classifier: Topic :: Scientific/Engineering :: Information Analysis
24
+ Classifier: Topic :: Scientific/Engineering :: Visualization
25
+ Requires-Python: >=3.8
26
+ Description-Content-Type: text/markdown
27
+ License-File: LICENSE
28
+ Requires-Dist: numpy>=1.20.0
29
+ Requires-Dist: pandas>=1.3.0
30
+ Requires-Dist: geopandas>=0.10.0
31
+ Requires-Dist: shapely>=1.8.0
32
+ Requires-Dist: pyproj>=3.0.0
33
+ Requires-Dist: osmnx>=1.1.0
34
+ Requires-Dist: rtree>=1.0.0
35
+ Requires-Dist: folium>=0.12.0
36
+ Requires-Dist: matplotlib>=3.5.0
37
+ Requires-Dist: plotly>=5.3.0
38
+ Requires-Dist: scikit-learn>=1.0.0
39
+ Requires-Dist: colorama>=0.4.4
40
+ Requires-Dist: tqdm>=4.62.0
41
+ Requires-Dist: requests>=2.26.0
42
+ Requires-Dist: haversine>=2.3.0
43
+ Requires-Dist: branca>=0.4.0
44
+ Provides-Extra: dev
45
+ Requires-Dist: pytest>=6.2.5; extra == "dev"
46
+ Requires-Dist: black>=22.1.0; extra == "dev"
47
+ Requires-Dist: isort>=5.10.1; extra == "dev"
48
+ Requires-Dist: flake8>=4.0.1; extra == "dev"
49
+ Requires-Dist: mypy>=0.910; extra == "dev"
50
+ Requires-Dist: coverage>=6.2; extra == "dev"
51
+ Provides-Extra: docs
52
+ Requires-Dist: sphinx>=4.3.0; extra == "docs"
53
+ Requires-Dist: sphinx-rtd-theme>=1.0.0; extra == "docs"
54
+ Requires-Dist: nbsphinx>=0.8.8; extra == "docs"
55
+ Provides-Extra: viz
56
+ Requires-Dist: seaborn>=0.11.2; extra == "viz"
57
+ Requires-Dist: plotly>=5.3.0; extra == "viz"
58
+
59
+ ![LES2 Logo](./src/figures/les2banner.png)
60
+
61
+ # VERUS
62
+
63
+ _Vulnerability Evaluation for Resilient Urban Systems_
64
+
65
+ ![Python](https://img.shields.io/badge/Python-3.8%2B-blue?style=for-the-badge&logo=python)
66
+ ![Jupyter Notebook](https://img.shields.io/badge/Jupyter-Notebook-orange?style=for-the-badge&logo=jupyter)
67
+ ![OSMnx](https://img.shields.io/badge/OSMnx-1.1.1-blue?style=for-the-badge&logo=openstreetmap)
68
+ ![Folium](https://img.shields.io/badge/Folium-0.12.1-green?style=for-the-badge&logo=folium)
69
+ [![Documentation](https://img.shields.io/badge/docs-latest-brightgreen?style=for-the-badge)](https://les2feup.github.io/verus/)
70
+
71
+ ## Description
72
+
73
+ VERUS (Vulnerability Evaluation for Resilient Urban Systems) is a Python library for extracting points of interest from OpenStreetMap, clustering them based on spatial proximity and time-based vulnerability indices, and analyzing urban vulnerability patterns.
74
+
75
+ ## Documentation
76
+
77
+ Comprehensive documentation is available at [https://les2feup.github.io/verus/](https://les2feup.github.io/verus/)
78
+
79
+ ## Publications
80
+
81
+ - Bittencourt, J. C. N., Costa, D. G., Portugal, P., & Vasques, F. (2024). A data-driven clustering approach for assessing spatiotemporal vulnerability to urban emergencies. Sustainable Cities and Society, 108, 105477. <https://doi.org/10.1016/j.scs.2024.105477>
82
+
83
+ ## Installation
84
+
85
+ ```bash
86
+ pip install verus
87
+ ```
88
+
89
+ ## Reproducing Results
90
+
91
+ To reproduce the results from the latest article, run the following Jupyter Notebooks:
92
+
93
+ - [Porto, Portugal](./notebooks/experiments/01-Porto.ipynb)
94
+ - [Lisbon, Portugal](./notebooks/experiments/02-Lisbon.ipynb)
95
+ - [Paris, France](./notebooks/experiments/03-Paris.ipynb)
96
+
97
+ ## Basic Usage
98
+
99
+ ```python
100
+ from verus import VERUS
101
+ from verus.data import DataExtractor, TimeWindowGenerator
102
+ from verus.grid import HexagonGridGenerator
103
+
104
+ # Extract default urban data from OpenStreetMap
105
+ extractor = DataExtractor(region="Porto, Portugal")
106
+ poi_data = extractor.run()
107
+
108
+ # Define default time-based vulnerability scenarios
109
+ twg = TimeWindowGenerator(reference_date="2023-11-06")
110
+ time_windows = twg.generate_from_schedule()
111
+
112
+ # Generate analysis grid
113
+ grid = HexagonGridGenerator(region="Porto, Portugal", edge_length=250)
114
+ hex_grid = grid.run()
115
+
116
+ # Run vulnerability assessment
117
+ assessor = VERUS(place_name="Porto")
118
+
119
+ # Load extracted data
120
+ assessor.load(
121
+ potis_df=poi_data,
122
+ time_windows_dict=time_windows,
123
+ zones_gdf=hex_grid,
124
+ )
125
+
126
+ # Perform assessment and get results
127
+ evaluation_time = tw_gen.to_unix_epoch("2023-11-06 17:30:00")
128
+ results = assessor.run(evaluation_time=evaluation_time)
129
+
130
+ # Visualize results
131
+ map_obj = assessor.visualize()
132
+
133
+ # Save results to file
134
+ assessor.save("./results/porto/")
135
+ ```
136
+
137
+ ## Features
138
+
139
+ - Extract points of interest from OpenStreetMap for any city
140
+ - Create hexagonal grid systems for spatial analysis
141
+ - Implement OPTICS density-based clustering for identifying urban patterns
142
+ - Apply K-means clustering with Haversine distance for geographic data
143
+ - Generate time-dependent vulnerability assessments
144
+ - Create interactive maps for visualization with folium
145
+ - Export results in various formats (GeoJSON, CSV, HTML)
146
+
147
+ ## Contributions
148
+
149
+ Contributions are welcome! To contribute:
150
+
151
+ 1. Fork the repository
152
+ 2. Create a feature branch: `git checkout -b feature/amazing-feature`
153
+ 3. Commit changes: `git commit -m 'Add amazing feature'`
154
+ 4. Push to branch: `git push origin feature/amazing-feature`
155
+ 5. Open a pull request
156
+
157
+ Please make sure to update tests and documentation as appropriate.
158
+
159
+ ## License
160
+
161
+ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
162
+
163
+ ## Acknowledgments
164
+
165
+ - Research developed at the Laboratory of Emergent Smart Systems (LES2) at the Faculty of Engineering of University of Porto
166
+ - This work was supported by the Associate Laboratory Advanced Production and Intelligent Systems – ARISE LA/P/0112/2020 (DOI 10.54499/LA/P/0112/2020), by the Base Funding (UIDB/00147/2020) and Programmatic Funding (UIDP/00147/2020) of the R\&D Unit Center for Systems and Technologies -- SYSTEC, and by the Fundação para a Ciência e a Tecnologia (FCT) through the PhD scholarship (2024.02446.BD).
verus-1.0.0/README.md ADDED
@@ -0,0 +1,108 @@
1
+ ![LES2 Logo](./src/figures/les2banner.png)
2
+
3
+ # VERUS
4
+
5
+ _Vulnerability Evaluation for Resilient Urban Systems_
6
+
7
+ ![Python](https://img.shields.io/badge/Python-3.8%2B-blue?style=for-the-badge&logo=python)
8
+ ![Jupyter Notebook](https://img.shields.io/badge/Jupyter-Notebook-orange?style=for-the-badge&logo=jupyter)
9
+ ![OSMnx](https://img.shields.io/badge/OSMnx-1.1.1-blue?style=for-the-badge&logo=openstreetmap)
10
+ ![Folium](https://img.shields.io/badge/Folium-0.12.1-green?style=for-the-badge&logo=folium)
11
+ [![Documentation](https://img.shields.io/badge/docs-latest-brightgreen?style=for-the-badge)](https://les2feup.github.io/verus/)
12
+
13
+ ## Description
14
+
15
+ VERUS (Vulnerability Evaluation for Resilient Urban Systems) is a Python library for extracting points of interest from OpenStreetMap, clustering them based on spatial proximity and time-based vulnerability indices, and analyzing urban vulnerability patterns.
16
+
17
+ ## Documentation
18
+
19
+ Comprehensive documentation is available at [https://les2feup.github.io/verus/](https://les2feup.github.io/verus/)
20
+
21
+ ## Publications
22
+
23
+ - Bittencourt, J. C. N., Costa, D. G., Portugal, P., & Vasques, F. (2024). A data-driven clustering approach for assessing spatiotemporal vulnerability to urban emergencies. Sustainable Cities and Society, 108, 105477. <https://doi.org/10.1016/j.scs.2024.105477>
24
+
25
+ ## Installation
26
+
27
+ ```bash
28
+ pip install verus
29
+ ```
30
+
31
+ ## Reproducing Results
32
+
33
+ To reproduce the results from the latest article, run the following Jupyter Notebooks:
34
+
35
+ - [Porto, Portugal](./notebooks/experiments/01-Porto.ipynb)
36
+ - [Lisbon, Portugal](./notebooks/experiments/02-Lisbon.ipynb)
37
+ - [Paris, France](./notebooks/experiments/03-Paris.ipynb)
38
+
39
+ ## Basic Usage
40
+
41
+ ```python
42
+ from verus import VERUS
43
+ from verus.data import DataExtractor, TimeWindowGenerator
44
+ from verus.grid import HexagonGridGenerator
45
+
46
+ # Extract default urban data from OpenStreetMap
47
+ extractor = DataExtractor(region="Porto, Portugal")
48
+ poi_data = extractor.run()
49
+
50
+ # Define default time-based vulnerability scenarios
51
+ twg = TimeWindowGenerator(reference_date="2023-11-06")
52
+ time_windows = twg.generate_from_schedule()
53
+
54
+ # Generate analysis grid
55
+ grid = HexagonGridGenerator(region="Porto, Portugal", edge_length=250)
56
+ hex_grid = grid.run()
57
+
58
+ # Run vulnerability assessment
59
+ assessor = VERUS(place_name="Porto")
60
+
61
+ # Load extracted data
62
+ assessor.load(
63
+ potis_df=poi_data,
64
+ time_windows_dict=time_windows,
65
+ zones_gdf=hex_grid,
66
+ )
67
+
68
+ # Perform assessment and get results
69
+ evaluation_time = tw_gen.to_unix_epoch("2023-11-06 17:30:00")
70
+ results = assessor.run(evaluation_time=evaluation_time)
71
+
72
+ # Visualize results
73
+ map_obj = assessor.visualize()
74
+
75
+ # Save results to file
76
+ assessor.save("./results/porto/")
77
+ ```
78
+
79
+ ## Features
80
+
81
+ - Extract points of interest from OpenStreetMap for any city
82
+ - Create hexagonal grid systems for spatial analysis
83
+ - Implement OPTICS density-based clustering for identifying urban patterns
84
+ - Apply K-means clustering with Haversine distance for geographic data
85
+ - Generate time-dependent vulnerability assessments
86
+ - Create interactive maps for visualization with folium
87
+ - Export results in various formats (GeoJSON, CSV, HTML)
88
+
89
+ ## Contributions
90
+
91
+ Contributions are welcome! To contribute:
92
+
93
+ 1. Fork the repository
94
+ 2. Create a feature branch: `git checkout -b feature/amazing-feature`
95
+ 3. Commit changes: `git commit -m 'Add amazing feature'`
96
+ 4. Push to branch: `git push origin feature/amazing-feature`
97
+ 5. Open a pull request
98
+
99
+ Please make sure to update tests and documentation as appropriate.
100
+
101
+ ## License
102
+
103
+ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
104
+
105
+ ## Acknowledgments
106
+
107
+ - Research developed at the Laboratory of Emergent Smart Systems (LES2) at the Faculty of Engineering of University of Porto
108
+ - This work was supported by the Associate Laboratory Advanced Production and Intelligent Systems – ARISE LA/P/0112/2020 (DOI 10.54499/LA/P/0112/2020), by the Base Funding (UIDB/00147/2020) and Programmatic Funding (UIDP/00147/2020) of the R\&D Unit Center for Systems and Technologies -- SYSTEC, and by the Fundação para a Ciência e a Tecnologia (FCT) through the PhD scholarship (2024.02446.BD).
@@ -0,0 +1,45 @@
1
+ # Best Practices for Maintaining Your Changelog
2
+
3
+ 1. **Always Update the Changelog:** Add entries as you implement changes, not just before release.
4
+ 2. **Group Changes by Type:**
5
+
6
+ - `Added` for new features
7
+ - `Changed` for changes in existing functionality
8
+ - `Deprecated` for soon-to-be removed features
9
+ - `Removed` for now removed features
10
+ - `Fixed` for any bug fixes
11
+ - `Security` for vulnerability fixes
12
+
13
+ 3. **Keep an "Unreleased" Section:** Track changes that haven't been - released yet.
14
+
15
+ 4. **Date Format:** Use YYYY-MM-DD format for release dates.
16
+
17
+ 5. **Link to Release Tags:** Add links to GitHub/GitLab release tags at the bottom of the file (if applicable).
18
+
19
+ 6. **Mention Breaking Changes Prominently:** Make sure users can easily identify changes that might break their code.
20
+
21
+ 7. **Use Plain Language:** Write for humans, not machines. Explain the impact of changes.
22
+
23
+ ## Sample Implementation with Git Integration
24
+
25
+ If you're using Git, you can enhance your changelog management:
26
+
27
+ 1. Create a release branch:`git checkout -b release/0.1.0`
28
+
29
+ 2. Update version number in your project files and changelog
30
+
31
+ 3. Commit the changes: `git commit -am "Release 0.1.0"`
32
+
33
+ 4. Create a git tag: `git tag -a v0.1.0 -m "Release 0.1.0"`
34
+
35
+ 5. Push to remote: `git push origin release/0.1.0 && git push origin v0.1.0`
36
+
37
+ This process ensures your changelog and version information are always in sync with your actual releases.
38
+
39
+ ## Additional Tools
40
+
41
+ Consider using automated changelog generation tools to help maintain your changelog:
42
+
43
+ - **auto-changelog:** Generates a changelog from git metadata
44
+ - **standard-version:** Automates versioning and CHANGELOG generation
45
+ - **keep-a-changelog:** Helps generate changelogs following the Keep a Changelog format