Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
4eabd96
test: unit tests for database module
shnmrt Sep 16, 2025
5bd6ffe
feat: database module
shnmrt Sep 16, 2025
9829d35
tests: unit tests for utility methods
shnmrt Sep 16, 2025
64031e5
feat: utility functions for library
shnmrt Sep 16, 2025
c1dc908
tests: unit tests of pipeline module
shnmrt Sep 17, 2025
df48858
feat: pipelines for data processing and plotting
shnmrt Sep 18, 2025
e8db997
tests: test configuration
shnmrt Sep 18, 2025
91a36f2
tests: unit tests of plotter
shnmrt Sep 19, 2025
aa8f8da
refac: include test_plotter
shnmrt Sep 19, 2025
9ca1948
feat: plotter module for report generation
shnmrt Sep 19, 2025
96f80b0
tests: unit tests for the saferoad module
shnmrt Sep 23, 2025
3f0a329
refac: selection of the outliers
shnmrt Sep 29, 2025
33cadde
refac: add outlier determination criteria field to table
shnmrt Sep 30, 2025
4d4c1db
refac: outlier access method and some docs
shnmrt Sep 30, 2025
2905d00
refac: return numpy array for convenience
shnmrt Sep 30, 2025
8e3abde
update: test updates
shnmrt Sep 30, 2025
2535f39
refac: clean up after tests added
shnmrt Sep 30, 2025
3ed9737
update: type change
shnmrt Sep 30, 2025
2dbe0ca
fix: color of the 1sigma std
shnmrt Oct 1, 2025
a0c48a7
add: init module
shnmrt Oct 1, 2025
9890e97
feat: fundamental data classes
shnmrt Oct 3, 2025
1463510
feat: saferoad class initialization
shnmrt Oct 3, 2025
de5638f
feat: scaling factor based on the unit of the given mt-insar data
shnmrt Oct 3, 2025
14b1cb7
closing plot to prevent warnings
shnmrt Dec 1, 2025
241eed0
last touches
shnmrt Dec 1, 2025
685017e
readme file
shnmrt Dec 1, 2025
ebcc4f1
build instructions
shnmrt Dec 1, 2025
a76eb2f
sample road data
shnmrt Dec 1, 2025
7f83c76
synthetic psdata
shnmrt Dec 1, 2025
51dfcc0
sample tutorial
shnmrt Dec 1, 2025
7b92abe
the docs
shnmrt Dec 1, 2025
72e2ea0
github ci
shnmrt Dec 1, 2025
c3c14e3
fix typo
shnmrt Dec 1, 2025
a170376
Merge pull request #1 from shnmrt/dev
shnmrt Dec 1, 2025
6aefeea
missing installation instruction
shnmrt Dec 1, 2025
094a3ac
Merge pull request #2 from shnmrt/dev
shnmrt Dec 1, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Build & Deploy Docs
on:
push:
branches: [main]

permissions:
contents: write
pages: write
id-token: write

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Install depdencies
run: |
python -m pip install -U pip
pip install .
pip install sphinx sphinx-rtd-theme

- name: Build Docs
run: sphinx-build -b html docs/source docs/_build/html
- name: add .nojekyll
run: touch docs/_build/html/.nojekyll

- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: docs/_build/html
publish_branch: gh-pages
force_orphan: true
35 changes: 35 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Test CI

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: "pip"

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install .
python -c "import duckdb; duckdb.install_extension('spatial')"
pip install coverage

- name: Run unittests with coverage
run: |
coverage run -m tests
coverage report -m --omit="tests/*"
52 changes: 51 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,51 @@
# SafeRoads
# SafeRoad

## About

**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.
It aims to assist researchers, policymakers, and developers in understanding and mitigating structural safety issues of road networks.
**SafeRoad** is built with a focus on usability, performance, and extensibility. It uses modern Python libraries such as [duckdb](https://duckdb.org/),
[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.

You can access the more detailed description of the methodology from the [paper](https://doi.org/10.1177/14759217211045912).

The library is modular, user-friendly, and well-documented, making it suitable for both beginners and experts in the field of structural safety.

## Installation

1. Create a virtual environment and activate it

```bash
# conda
conda create --name saferoad_env python=3.10
# activate environment
conda activate saferoad_env
```

2. Clone the reposity to your current directory

```bash
git clone https://github.com/SafeStruct/SafeRoad.git
```

3. Install the library from directory using pip

```bash
pip install -e ./SafeRoad
```

4. Testing the installation using tutorial

```bash
# before testing one extension needs to be installed
python -c "import duckdb; duckdb.install_extension('spatial')"
# change the directory to examples and run the tutorial
cd SafeRoad/examples
python tutorial.py
```

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.

# Disclaimer

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.
20 changes: 20 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = source
BUILDDIR = build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
Binary file added docs/build/doctrees/api/modules.doctree
Binary file not shown.
Binary file added docs/build/doctrees/api/saferoad.database.doctree
Binary file not shown.
Binary file added docs/build/doctrees/api/saferoad.doctree
Binary file not shown.
Binary file not shown.
Binary file added docs/build/doctrees/api/saferoad.plotter.doctree
Binary file not shown.
Binary file added docs/build/doctrees/api/saferoad.saferoad.doctree
Binary file not shown.
Binary file added docs/build/doctrees/api/saferoad.utils.doctree
Binary file not shown.
Binary file added docs/build/doctrees/environment.pickle
Binary file not shown.
Binary file added docs/build/doctrees/index.doctree
Binary file not shown.
4 changes: 4 additions & 0 deletions docs/build/html/.buildinfo
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Sphinx build info version 1
# This file records the configuration used when building these files. When it is not found, a full rebuild will be done.
config: ae51672f3ba48d0bc0d242e97b3d37a6
tags: 645f666f9bcd5a90fca523b33c5a78b7
105 changes: 105 additions & 0 deletions docs/build/html/_modules/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@


<!DOCTYPE html>
<html class="writer-html5" lang="en" data-content_root="../">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Overview: module code &mdash; saferoad 0.1 documentation</title>
<link rel="stylesheet" type="text/css" href="../_static/pygments.css?v=b86133f3" />
<link rel="stylesheet" type="text/css" href="../_static/css/theme.css?v=e59714d7" />


<script src="../_static/jquery.js?v=5d32c60e"></script>
<script src="../_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
<script src="../_static/documentation_options.js?v=2709fde1"></script>
<script src="../_static/doctools.js?v=9bcbadda"></script>
<script src="../_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="../_static/js/theme.js"></script>
<link rel="index" title="Index" href="../genindex.html" />
<link rel="search" title="Search" href="../search.html" />
</head>

<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search" >



<a href="../index.html" class="icon icon-home">
saferoad
</a>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="../search.html" method="get">
<input type="text" name="q" placeholder="Search docs" aria-label="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
<p class="caption" role="heading"><span class="caption-text">Contents:</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../api/modules.html">saferoad</a></li>
</ul>

</div>
</div>
</nav>

<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" >
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="../index.html">saferoad</a>
</nav>

<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="Page navigation">
<ul class="wy-breadcrumbs">
<li><a href="../index.html" class="icon icon-home" aria-label="Home"></a></li>
<li class="breadcrumb-item active">Overview: module code</li>
<li class="wy-breadcrumbs-aside">
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">

<h1>All modules for which code is available</h1>
<ul><li><a href="saferoad/database.html">saferoad.database</a></li>
<li><a href="saferoad/pipeline.html">saferoad.pipeline</a></li>
<li><a href="saferoad/plotter.html">saferoad.plotter</a></li>
<li><a href="saferoad/saferoad.html">saferoad.saferoad</a></li>
<li><a href="saferoad/utils.html">saferoad.utils</a></li>
</ul>

</div>
</div>
<footer>

<hr/>

<div role="contentinfo">
<p>&#169; Copyright 2025, SafeStruct.</p>
</div>

Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
provided by <a href="https://readthedocs.org">Read the Docs</a>.


</footer>
</div>
</div>
</section>
</div>
<script>
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script>

</body>
</html>
Loading