Skip to content

Commit 159fa2a

Browse files
authored
Merge pull request #1 from shnmrt/main
working version of the saferoad
2 parents 44579e5 + 094a3ac commit 159fa2a

File tree

127 files changed

+37809
-1
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

127 files changed

+37809
-1
lines changed

.github/workflows/docs.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Build & Deploy Docs
2+
on:
3+
push:
4+
branches: [main]
5+
6+
permissions:
7+
contents: write
8+
pages: write
9+
id-token: write
10+
11+
jobs:
12+
build:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
- uses: actions/setup-python@v5
17+
with:
18+
python-version: "3.10"
19+
- name: Install depdencies
20+
run: |
21+
python -m pip install -U pip
22+
pip install .
23+
pip install sphinx sphinx-rtd-theme
24+
25+
- name: Build Docs
26+
run: sphinx-build -b html docs/source docs/_build/html
27+
- name: add .nojekyll
28+
run: touch docs/_build/html/.nojekyll
29+
30+
- name: Deploy to GitHub Pages
31+
uses: peaceiris/actions-gh-pages@v4
32+
with:
33+
github_token: ${{ secrets.GITHUB_TOKEN }}
34+
publish_dir: docs/_build/html
35+
publish_branch: gh-pages
36+
force_orphan: true

.github/workflows/tests.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Test CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
python-version: ["3.10", "3.11", "3.12"]
15+
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- name: Set up Python ${{ matrix.python-version }}
20+
uses: actions/setup-python@v5
21+
with:
22+
python-version: ${{ matrix.python-version }}
23+
cache: "pip"
24+
25+
- name: Install dependencies
26+
run: |
27+
python -m pip install --upgrade pip
28+
pip install .
29+
python -c "import duckdb; duckdb.install_extension('spatial')"
30+
pip install coverage
31+
32+
- name: Run unittests with coverage
33+
run: |
34+
coverage run -m tests
35+
coverage report -m --omit="tests/*"

README.md

Lines changed: 51 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,51 @@
1-
# SafeRoads
1+
# SafeRoad
2+
3+
## About
4+
5+
**SafeRoad** is an open-source Python library designed to monitor the structural condition of the road network by providing tools for data analysis and visualisation.
6+
It aims to assist researchers, policymakers, and developers in understanding and mitigating structural safety issues of road networks.
7+
**SafeRoad** is built with a focus on usability, performance, and extensibility. It uses modern Python libraries such as [duckdb](https://duckdb.org/),
8+
[shapely](https://shapely.readthedocs.io/en/stable/), [matplotlib](https://matplotlib.org/) and [contextily](https://contextily.readthedocs.io/en/latest/) to provide a robust framework for road network safety analyses.
9+
10+
You can access the more detailed description of the methodology from the [paper](https://doi.org/10.1177/14759217211045912).
11+
12+
The library is modular, user-friendly, and well-documented, making it suitable for both beginners and experts in the field of structural safety.
13+
14+
## Installation
15+
16+
1. Create a virtual environment and activate it
17+
18+
```bash
19+
# conda
20+
conda create --name saferoad_env python=3.10
21+
# activate environment
22+
conda activate saferoad_env
23+
```
24+
25+
2. Clone the reposity to your current directory
26+
27+
```bash
28+
git clone https://github.com/SafeStruct/SafeRoad.git
29+
```
30+
31+
3. Install the library from directory using pip
32+
33+
```bash
34+
pip install -e ./SafeRoad
35+
```
36+
37+
4. Testing the installation using tutorial
38+
39+
```bash
40+
# before testing one extension needs to be installed
41+
python -c "import duckdb; duckdb.install_extension('spatial')"
42+
# change the directory to examples and run the tutorial
43+
cd SafeRoad/examples
44+
python tutorial.py
45+
```
46+
47+
If everything works correctly, you should see a folder called **`SafeRoadDB`** inside the example folder. Inside that folder, you will find the generated **PDF** report for the entire dataset provided.
48+
49+
# Disclaimer
50+
51+
The Multi-Temporal SAR data provided in the repository is not real; it is synthetic. It is produced to demonstrate how the tool works and what kind of report it generates.

docs/Makefile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Minimal makefile for Sphinx documentation
2+
#
3+
4+
# You can set these variables from the command line, and also
5+
# from the environment for the first two.
6+
SPHINXOPTS ?=
7+
SPHINXBUILD ?= sphinx-build
8+
SOURCEDIR = source
9+
BUILDDIR = build
10+
11+
# Put it first so that "make" without argument is like "make help".
12+
help:
13+
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
14+
15+
.PHONY: help Makefile
16+
17+
# Catch-all target: route all unknown targets to Sphinx using the new
18+
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
19+
%: Makefile
20+
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
2.73 KB
Binary file not shown.
14.9 KB
Binary file not shown.
402 KB
Binary file not shown.
326 KB
Binary file not shown.
176 KB
Binary file not shown.
62.3 KB
Binary file not shown.

0 commit comments

Comments
 (0)