From c05688e55df7f8488e4edc6e513b38234dcca14e Mon Sep 17 00:00:00 2001 From: Raul Galdeano Pazos <101328916+TheWinterCoderDev@users.noreply.github.com> Date: Sun, 22 Nov 2026 21:32:19 +0100 Subject: [PATCH 01/20] Update README.md --- consolidation_1_d/README.md | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/consolidation_1_d/README.md b/consolidation_1_d/README.md index 12a409a..aa094d9 100644 --- a/consolidation_1_d/README.md +++ b/consolidation_1_d/README.md @@ -1,11 +1,2 @@ -# Welcome dear user! In this folder, you can find a profiler to create a 1D Consolidation – Porewater Pressure Profiles and Isochrones -## This module implements the classical Fourier-series solution for the 1D consolidation (Terzaghi) problem with double drainage and uniform initial excess porewater pressure -### This profiler has been made among a challenge expressed in the Geotechnics class of 9th of december, 2025 - -The folders provide: - -- A function **`porewater_pressure(Z, T)`** to compute the non-dimensional - porewater pressure W(Z,T). -- A plotting utility to generate profiles and isochrones. -- An example figure reproducing the typical consolidation isochrones - seen in soil mechanics textbooks. +numpy +matplotlib From cfbf45ecd03b84a950524fe061cd7e3b9fcf5986 Mon Sep 17 00:00:00 2001 From: Raul Galdeano Pazos <101328916+TheWinterCoderDev@users.noreply.github.com> Date: Sun, 22 Nov 2026 21:33:27 +0100 Subject: [PATCH 02/20] chore: add development and testing dependencies --- requirements-dev.txt | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 requirements-dev.txt diff --git a/requirements-dev.txt b/requirements-dev.txt new file mode 100644 index 0000000..b7a2927 --- /dev/null +++ b/requirements-dev.txt @@ -0,0 +1,3 @@ + +-r consolidation_1_d/requirements.txt +pytest From 0cdfae41a34d25c90142692435553d2540f9faa1 Mon Sep 17 00:00:00 2001 From: Raul Galdeano Pazos <101328916+TheWinterCoderDev@users.noreply.github.com> Date: Sun, 22 Nov 2026 21:35:07 +0100 Subject: [PATCH 03/20] Create consolidation_1d.py --- .../geotechnics/consolidation_1d.py | 120 ++++++++++++++++++ 1 file changed, 120 insertions(+) create mode 100644 src/civil_engineering_toolbox/geotechnics/consolidation_1d.py diff --git a/src/civil_engineering_toolbox/geotechnics/consolidation_1d.py b/src/civil_engineering_toolbox/geotechnics/consolidation_1d.py new file mode 100644 index 0000000..20aeb16 --- /dev/null +++ b/src/civil_engineering_toolbox/geotechnics/consolidation_1d.py @@ -0,0 +1,120 @@ + +""" +MATLAB Survival Project Companion +Civil Engineering Data Analysis Toolbox + +Module: One-Dimensional Consolidation +Theory: Terzaghi's Consolidation Theory + +Author: Raul Galdeano Pazos +""" + +import numpy as np + + +def porewater_pressure(z, time_factor, n_terms=80): + """ + Compute normalized excess porewater pressure using + the Fourier-series solution of Terzaghi's 1D + consolidation equation. + + Assumptions + ----------- + - Homogeneous saturated soil. + - Constant coefficient of consolidation. + - Uniform initial excess porewater pressure. + - Double drainage, using half-layer symmetry. + + Parameters + ---------- + z : float or array_like + Normalized depth coordinate, between 0 and 1. + Zero is the drained boundary and one is + the symmetry plane. + + time_factor : float or array_like + Dimensionless time factor: + + T = cv * t / Hdr**2 + + Must be nonnegative. + + n_terms : int, optional + Number of Fourier series terms. + Default: 80. + + Returns + ------- + numpy.ndarray + Normalized excess porewater pressure W(z, T). + + Notes + ----- + The infinite series is approximated using a finite + number of terms. Numerical accuracy depends on + convergence, especially close to T = 0. + """ + + # Validate number of series terms. + if ( + isinstance(n_terms, (bool, np.bool_)) + or not isinstance(n_terms, (int, np.integer)) + or n_terms < 1 + ): + raise ValueError( + "n_terms must be a positive integer." + ) + + # Convert input parameters to numerical arrays. + z = np.asarray(z, dtype=float) + time_factor = np.asarray(time_factor, dtype=float) + + # Validate finite numerical inputs. + if not np.all(np.isfinite(z)): + raise ValueError( + "Normalized depth must contain finite values." + ) + + if not np.all(np.isfinite(time_factor)): + raise ValueError( + "Time factor must contain finite values." + ) + + # Validate the normalized depth domain. + if np.any((z < 0) | (z > 1)): + raise ValueError( + "Normalized depth must be between 0 and 1." + ) + + # Validate dimensionless time. + if np.any(time_factor < 0): + raise ValueError( + "Time factor must be nonnegative." + ) + + # Match input array dimensions. + z, time_factor = np.broadcast_arrays( + z, time_factor + ) + + # Initialize the Fourier series. + result = np.zeros_like(z, dtype=float) + + # Compute the truncated Fourier series. + for n in range(n_terms): + + k = 2 * n + 1 + + coefficient = 4.0 / (k * np.pi) + + exponential = np.exp( + -(k * np.pi) ** 2 * time_factor / 4.0 + ) + + spatial = np.sin( + k * np.pi * z / 2.0 + ) + + result += coefficient * exponential * spatial + + return result From 888d98e5052d5c80c702e8b0be732d0eb4fc2df3 Mon Sep 17 00:00:00 2001 From: Raul Galdeano Pazos <101328916+TheWinterCoderDev@users.noreply.github.com> Date: Sun, 22 Nov 2026 21:38:42 +0100 Subject: [PATCH 04/20] Create __init__.py --- src/civil_engineering_toolbox/__init__.py | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 src/civil_engineering_toolbox/__init__.py diff --git a/src/civil_engineering_toolbox/__init__.py b/src/civil_engineering_toolbox/__init__.py new file mode 100644 index 0000000..fa46bf8 --- /dev/null +++ b/src/civil_engineering_toolbox/__init__.py @@ -0,0 +1,6 @@ + +""" +Civil Engineering Data Analysis Toolbox. + +Numerical and analytical tools for civil engineering. +""" From 6c5f9a1d5ab03b932265247b85e04dd38d25e483 Mon Sep 17 00:00:00 2001 From: Raul Galdeano Pazos <101328916+TheWinterCoderDev@users.noreply.github.com> Date: Sun, 22 Nov 2026 21:39:12 +0100 Subject: [PATCH 05/20] Create __init__.py --- src/civil_engineering_toolbox/geotechnics/__init__.py | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 src/civil_engineering_toolbox/geotechnics/__init__.py diff --git a/src/civil_engineering_toolbox/geotechnics/__init__.py b/src/civil_engineering_toolbox/geotechnics/__init__.py new file mode 100644 index 0000000..bd2e360 --- /dev/null +++ b/src/civil_engineering_toolbox/geotechnics/__init__.py @@ -0,0 +1,4 @@ + +""" +Geotechnical engineering computational methods. +""" From 78f9d83238deef3ce83369859f8ce8dc70c1afb2 Mon Sep 17 00:00:00 2001 From: Raul Galdeano Pazos <101328916+TheWinterCoderDev@users.noreply.github.com> Date: Sun, 22 Nov 2026 21:39:49 +0100 Subject: [PATCH 06/20] Add Terzaghi 1D Consolidation Isochrone Generator This script generates normalized consolidation isochrones using Terzaghi's theory and visualizes the results. --- examples/consolidation_1d_example.py | 94 ++++++++++++++++++++++++++++ 1 file changed, 94 insertions(+) create mode 100644 examples/consolidation_1d_example.py diff --git a/examples/consolidation_1d_example.py b/examples/consolidation_1d_example.py new file mode 100644 index 0000000..fb92bc6 --- /dev/null +++ b/examples/consolidation_1d_example.py @@ -0,0 +1,94 @@ + +""" +Terzaghi 1D Consolidation β€” Isochrone Generator. + +Author: Raul Galdeano Pazos +Project: Civil Engineering Data Analysis Toolbox +""" + +from pathlib import Path +import sys + +import numpy as np +import matplotlib.pyplot as plt + +# Locate the repository and source package. +ROOT = Path(__file__).resolve().parents[1] +sys.path.insert(0, str(ROOT / "src")) + +from civil_engineering_toolbox.geotechnics.consolidation_1d import ( + porewater_pressure, +) + + +def main(): + """Generate normalized consolidation isochrones.""" + + # Normalized spatial discretization. + z = np.linspace(0.0, 1.0, 200) + + # Dimensionless time factors. + time_factors = [ + 0.01, 0.02, 0.05, 0.1, + 0.2, 0.5, 1.0, 2.0 + ] + + # Initialize visualization. + fig, ax = plt.subplots(figsize=(9, 7)) + + for time_factor in time_factors: + + pressure = porewater_pressure( + z=z, + time_factor=time_factor, + n_terms=80 + ) + + ax.plot( + pressure, + 1.0 - z, + linewidth=2, + label=f"T = {time_factor:g}" + ) + + # Scientific plot formatting. + ax.set_xlabel( + "Normalized excess porewater pressure (W)" + ) + + ax.set_ylabel("Normalized coordinate (1 - Z)") + + ax.set_title( + "Terzaghi 1D Consolidation β€” Isochrones" + ) + + ax.set_xlim(left=0) + ax.set_ylim(0, 1) + + ax.grid(True, alpha=0.3) + ax.legend(loc="best") + + fig.tight_layout() + + # Create output directory if necessary. + output_dir = ROOT / "outputs" + output_dir.mkdir(exist_ok=True) + + output_path = ( + output_dir / "terzaghi_1d_isochrones.png" + ) + + # Save the figure before displaying it. + fig.savefig( + output_path, + dpi=300, + bbox_inches="tight" + ) + + print(f"Figure saved to: {output_path}") + + plt.show() + + +if __name__ == "__main__": + main() From 9964c7efb6ce2ce4bacf187243393c4fd6f31207 Mon Sep 17 00:00:00 2001 From: Raul Galdeano Pazos <101328916+TheWinterCoderDev@users.noreply.github.com> Date: Sun, 22 Nov 2026 21:44:04 +0100 Subject: [PATCH 07/20] Add .gitignore for Python and IDE files --- .gitignore | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ca61b33 --- /dev/null +++ b/.gitignore @@ -0,0 +1,24 @@ + +# Python bytecode +__pycache__/ +*.py[cod] + +# Virtual environments +.venv/ +venv/ + +# Python testing +.pytest_cache/ +.coverage +htmlcov/ + +# Generated output files +outputs/ + +# IDE files +.vscode/ +.idea/ + +# OS files +.DS_Store +Thumbs.db From 4281b1a67a76e0000e476bc1751723f8d53fdd23 Mon Sep 17 00:00:00 2001 From: Raul Galdeano Pazos <101328916+TheWinterCoderDev@users.noreply.github.com> Date: Tue, 24 Nov 2026 21:42:43 +0100 Subject: [PATCH 08/20] fix: correct Python dependency requirements --- consolidation_1_d/requirements.txt | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/consolidation_1_d/requirements.txt b/consolidation_1_d/requirements.txt index 1c083e6..806f221 100644 --- a/consolidation_1_d/requirements.txt +++ b/consolidation_1_d/requirements.txt @@ -1,5 +1,2 @@ -Necessary packages: - -This file contains and suggests the necessary packages to run the profiler: - - Numpy - - Matplotlib +numpy +matplotlib \ No newline at end of file From ec1bd62378421c54b1adabce07b6d77cfb9f479d Mon Sep 17 00:00:00 2001 From: Raul Galdeano Pazos <101328916+TheWinterCoderDev@users.noreply.github.com> Date: Tue, 24 Nov 2026 21:45:16 +0100 Subject: [PATCH 09/20] Create conftest.py for pytest configuration Add shared pytest configuration for the toolbox. --- tests/conftest.py | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 tests/conftest.py diff --git a/tests/conftest.py b/tests/conftest.py new file mode 100644 index 0000000..7d6bcd9 --- /dev/null +++ b/tests/conftest.py @@ -0,0 +1,10 @@ + +"""Shared pytest configuration for the toolbox.""" + +from pathlib import Path +import sys + +ROOT = Path(__file__).resolve().parents[1] +SRC = ROOT / "src" + +sys.path.insert(0, str(SRC)) From 4ebfa70c83c3280779ea0e3db791ededa5aee52f Mon Sep 17 00:00:00 2001 From: Raul Galdeano Pazos <101328916+TheWinterCoderDev@users.noreply.github.com> Date: Tue, 24 Nov 2026 21:45:55 +0100 Subject: [PATCH 10/20] Add unit tests for 1D consolidation solver This file contains unit tests for the 1D consolidation solver, covering various scenarios including boundary conditions, pressure behavior over time, and input validation. --- tests/test_consolidation_1d.py | 95 ++++++++++++++++++++++++++++++++++ 1 file changed, 95 insertions(+) create mode 100644 tests/test_consolidation_1d.py diff --git a/tests/test_consolidation_1d.py b/tests/test_consolidation_1d.py new file mode 100644 index 0000000..ab32fd8 --- /dev/null +++ b/tests/test_consolidation_1d.py @@ -0,0 +1,95 @@ + +"""Tests for Terzaghi's 1D consolidation solver.""" + +import numpy as np +import pytest + +from civil_engineering_toolbox.geotechnics.consolidation_1d import ( + porewater_pressure, +) + + +def test_drained_boundary(): + """Excess pressure must vanish at the drained boundary.""" + + times = np.array([0.0, 0.1, 0.5, 1.0]) + result = porewater_pressure(0.0, times) + + np.testing.assert_allclose( + result, np.zeros(4), atol=1e-12 + ) + + +def test_pressure_decreases_with_time(): + """Excess pressure decreases during consolidation.""" + + values = [ + float(porewater_pressure(0.5, t)) + for t in [0.05, 0.2, 0.5] + ] + + assert values[0] > values[1] > values[2] > 0 + + +def test_long_time_approximation(): + """At large times, the first Fourier term dominates.""" + + z = 0.5 + t = 2.0 + + expected = ( + 4 / np.pi + * np.exp(-np.pi**2 * t / 4) + * np.sin(np.pi * z / 2) + ) + + actual = porewater_pressure(z, t) + + assert actual == pytest.approx( + expected, rel=1e-10 + ) + + +def test_vectorized_depth(): + """Solver must support multiple spatial positions.""" + + z = np.linspace(0.0, 1.0, 25) + + result = porewater_pressure(z, 0.1) + + assert result.shape == z.shape + assert np.all(np.isfinite(result)) + + +def test_invalid_depth(): + """Depth must remain in the normalized domain.""" + + with pytest.raises(ValueError): + porewater_pressure(-0.1, 0.1) + + with pytest.raises(ValueError): + porewater_pressure(1.2, 0.1) + + +def test_negative_time(): + """Negative time factors are not physically admissible.""" + + with pytest.raises(ValueError): + porewater_pressure(0.5, -0.1) + + +def test_invalid_series_terms(): + """The number of Fourier terms must be positive.""" + + with pytest.raises(ValueError): + porewater_pressure(0.5, 0.1, n_terms=0) + + +def test_nonfinite_inputs(): + """NaN and infinite input values must be rejected.""" + + with pytest.raises(ValueError): + porewater_pressure(np.nan, 0.1) + + with pytest.raises(ValueError): + porewater_pressure(0.5, np.inf) From e2f6afdb34cb532f40274f89b68cef0c146d4144 Mon Sep 17 00:00:00 2001 From: Raul Galdeano Pazos <101328916+TheWinterCoderDev@users.noreply.github.com> Date: Tue, 24 Nov 2026 21:53:50 +0100 Subject: [PATCH 11/20] Create python-ci.yml --- .github/workflows/python-ci.yml | 43 +++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 .github/workflows/python-ci.yml diff --git a/.github/workflows/python-ci.yml b/.github/workflows/python-ci.yml new file mode 100644 index 0000000..975777d --- /dev/null +++ b/.github/workflows/python-ci.yml @@ -0,0 +1,43 @@ + +name: Python CI + +on: + push: + branches: + - main + - 'refactor/**' + - 'release/**' + + pull_request: + branches: + - main + + workflow_dispatch: + +permissions: + contents: read + +jobs: + numerical-validation: + name: Terzaghi 1D Consolidation Tests + runs-on: ubuntu-latest + timeout-minutes: 15 + + steps: + - name: Checkout repository + uses: actions/checkout@v6 + with: + persist-credentials: false + + - name: Set up Python + uses: actions/setup-python@v7 + with: + python-version: '3.13' + + - name: Install dependencies + run: | + python -m pip install -r requirements-dev.txt + + - name: Run tests + run: | + python -m pytest tests/ -v From 3b2c249a9c947f88e42726d02abcf7767ab390a4 Mon Sep 17 00:00:00 2001 From: Raul Galdeano Pazos <101328916+TheWinterCoderDev@users.noreply.github.com> Date: Tue, 24 Nov 2026 22:03:19 +0100 Subject: [PATCH 12/20] Revise README for clarity and organization Updated the README to enhance project clarity and structure, including new sections on project objectives, available modules, and contribution guidelines. --- README.md | 331 ++++++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 299 insertions(+), 32 deletions(-) diff --git a/README.md b/README.md index 11fedd6..751e839 100644 --- a/README.md +++ b/README.md @@ -1,47 +1,314 @@ -# Data-Analysis-Toolbox-for-Civil-Engineers -Welcome Wanderer! Read very carefully the following points to understand what this repository is about. +# πŸ—οΈ Civil Engineering Data Analysis Toolbox -# 🌍 Overview -This repository serves as a growing collection of Python-based data analysis tools tailored for civil engineers. -Its mission is to help professionals and students strengthen their programming skills and apply data-driven methods to solve real-world engineering problems. +### Open-Source Computational Tools for Civil Engineers -# 🎯 Purpose -Civil engineering is becoming increasingly digital, and mastering data analysis is key to designing smarter, safer, and more sustainable infrastructure. -This repository aims to: +**Engineering Β· Python Β· Data Science Β· Numerical Modelling** -- Provide ready-to-use scripts and notebooks for civil engineering applications. +![Python](https://img.shields.io/badge/Python-3.13-3776AB?style=flat-square&logo=python&logoColor=white) +![License](https://img.shields.io/badge/License-GPLv3-blue?style=flat-square) +![Status](https://img.shields.io/badge/Status-Active_Development-orange?style=flat-square) -- Share examples and workflows in data visualization, geospatial analysis, and numerical modeling. +[![Python CI](https://github.com/TheWinterCoderDev/Data-Analysis-Toolbox-for-Civil-Engineers/actions/workflows/python-ci.yml/badge.svg?branch=refactor%2Fconsolidation-modernization)](https://github.com/TheWinterCoderDev/Data-Analysis-Toolbox-for-Civil-Engineers/actions/workflows/python-ci.yml) -- Encourage engineers to learn, adapt, and contribute to open-source solutions for infrastructure challenges. +--- -# 🧠 Learning Objectives -By exploring this repository, you will learn to: +## 🌍 About the Project -- Use Python for data cleaning, analysis, and visualization. +Civil Engineering Data Analysis Toolbox is an open-source +collection of Python-based computational tools designed +for civil engineers, researchers and engineering students. -- Handle engineering datasets (structural, hydrological, transportation, etc.). +The project aims to bridge traditional engineering +knowledge with modern programming, numerical methods, +scientific computing and data-driven technologies. -- Apply NumPy, Pandas, Matplotlib, and GIS tools to analyze and communicate results effectively. +Its purpose is simple: -- Develop automation pipelines to improve productivity in research and projects. +**To make practical computational engineering tools +accessible to engineers around the world.** -# πŸ—οΈ Repository Structure +The repository is designed as a growing, multidisciplinary +library in which each engineering specialization can +contribute algorithms, scripts, examples and documentation. +--- + +## 🎯 Project Objectives + +- Develop reusable Python tools for civil engineering. +- Provide accessible implementations of engineering models. +- Promote computational thinking in engineering education. +- Support data analysis, visualization and automation. +- Encourage reproducible engineering research. +- Share engineering knowledge through open-source software. +- Build a collaborative international engineering community. + +--- + +## πŸ—οΈ Engineering Disciplines + +The long-term development roadmap includes the following +engineering domains. + +| Discipline | Planned Applications | Status | +|---|---|---| +| Geotechnical Engineering | Consolidation, soil mechanics, foundations | Active | +| Structural Engineering | Structural analysis, matrix methods, FEM | Planned | +| Transportation Engineering | Railway systems, networks, mobility | Planned | +| Hydraulics & Hydrology | Flow analysis, hydraulic models | Planned | +| Geospatial Engineering | GIS, spatial analysis, terrain modelling | Planned | +| Data & Automation | Engineering analytics and workflow automation | Planned | + +Each discipline will be developed incrementally through +independently documented modules. + +--- + +## πŸ”¬ Available Modules + +### 01 β€” Geotechnical Engineering + +#### Terzaghi 1D Consolidation + +The first modernized module implements the classical +Fourier-series solution of Terzaghi's one-dimensional +consolidation equation. + +It provides: + +- Normalized excess porewater pressure calculations. +- Consolidation profiles for different time factors. +- Isochrone visualization using Matplotlib. +- Numerical input validation. +- Vectorized calculations using NumPy. +- Automated unit tests using pytest. + +**Technology:** Python, NumPy, Matplotlib, pytest. + +**Source code:** +[src/civil_engineering_toolbox/geotechnics/](src/civil_engineering_toolbox/geotechnics/) + +**Example:** +[Terzaghi Isochrone Generator](examples/consolidation_1d_example.py) + +**Original academic implementation:** +[Legacy Consolidation Script](consolidation_1_d/) + +--- + +## πŸš€ Getting Started + +### Requirements + +- Python 3.13 +- NumPy +- Matplotlib + +### Installation + +Clone the repository: + +```bash +git clone https://github.com/TheWinterCoderDev/Data-Analysis-Toolbox-for-Civil-Engineers.git + +cd Data-Analysis-Toolbox-for-Civil-Engineers +``` + +Create a virtual environment: + +```bash +python -m venv .venv +``` + +Install the dependencies: + +```bash +.venv/Scripts/python.exe -m pip install -r requirements-dev.txt +``` + +The commands above use the Windows virtual environment +layout. On Linux and macOS, use the Python interpreter +inside `.venv/bin/` instead. + +### Running the Consolidation Example + +On Windows: + +```bash +.venv/Scripts/python.exe examples/consolidation_1d_example.py +``` + +The example generates normalized consolidation +isochrones and saves the resulting figure under: + +```text +outputs/terzaghi_1d_isochrones.png +``` + +--- + +## πŸ§ͺ Testing & Quality Assurance + +The repository uses pytest for automated numerical +verification. + +Run the test suite: + +```bash +.venv/Scripts/python.exe -m pytest -v +``` + +The current test suite includes eight tests covering: + +- Drained boundary conditions. +- Pressure dissipation with time. +- Long-time analytical approximation. +- Vectorized spatial calculations. +- Invalid depth values. +- Negative time factors. +- Invalid Fourier-series parameters. +- Non-finite numerical inputs. + +GitHub Actions runs these tests automatically on +configured branches and pull requests. + +Passing tests demonstrate correctness for the tested +cases, not exhaustive numerical or engineering validation. + +--- + +## πŸ—‚οΈ Repository Organization + +```text Data-Analysis-Toolbox-for-Civil-Engineers/ β”‚ -β”œβ”€β”€ πŸ“‚ data/ β†’ Example datasets -β”œβ”€β”€ πŸ“‚ notebooks/ β†’ Jupyter notebooks with tutorials -β”œβ”€β”€ πŸ“‚ scripts/ β†’ Python scripts for analysis -β”œβ”€β”€ πŸ“‚ docs/ β†’ Technical notes -└── README.md β†’ Project overview - -# 🀝 Contributions -Contributions are highly welcome! -Whether you want to fix bugs, optimize code, or share your own tool or dataset, feel free to submit a pull request or open an issue. - -# 🧩 Author -RaΓΊl Galdeano Pazos -Civil Engineer | Data & AI for Sustainable Infrastructure -πŸ”— LinkedIn – RaΓΊl Galdeano Pazos +β”œβ”€β”€ .github/ +β”‚ └── workflows/ +β”‚ └── python-ci.yml +β”‚ +β”œβ”€β”€ consolidation_1_d/ +β”‚ └── Original academic implementation +β”‚ +β”œβ”€β”€ src/ +β”‚ └── civil_engineering_toolbox/ +β”‚ └── geotechnics/ +β”‚ └── consolidation_1d.py +β”‚ +β”œβ”€β”€ examples/ +β”‚ └── consolidation_1d_example.py +β”‚ +β”œβ”€β”€ tests/ +β”‚ β”œβ”€β”€ conftest.py +β”‚ └── test_consolidation_1d.py +β”‚ +β”œβ”€β”€ requirements-dev.txt +β”œβ”€β”€ README.md +└── LICENSE +``` + +The directory structure will expand as new engineering +modules are developed. + +--- + +## πŸ›£οΈ Development Roadmap + +### Phase I β€” Geotechnical Foundations + +- [x] Implement Terzaghi 1D consolidation. +- [x] Add reproducible isochrone generation. +- [x] Implement automated numerical tests. +- [x] Configure continuous integration. +- [ ] Expand numerical validation. +- [ ] Complete technical documentation. +- [ ] Publish the first modernized release. + +### Phase II β€” Structural Engineering + +- [ ] Introduce basic structural analysis algorithms. +- [ ] Develop matrix-based structural methods. +- [ ] Provide reproducible engineering examples. + +### Phase III β€” Transportation Engineering + +- [ ] Railway infrastructure analytics. +- [ ] Transportation network calculations. +- [ ] Mobility and infrastructure data analysis. + +### Phase IV β€” Engineering Data & GIS + +- [ ] Engineering data processing utilities. +- [ ] Geospatial analysis tools. +- [ ] Data visualization and automation examples. + +Future modules will be prioritized according to +engineering relevance, maintainability and available +validation resources. + +--- + +## 🀝 Contributing + +Contributions from engineers, students and researchers +around the world are welcome. + +You can contribute by: + +- Reporting bugs or numerical inaccuracies. +- Proposing new engineering utilities. +- Improving documentation. +- Adding reproducible examples. +- Improving testing and numerical validation. + +Please open a GitHub Issue to discuss substantial +new features before submitting a Pull Request. + +All contributions must respect the project's license +and must not include confidential or proprietary +engineering information. + +--- + +## ⚠️ Engineering Disclaimer + +This project is intended for educational and research +purposes. + +The software is not certified for professional, +industrial or safety-critical engineering applications. + +Engineering calculations and numerical results must +be independently verified before use in real projects. + +Users remain responsible for complying with applicable +engineering standards, regulations and professional +requirements. + +--- + +## πŸ“œ License + +This project is distributed under the GNU General +Public License v3.0. + +See the [LICENSE](LICENSE) file for details. + +--- + +## πŸ‘¨β€πŸ’» Author + +**RaΓΊl Galdeano Pazos β€” The Winter Coder** + +Civil Engineering | Computational Engineering | +Data & Automation | Transportation Systems + +[LinkedIn](https://www.linkedin.com/in/raulgaldeanopazos/) + +--- + +### Engineering knowledge should be shared. + +*Building practical tools for engineers, one script at a time.* + +**Ad Victoriam! ❄️** From 0cabb1e071bbe14a1239b6050bcf115db0d7dad4 Mon Sep 17 00:00:00 2001 From: Raul Galdeano Pazos <101328916+TheWinterCoderDev@users.noreply.github.com> Date: Tue, 24 Nov 2026 22:06:15 +0100 Subject: [PATCH 13/20] Update toolbox title in README Removed 'Data Analysis' from the toolbox title. --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index 751e839..45805fd 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,4 @@ - -# πŸ—οΈ Civil Engineering Data Analysis Toolbox +# πŸ—οΈ Civil Engineering Toolbox ### Open-Source Computational Tools for Civil Engineers From d6e2d5c73ab18653e948807b80d1db4984b7bab8 Mon Sep 17 00:00:00 2001 From: Raul Galdeano Pazos <101328916+TheWinterCoderDev@users.noreply.github.com> Date: Tue, 24 Nov 2026 22:06:54 +0100 Subject: [PATCH 14/20] Update CI badge link in README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 45805fd..239f7ae 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ ![License](https://img.shields.io/badge/License-GPLv3-blue?style=flat-square) ![Status](https://img.shields.io/badge/Status-Active_Development-orange?style=flat-square) -[![Python CI](https://github.com/TheWinterCoderDev/Data-Analysis-Toolbox-for-Civil-Engineers/actions/workflows/python-ci.yml/badge.svg?branch=refactor%2Fconsolidation-modernization)](https://github.com/TheWinterCoderDev/Data-Analysis-Toolbox-for-Civil-Engineers/actions/workflows/python-ci.yml) +[![Python CI](https://github.com/TheWinterCoderDev/Civil-Engineering-Toolbox/actions/workflows/python-ci.yml/badge.svg?branch=refactor%2Fconsolidation-modernization)](https://github.com/TheWinterCoderDev/Civil-Engineering-Toolbox/actions/workflows/python-ci.yml) --- From 6a2f3edf0a14f62a0156a3c4526322cdaa3657bf Mon Sep 17 00:00:00 2001 From: Raul Galdeano Pazos <101328916+TheWinterCoderDev@users.noreply.github.com> Date: Tue, 24 Nov 2026 22:10:46 +0100 Subject: [PATCH 15/20] Add documentation for Terzaghi 1D consolidation module This document provides an overview of the Terzaghi 1D consolidation module, including its capabilities, governing equations, assumptions, implementation details, and potential applications. --- docs/consolidation_1d.md Copiar | 428 ++++++++++++++++++++++++++++++ 1 file changed, 428 insertions(+) create mode 100644 docs/consolidation_1d.md Copiar diff --git a/docs/consolidation_1d.md Copiar b/docs/consolidation_1d.md Copiar new file mode 100644 index 0000000..82ba7de --- /dev/null +++ b/docs/consolidation_1d.md Copiar @@ -0,0 +1,428 @@ + +# Geotechnical Engineering β€” Terzaghi 1D Consolidation + +**Module:** Geotechnical Engineering +**Project:** Civil Engineering Toolbox +**Author:** RaΓΊl Galdeano Pazos +**Language:** Python +**Status:** Educational implementation + +--- + +## 1. Overview + +This module implements an analytical Fourier-series +solution to Terzaghi's classical one-dimensional +consolidation equation. + +Its primary purpose is to compute and visualize the +dissipation of normalized excess porewater pressure +within a saturated soil layer. + +The module provides reusable numerical calculations +and reproducible consolidation isochrones. + +### Main capabilities + +- Compute normalized excess porewater pressure. +- Evaluate consolidation at different time factors. +- Generate consolidation isochrones. +- Support vectorized numerical calculations. +- Validate input parameters. +- Perform automated numerical tests. + +--- + +## 2. Physical Background + +Consolidation is the time-dependent process through +which saturated soil undergoes volume reduction +as excess porewater pressure dissipates. + +Under Terzaghi's classical model, an applied load +initially generates excess porewater pressure. + +As drainage occurs, this pressure gradually decreases +and effective stress increases. + +The model describes the evolution of excess porewater +pressure as a function of depth and time. + +--- + +## 3. Governing Differential Equation + +Terzaghi's one-dimensional consolidation equation is: + +$$ +\frac{\partial u}{\partial t} += +c_v\frac{\partial^2 u}{\partial z^2} +$$ + +Where: + +- $u$: excess porewater pressure [Pa]. +- $t$: elapsed time [s]. +- $z$: spatial coordinate [m]. +- $c_v$: coefficient of consolidation [mΒ²/s]. + +The coefficient of consolidation describes the rate +at which the consolidation process develops. + +--- + +## 4. Model Assumptions + +The analytical solution implemented in this module +is based on the following idealizations: + +1. Soil is fully saturated. +2. Soil is homogeneous. +3. Soil properties remain constant. +4. Flow is one-dimensional. +5. Soil deformation is one-dimensional. +6. Darcy's law is applicable. +7. The coefficient of consolidation is constant. +8. Initial excess porewater pressure is uniform. +9. Drainage boundaries are idealized. +10. Secondary compression is not represented. + +These assumptions limit the applicability of the +model to more complex field conditions. + +--- + +## 5. Dimensionless Variables + +The model uses normalized variables to facilitate +comparison between different consolidation problems. + +### Normalized depth + +$$ +Z=\frac{z}{H_{dr}} +$$ + +Where $H_{dr}$ is the maximum drainage path length. + +The implemented domain is: + +$$ +0\leq Z\leq1 +$$ + +The coordinate convention is: + +- $Z=0$: drained boundary. +- $Z=1$: symmetry plane or impermeable boundary. + +For a uniformly loaded, doubly drained layer, +the solution represents one half of the layer +using symmetry. + +### Time factor + +$$ +T_v=\frac{c_v t}{H_{dr}^2} +$$ + +Where: + +- $T_v$: dimensionless time factor. +- $c_v$: coefficient of consolidation [mΒ²/s]. +- $t$: elapsed time [s]. +- $H_{dr}$: maximum drainage path [m]. + +### Normalized excess porewater pressure + +$$ +W(Z,T_v)=\frac{u(Z,t)}{u_0} +$$ + +Where $u_0$ is the initially uniform excess +porewater pressure. + +The computational output is dimensionless. + +--- + +## 6. Boundary and Initial Conditions + +The model assumes the following conditions. + +### Drained boundary + +$$ +W(0,T_v)=0 +$$ + +The excess porewater pressure is zero at the +drainage boundary. + +### Symmetry boundary + +$$ +\frac{\partial W}{\partial Z}(1,T_v)=0 +$$ + +No hydraulic gradient occurs across the +symmetry plane. + +### Initial condition + +$$ +W(Z,0)=1 +\qquad 0 Date: Tue, 24 Nov 2026 22:11:38 +0100 Subject: [PATCH 16/20] Create CHANGELOG.md --- CHANGELOG.md | 69 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 CHANGELOG.md diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..5c50b69 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,69 @@ + +# Changelog + +All notable changes to Civil Engineering Toolbox +will be documented in this file. + +This project follows Semantic Versioning principles. + +## [0.1.0] - Unreleased + +### Added + +- Initial modular Python package architecture. +- Geotechnical Engineering module. +- Terzaghi one-dimensional consolidation solver. +- Fourier-series approximation of normalized + excess porewater pressure. +- Input validation and numerical error handling. +- NumPy-based vectorized calculations. +- Reproducible consolidation isochrone generator. +- Eight automated unit tests using pytest. +- Continuous integration with GitHub Actions. +- Scientific documentation for the consolidation model. +- Development dependency configuration. + +### Changed + +- Updated project identity to Civil Engineering Toolbox. +- Redesigned README around a multidisciplinary vision. +- Separated numerical calculations from visualization. +- Improved code organization and maintainability. +- Introduced consistent naming conventions. + +### Preserved + +- Original academic consolidation implementation. +- Original project history and engineering objectives. + +### Known Limitations + +- Only the geotechnical consolidation module is available. +- Fourier-series convergence depends on the number + of retained terms. +- No comprehensive numerical error assessment. +- No advanced constitutive soil models. +- Not certified for safety-critical engineering use. + +## Planned Development + +### v0.2.0 β€” Geotechnical Utilities + +Potential additions: + +- Average degree of consolidation. +- Physical time conversion. +- Settlement calculations. +- Additional numerical validation. + +### Future Modules + +- Structural Engineering. +- Transportation Engineering. +- Hydraulics and Hydrology. +- Geospatial Engineering. +- Engineering Data Analytics. +- Computational Automation. + +Development priorities may change according to +technical validation and community contributions. From d85f4f82bb371984e4997e7c35a8de78b1924bef Mon Sep 17 00:00:00 2001 From: Raul Galdeano Pazos <101328916+TheWinterCoderDev@users.noreply.github.com> Date: Tue, 24 Nov 2026 22:12:12 +0100 Subject: [PATCH 17/20] Create CONTRIBUTING.md with contribution guidelines Added a comprehensive contributing guide for the project, outlining ways to contribute, development workflow, code quality standards, testing procedures, and community standards. --- CONTRIBUTING.md | 179 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 179 insertions(+) create mode 100644 CONTRIBUTING.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..999eb5c --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,179 @@ + +# Contributing to Civil Engineering Toolbox + +Thank you for your interest in contributing! + +Civil Engineering Toolbox is an open-source initiative +dedicated to developing accessible computational +tools for civil engineers, researchers and students. + +Contributions from the international engineering +community are welcome. + +## 1. Ways to Contribute + +You can help by: + +- Developing new engineering algorithms. +- Reporting bugs and numerical inaccuracies. +- Improving existing functions. +- Writing technical documentation. +- Adding reproducible engineering examples. +- Expanding automated test coverage. +- Reviewing engineering assumptions and calculations. + +## 2. Engineering Disciplines + +Contributions may cover: + +- Geotechnical Engineering. +- Structural Engineering. +- Transportation Engineering. +- Hydraulics and Hydrology. +- Geospatial Engineering. +- Engineering Data Analytics. +- Computational and Numerical Methods. + +New disciplines may be introduced when justified +by the scope and maturity of the project. + +## 3. Before Contributing + +Please check existing Issues and Pull Requests. + +For substantial features, open a GitHub Issue +describing the proposed functionality before +starting development. + +Your proposal should explain: + +1. Engineering problem being addressed. +2. Intended users and applications. +3. Mathematical or physical formulation. +4. Required inputs and expected outputs. +5. Relevant engineering references. +6. Proposed validation methodology. + +## 4. Development Workflow + +1. Fork the repository. +2. Create a descriptive feature branch. +3. Implement your changes. +4. Add or update unit tests. +5. Document assumptions and limitations. +6. Run the test suite locally. +7. Submit a Pull Request. + +Example branch names: + +- feat/structural-beam-analysis +- feat/geotechnical-settlement +- fix/consolidation-validation +- docs/hydraulic-methods + +## 5. Code Quality + +Python contributions should follow PEP 8 +where practical. + +Functions should include: + +- Descriptive names. +- Type annotations where appropriate. +- Clear docstrings. +- Defined input and output units. +- Meaningful exceptions. +- Reproducible examples. + +Avoid unnecessary dependencies. + +## 6. Engineering Validation + +Every new engineering algorithm should include: + +- Mathematical or physical assumptions. +- Governing equations. +- References to established sources. +- Valid input domains. +- Numerical limitations. +- Automated tests. +- Independent reference comparisons + whenever practical. + +A successful test run does not automatically +establish engineering validity. + +## 7. Testing + +Install the development dependencies: + +```bash +python -m pip install -r requirements-dev.txt +``` + +Run the test suite: + +```bash +python -m pytest -v +``` + +All existing tests should pass before submitting +a Pull Request. + +## 8. Documentation + +Scientific modules should include documentation +covering: + +- Engineering background. +- Mathematical formulation. +- Model assumptions. +- Units and parameter definitions. +- Usage examples. +- Numerical verification. +- Known limitations. +- Engineering references. + +## 9. Licensing and Intellectual Property + +Contributions must be compatible with the +GNU General Public License v3.0. + +Contributors must have the right to submit +their code and supporting materials. + +Do not submit proprietary source code, +confidential engineering information, +restricted datasets or third-party materials +without appropriate authorization. + +## 10. Community Standards + +Please communicate respectfully and constructively. + +Technical disagreements should focus on evidence, +engineering reasoning and reproducible results. + +Harassment, discrimination and personal attacks +are not acceptable. + +## 11. Pull Request Checklist + +- [ ] My contribution addresses a defined problem. +- [ ] I have documented engineering assumptions. +- [ ] I have added or updated tests. +- [ ] All tests pass locally. +- [ ] I have updated relevant documentation. +- [ ] I have reviewed license compatibility. +- [ ] I have not included confidential information. + +Thank you for helping make engineering knowledge +more accessible. + +--- + +Civil Engineering Toolbox + +Engineering knowledge should be shared. + +Ad Victoriam! From 61ceda8dc9cbca4fbd619a17e457ced403136bb4 Mon Sep 17 00:00:00 2001 From: Raul Galdeano Pazos <101328916+TheWinterCoderDev@users.noreply.github.com> Date: Tue, 24 Nov 2026 22:12:42 +0100 Subject: [PATCH 18/20] Create SECURITY.md for security policy and guidelines Added a security policy document outlining supported versions, vulnerability reporting, and disclaimers. --- SECURITY.md | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 SECURITY.md diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 0000000..66447a5 --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,52 @@ + +# Security Policy + +## Supported Versions + +Civil Engineering Toolbox is an independently +maintained educational open-source project. + +Security maintenance is provided on a +best-effort basis. + +| Version | Supported | +|---|---| +| Latest published release | Yes | +| Legacy implementations | No | + +## Reporting Vulnerabilities + +Please use GitHub Private Vulnerability Reporting +to disclose security vulnerabilities. + +Do not publish sensitive security information +through public GitHub Issues. + +If private vulnerability reporting is unavailable, +please avoid publicly sharing exploit details. + +## Numerical Correctness + +Numerical errors, incorrect engineering assumptions +and reproducibility problems should normally be +reported through GitHub Issues. + +Security-sensitive issues should be disclosed privately. + +## Engineering Disclaimer + +This toolbox is intended for educational and +research purposes. + +It is not certified for industrial, construction, +structural or safety-critical engineering use. + +Results must be independently validated before +application to real engineering projects. + +## Maintenance + +Reports are reviewed on a best-effort basis. + +No guaranteed response time or remediation +schedule is provided. From fa8b89e8e92e43f9517fb65e9f6bb39e79775e84 Mon Sep 17 00:00:00 2001 From: Raul Galdeano Pazos <101328916+TheWinterCoderDev@users.noreply.github.com> Date: Tue, 24 Nov 2026 22:14:37 +0100 Subject: [PATCH 19/20] Add test_reference_pressure_value function Add test for verifying reference pressure value of Fourier solution. --- tests/test_consolidation_1d.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/tests/test_consolidation_1d.py b/tests/test_consolidation_1d.py index ab32fd8..cba067e 100644 --- a/tests/test_consolidation_1d.py +++ b/tests/test_consolidation_1d.py @@ -93,3 +93,21 @@ def test_nonfinite_inputs(): with pytest.raises(ValueError): porewater_pressure(0.5, np.inf) + +def test_reference_pressure_value(): + """Verify a reference value of the Fourier solution.""" + + actual = porewater_pressure( + z=0.5, + time_factor=0.1, + n_terms=80, + ) + + expected = 0.73565131524419 + + assert float(actual) == pytest.approx( + expected, + rel=1e-10, + abs=1e-12, + ) + From 5ad36908ca0435b98ee23eed29956749238b6c7b Mon Sep 17 00:00:00 2001 From: Raul Galdeano Pazos <101328916+TheWinterCoderDev@users.noreply.github.com> Date: Tue, 24 Nov 2026 22:16:49 +0100 Subject: [PATCH 20/20] Update release date for version 0.1.0 --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5c50b69..209b964 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,7 @@ will be documented in this file. This project follows Semantic Versioning principles. -## [0.1.0] - Unreleased +## [0.1.0] - 2026-11-24 ### Added