verus 0.1.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.
- verus-0.1.1/.github/workflows/static.yml +118 -0
- verus-0.1.1/.gitignore +180 -0
- verus-0.1.1/.readthedocs.yml +16 -0
- verus-0.1.1/CHANGELOG.md +44 -0
- verus-0.1.1/LICENSE +21 -0
- verus-0.1.1/PKG-INFO +167 -0
- verus-0.1.1/README.md +108 -0
- verus-0.1.1/changelog_instructions.md +45 -0
- verus-0.1.1/docs/BUILDINSTRUCTIONS.md +174 -0
- verus-0.1.1/docs/Makefile +20 -0
- verus-0.1.1/docs/build_docs.sh +46 -0
- verus-0.1.1/docs/generate_api_docs.py +154 -0
- verus-0.1.1/docs/make.bat +35 -0
- verus-0.1.1/docs/source/api/index.rst +9 -0
- verus-0.1.1/docs/source/api/modules.rst +7 -0
- verus-0.1.1/docs/source/api/verus._version.rst +8 -0
- verus-0.1.1/docs/source/api/verus.analyzer.rst +8 -0
- verus-0.1.1/docs/source/api/verus.cache.rst +8 -0
- verus-0.1.1/docs/source/api/verus.clustering.kmeans.rst +8 -0
- verus-0.1.1/docs/source/api/verus.clustering.optics.rst +8 -0
- verus-0.1.1/docs/source/api/verus.clustering.rst +15 -0
- verus-0.1.1/docs/source/api/verus.data.extraction.rst +8 -0
- verus-0.1.1/docs/source/api/verus.data.rst +15 -0
- verus-0.1.1/docs/source/api/verus.data.timewindow.rst +8 -0
- verus-0.1.1/docs/source/api/verus.grid.hexagon.rst +8 -0
- verus-0.1.1/docs/source/api/verus.grid.rst +14 -0
- verus-0.1.1/docs/source/api/verus.rst +27 -0
- verus-0.1.1/docs/source/api/verus.utils.config.rst +8 -0
- verus-0.1.1/docs/source/api/verus.utils.logger.rst +8 -0
- verus-0.1.1/docs/source/api/verus.utils.rst +15 -0
- verus-0.1.1/docs/source/api/verus.utils.timer.rst +8 -0
- verus-0.1.1/docs/source/api/verus.verus.rst +8 -0
- verus-0.1.1/docs/source/concepts/index.rst +12 -0
- verus-0.1.1/docs/source/concepts/potis.rst +54 -0
- verus-0.1.1/docs/source/concepts/time_windows.rst +93 -0
- verus-0.1.1/docs/source/concepts/vulnerability_computation.rst +91 -0
- verus-0.1.1/docs/source/concepts/vulnerability_zones.rst +73 -0
- verus-0.1.1/docs/source/conf.py +69 -0
- verus-0.1.1/docs/source/development.rst +47 -0
- verus-0.1.1/docs/source/examples/clustering_example.rst +48 -0
- verus-0.1.1/docs/source/examples/extract_poi_example.rst +34 -0
- verus-0.1.1/docs/source/examples/index.rst +16 -0
- verus-0.1.1/docs/source/examples/vulnerability_index_example.rst +28 -0
- verus-0.1.1/docs/source/index.rst +40 -0
- verus-0.1.1/docs/source/quickstart.rst +67 -0
- verus-0.1.1/docs/source/tutorials/advanced_clustering.rst +166 -0
- verus-0.1.1/docs/source/tutorials/basic_usage.rst +126 -0
- verus-0.1.1/docs/source/tutorials/index.rst +9 -0
- verus-0.1.1/docs/source/tutorials/time_window_analysis.rst +171 -0
- verus-0.1.1/docs/templates/index.rst +9 -0
- verus-0.1.1/docs/templates/modules.rst +7 -0
- verus-0.1.1/docs/templates/verus.rst +27 -0
- verus-0.1.1/notebooks/examples/basic_usage.ipynb +12512 -0
- verus-0.1.1/notebooks/examples/clustering_example.ipynb +35760 -0
- verus-0.1.1/notebooks/examples/extract_poi_example.ipynb +366 -0
- verus-0.1.1/notebooks/examples/vulnerability_index_example.ipynb +162 -0
- verus-0.1.1/notebooks/experiments/01-Porto.ipynb +3233 -0
- verus-0.1.1/notebooks/experiments/02-Lisbon.ipynb +3759 -0
- verus-0.1.1/notebooks/experiments/03-Paris.ipynb +3947 -0
- verus-0.1.1/pyproject.toml +86 -0
- verus-0.1.1/setup.cfg +4 -0
- verus-0.1.1/src/figures/les2banner.png +0 -0
- verus-0.1.1/src/figures/verus_logo.png +0 -0
- verus-0.1.1/src/requirements.txt +43 -0
- verus-0.1.1/src/verus/__init__.py +46 -0
- verus-0.1.1/src/verus/_version.py +21 -0
- verus-0.1.1/src/verus/clustering/__init__.py +19 -0
- verus-0.1.1/src/verus/clustering/kmeans.py +925 -0
- verus-0.1.1/src/verus/clustering/optics.py +795 -0
- verus-0.1.1/src/verus/data/__init__.py +20 -0
- verus-0.1.1/src/verus/data/extraction.py +864 -0
- verus-0.1.1/src/verus/data/timewindow.py +729 -0
- verus-0.1.1/src/verus/grid/__init__.py +19 -0
- verus-0.1.1/src/verus/grid/hexagon.py +616 -0
- verus-0.1.1/src/verus/utils/__init__.py +20 -0
- verus-0.1.1/src/verus/utils/logger.py +192 -0
- verus-0.1.1/src/verus/utils/timer.py +220 -0
- verus-0.1.1/src/verus/verus.py +1277 -0
- verus-0.1.1/src/verus.egg-info/PKG-INFO +167 -0
- verus-0.1.1/src/verus.egg-info/SOURCES.txt +87 -0
- verus-0.1.1/src/verus.egg-info/dependency_links.txt +1 -0
- verus-0.1.1/src/verus.egg-info/requires.txt +33 -0
- verus-0.1.1/src/verus.egg-info/top_level.txt +3 -0
- verus-0.1.1/test/test_extraction.py +153 -0
- verus-0.1.1/test/test_hexagon.py +118 -0
- verus-0.1.1/test/test_kmeans.py +240 -0
- verus-0.1.1/test/test_optics.py +280 -0
- verus-0.1.1/test/test_timewindow.py +114 -0
- verus-0.1.1/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-0.1.1/.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
|
verus-0.1.1/CHANGELOG.md
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
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
|
+
## [0.1.1] - 2025-06-10
|
|
13
|
+
|
|
14
|
+
### Added
|
|
15
|
+
|
|
16
|
+
- Support for loading custom region boundaries from GeoJSON files in HexagonGridGenerator
|
|
17
|
+
|
|
18
|
+
### Improved
|
|
19
|
+
|
|
20
|
+
- Updated documentation with examples of GeoJSON file usage
|
|
21
|
+
- Enhanced hexagon grid generator with file validation and error handling
|
|
22
|
+
|
|
23
|
+
## [0.1.0] - 2025-03-13
|
|
24
|
+
|
|
25
|
+
### Added
|
|
26
|
+
|
|
27
|
+
- Initial release of VERUS framework
|
|
28
|
+
- Core functionality for Points of Temporal Influence (PoTIs)
|
|
29
|
+
- Vulnerability zone calculation with hexagonal grid support
|
|
30
|
+
- Time window-based analysis
|
|
31
|
+
- Data extraction from OpenStreetMap
|
|
32
|
+
- Basic visualization tools
|
|
33
|
+
- Gaussian and inverse weighted distance methods for vulnerability calculation
|
|
34
|
+
- Clustering pipeline using OPTICS and KMeans algorithms
|
|
35
|
+
|
|
36
|
+
### Known Issues
|
|
37
|
+
|
|
38
|
+
- Limited support for time windows
|
|
39
|
+
- Main function can expose more parameters for experimentation
|
|
40
|
+
- PoI filtering to select really influential points is not yet implemented
|
|
41
|
+
|
|
42
|
+
### Future Improvements
|
|
43
|
+
|
|
44
|
+
- Implement a CLI for easier usage of the framework
|
verus-0.1.1/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-0.1.1/PKG-INFO
ADDED
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: verus
|
|
3
|
+
Version: 0.1.1
|
|
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
|
+
Dynamic: license-file
|
|
59
|
+
|
|
60
|
+

|
|
61
|
+
|
|
62
|
+
# VERUS
|
|
63
|
+
|
|
64
|
+
_Vulnerability Evaluation for Resilient Urban Systems_
|
|
65
|
+
|
|
66
|
+

|
|
67
|
+

|
|
68
|
+

|
|
69
|
+

|
|
70
|
+
[](https://les2feup.github.io/verus/)
|
|
71
|
+
|
|
72
|
+
## Description
|
|
73
|
+
|
|
74
|
+
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.
|
|
75
|
+
|
|
76
|
+
## Documentation
|
|
77
|
+
|
|
78
|
+
Comprehensive documentation is available at [https://les2feup.github.io/verus/](https://les2feup.github.io/verus/)
|
|
79
|
+
|
|
80
|
+
## Publications
|
|
81
|
+
|
|
82
|
+
- 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>
|
|
83
|
+
|
|
84
|
+
## Installation
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
pip install verus
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
## Reproducing Results
|
|
91
|
+
|
|
92
|
+
To reproduce the results from the latest article, run the following Jupyter Notebooks:
|
|
93
|
+
|
|
94
|
+
- [Porto, Portugal](./notebooks/experiments/01-Porto.ipynb)
|
|
95
|
+
- [Lisbon, Portugal](./notebooks/experiments/02-Lisbon.ipynb)
|
|
96
|
+
- [Paris, France](./notebooks/experiments/03-Paris.ipynb)
|
|
97
|
+
|
|
98
|
+
## Basic Usage
|
|
99
|
+
|
|
100
|
+
```python
|
|
101
|
+
from verus import VERUS
|
|
102
|
+
from verus.data import DataExtractor, TimeWindowGenerator
|
|
103
|
+
from verus.grid import HexagonGridGenerator
|
|
104
|
+
|
|
105
|
+
# Extract default urban data from OpenStreetMap
|
|
106
|
+
extractor = DataExtractor(region="Porto, Portugal")
|
|
107
|
+
poi_data = extractor.run()
|
|
108
|
+
|
|
109
|
+
# Define default time-based vulnerability scenarios
|
|
110
|
+
twg = TimeWindowGenerator(reference_date="2023-11-06")
|
|
111
|
+
time_windows = twg.generate_from_schedule()
|
|
112
|
+
|
|
113
|
+
# Generate analysis grid
|
|
114
|
+
grid = HexagonGridGenerator(region="Porto, Portugal", edge_length=250)
|
|
115
|
+
hex_grid = grid.run()
|
|
116
|
+
|
|
117
|
+
# Run vulnerability assessment
|
|
118
|
+
assessor = VERUS(place_name="Porto")
|
|
119
|
+
|
|
120
|
+
# Load extracted data
|
|
121
|
+
assessor.load(
|
|
122
|
+
potis_df=poi_data,
|
|
123
|
+
time_windows_dict=time_windows,
|
|
124
|
+
zones_gdf=hex_grid,
|
|
125
|
+
)
|
|
126
|
+
|
|
127
|
+
# Perform assessment and get results
|
|
128
|
+
evaluation_time = tw_gen.to_unix_epoch("2023-11-06 17:30:00")
|
|
129
|
+
results = assessor.run(evaluation_time=evaluation_time)
|
|
130
|
+
|
|
131
|
+
# Visualize results
|
|
132
|
+
map_obj = assessor.visualize()
|
|
133
|
+
|
|
134
|
+
# Save results to file
|
|
135
|
+
assessor.save("./results/porto/")
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
## Features
|
|
139
|
+
|
|
140
|
+
- Extract points of interest from OpenStreetMap for any city
|
|
141
|
+
- Create hexagonal grid systems for spatial analysis
|
|
142
|
+
- Implement OPTICS density-based clustering for identifying urban patterns
|
|
143
|
+
- Apply K-means clustering with Haversine distance for geographic data
|
|
144
|
+
- Generate time-dependent vulnerability assessments
|
|
145
|
+
- Create interactive maps for visualization with folium
|
|
146
|
+
- Export results in various formats (GeoJSON, CSV, HTML)
|
|
147
|
+
|
|
148
|
+
## Contributions
|
|
149
|
+
|
|
150
|
+
Contributions are welcome! To contribute:
|
|
151
|
+
|
|
152
|
+
1. Fork the repository
|
|
153
|
+
2. Create a feature branch: `git checkout -b feature/amazing-feature`
|
|
154
|
+
3. Commit changes: `git commit -m 'Add amazing feature'`
|
|
155
|
+
4. Push to branch: `git push origin feature/amazing-feature`
|
|
156
|
+
5. Open a pull request
|
|
157
|
+
|
|
158
|
+
Please make sure to update tests and documentation as appropriate.
|
|
159
|
+
|
|
160
|
+
## License
|
|
161
|
+
|
|
162
|
+
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
|
|
163
|
+
|
|
164
|
+
## Acknowledgments
|
|
165
|
+
|
|
166
|
+
- Research developed at the Laboratory of Emergent Smart Systems (LES2) at the Faculty of Engineering of University of Porto
|
|
167
|
+
- 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-0.1.1/README.md
ADDED
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+

|
|
2
|
+
|
|
3
|
+
# VERUS
|
|
4
|
+
|
|
5
|
+
_Vulnerability Evaluation for Resilient Urban Systems_
|
|
6
|
+
|
|
7
|
+

|
|
8
|
+

|
|
9
|
+

|
|
10
|
+

|
|
11
|
+
[](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).
|