Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
12 changes: 4 additions & 8 deletions .github/workflows/build-and-deploy-docs.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,24 @@
---
# Simple workflow for deploying static content to GitHub Pages
name: Deploy static content to Pages

on:
# Runs on pushes targeting the default branch
push:
branches: ["main"]

branches: [main]
pull_request:

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
id-token: write
pages: write
contents: read

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
group: pages
cancel-in-progress: false

jobs:
build_docs_and_deploy:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -54,7 +50,7 @@ jobs:
uses: actions/upload-pages-artifact@v3
with:
# Upload entire repository
path: "./docs/build/html"
path: ./docs/build/html
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
11 changes: 4 additions & 7 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,20 @@
---
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: Python package

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

branches: [main]
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]

python-version: ["3.10", "3.11", "3.12", "3.13"]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
Expand Down
8 changes: 2 additions & 6 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,26 @@
---
# This workflow will upload a Python Package using Twine when a release is created
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

name: Upload Python Package

on:
release:
types: [published]

permissions:
contents: read

jobs:
deploy:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: "3.x"
python-version: 3.x
- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand Down
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/).

## [Unreleased]

## [0.6.3] - 2025-08-17
## [0.6.3] - 2025-10-15

### Added

Expand All @@ -19,6 +19,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/).
- Updated docstrings throughout the codebase
- Auto-formatted code for consistency
- Migrated from setup.cfg to pyproject.toml
- Removed 760m/s boundary on mu estimation formula when generating G/Gmax
curve parameters for the hybrid hyperbolic model

### Removed

Expand Down
26 changes: 11 additions & 15 deletions PySeismoSoil/helper_hh_calibration.py
Original file line number Diff line number Diff line change
Expand Up @@ -476,21 +476,17 @@ def produce_HH_G_param(

mu = np.zeros_like(OCR)
for j in range(n_layer):
if Vs[j] <= 760: # softer soil: use Vardanega & Bolton (2011) CGJ formula
mu[j] = 1.0 / (
0.000872 * Gmax[j] / Tmax[j] * OCR[j] ** 0.47 * p0[j] ** 0.28
) # noqa: E226
if mu[j] <= 0.02: # mu too small --> too low tau_FKZ --> sharply decreasing tau_HH
# 0.236 is the standard error suggested in Vardanega & Bolton (2011)
mu[j] = mu[j] * 10.0 ** (0.236 * 3)
elif mu[j] <= 0.03:
mu[j] = mu[j] * 10.0 ** (0.236 * 2)
elif mu[j] <= 0.04:
mu[j] = mu[j] * 10.0 ** (0.236 * 1)
# END IF
else: # stiffer soils: set mu to 1 for lack of better information
mu[j] = 1.0
# END IF
# softer soil: use Vardanega & Bolton (2011) CGJ formula
mu[j] = 1.0 / (
0.000872 * Gmax[j] / Tmax[j] * OCR[j] ** 0.47 * p0[j] ** 0.28
) # noqa: E226
if mu[j] <= 0.02: # mu too small --> too low tau_FKZ --> sharply decreasing tau_HH
# 0.236 is the standard error suggested in Vardanega & Bolton (2011)
mu[j] = mu[j] * 10.0 ** (0.236 * 3)
elif mu[j] <= 0.03:
mu[j] = mu[j] * 10.0 ** (0.236 * 2)
elif mu[j] <= 0.04:
mu[j] = mu[j] * 10.0 ** (0.236 * 1)
# END FOR

# ========== Start FKZ optimization =======================================
Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ If you already have an older version installed and want to upgrade to the newest

PySeismoSoil currently support these Python versions:

- 3.9
- 3.10
- 3.11
- 3.12
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ classifiers = [
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
]
requires-python = ">=3.9"
requires-python = ">=3.10"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a place in README.md that says "requires python ≥ 3.9". Can you update that place too?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed the line that said "3.9" under the section for "Supported Python versions", so it just shows 3.10 to 3.13

dependencies = [
"matplotlib>=2.0.0",
"numba>=0.38.0",
Expand Down
6 changes: 3 additions & 3 deletions tests/files/HH_G_FKSH14.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
0.00076244 0.00139754 0.000110308 0.000104122 0.00010717
0.00076244 0.00139754 0.000110308 0.000104122 0.00010116
100 100 100 100 100
0.000314063 0.000448739 0.000608263 0.000837192 0.000940767
1 1 1 1 1
0.919 0.919 0.919 0.919 0.919
2.69257e+07 6.70011e+07 1.46383e+08 2.41314e+09 3.37484e+09
0.206245 0.211334 0.257876 1 1
0.206245 0.211334 0.257876 0.0686843 0.0662230
27822.5 65841.5 148710 815621 1.13262e+06
0.908794 0.89794 0.861759 0.981156 0.977538
0.908794 0.897940 0.861759 0.688091 0.684472
74 changes: 61 additions & 13 deletions tests/test_class_hh_calibration.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,21 +90,69 @@ def test_fit__case_2_with_both_Vs_profile_and_GGmax_curves(self):
HH_G_param = hh_c.fit(verbose=False)
HH_G_benchmark_data = np.array(
[
[0.0003, 0.0001, 0.0001, 0.0001, 0.0001],
[100, 100, 100, 100, 100],
[
0.000285072,
0.000516205,
0.000944545,
0.00129825,
0.00144835,
3.0000000e-04,
1.0000000e-04,
1.0000000e-04,
1.0000000e-05,
1.0000000e-04,
],
[
1.0000000e02,
1.0000000e02,
1.0000000e02,
1.0000000e02,
1.0000000e02,
],
[
2.8507234e-04,
5.1624545e-04,
9.4453471e-04,
1.2979909e-03,
1.4497853e-03,
],
[
1.7522706e00,
1.7145687e00,
1.6405793e00,
1.5863492e00,
1.5645630e00,
],
[
9.1900098e-01,
9.1900268e-01,
9.1899964e-01,
9.1900711e-01,
9.1899869e-01,
],
[
2.1110400e07,
6.8590000e07,
1.4896000e08,
2.2544125e09,
3.2839763e09,
],
[
2.3335679e-01,
1.9914917e-01,
2.5378449e-01,
4.1906791e-02,
6.5981061e-02,
],
[
2.6500966e04,
6.4856617e04,
1.4880507e05,
8.0485491e05,
1.1078508e06,
],
[
9.3773869e-01,
8.5090452e-01,
8.6175879e-01,
1.0300000e00,
6.8809045e-01,
],
[1.75224, 1.71444, 1.64057, 1.58664, 1.56314],
[0.918975, 0.919001, 0.918973, 0.919007, 0.918999],
[2.11104e07, 6.859e07, 1.4896e08, 2.25441e09, 3.28398e09],
[0.233357, 0.199149, 0.253784, 1, 1],
[26501, 64856.6, 148805, 804855, 1.10785e06],
[0.937739, 0.850905, 0.861759, 0.984774, 0.981156],
],
)
HH_G_param_benchmark = HH_Param_Multi_Layer(HH_G_benchmark_data)
Expand Down
4 changes: 1 addition & 3 deletions tests/test_helper_generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,7 @@ def test_extend_scalar(self):
hlp.extend_scalar(np.ones(3), 2)

# Case #2: `length` is something strange
self.assertTrue(
np.allclose(hlp.extend_scalar(2.5, None), np.array(2.5))
)
self.assertTrue(np.allclose(hlp.extend_scalar(2.5, ()), np.array(2.5)))

# Case #3: `length` is an integer
self.assertTrue(
Expand Down
74 changes: 61 additions & 13 deletions tests/test_helper_hh_calibration.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,21 +230,69 @@ def test_hh_param_from_curves__case_1(self):
)
HH_G_benchmark = np.array(
[
[0.0003, 0.0001, 0.0001, 0.0001, 0.0001],
[100, 100, 100, 100, 100],
[
0.000285072,
0.000516205,
0.000944545,
0.00129825,
0.00144835,
3.000000e-04,
1.000000e-04,
1.000000e-04,
1.000000e-05,
1.000000e-04,
],
[
1.000000e02,
1.000000e02,
1.000000e02,
1.000000e02,
1.000000e02,
],
[
2.850723e-04,
5.162455e-04,
9.445347e-04,
1.297991e-03,
1.449785e-03,
],
[
1.752271e00,
1.714569e00,
1.640579e00,
1.586349e00,
1.564563e00,
],
[
9.190010e-01,
9.190027e-01,
9.189996e-01,
9.190071e-01,
9.189987e-01,
],
[
2.111040e07,
6.859000e07,
1.489600e08,
2.254412e09,
3.283976e09,
],
[
2.333568e-01,
1.991492e-01,
2.537845e-01,
4.190679e-02,
6.598106e-02,
],
[
2.650097e04,
6.485662e04,
1.488051e05,
8.048549e05,
1.107851e06,
],
[
9.377387e-01,
8.509045e-01,
8.617588e-01,
1.030000e00,
6.880905e-01,
],
[1.75224, 1.71444, 1.64057, 1.58664, 1.56314],
[0.918975, 0.919001, 0.918973, 0.919007, 0.918999],
[2.11104e07, 6.859e07, 1.4896e08, 2.25441e09, 3.28398e09],
[0.233357, 0.199149, 0.253784, 1, 1],
[26501, 64856.6, 148805, 804855, 1.10785e06],
[0.937739, 0.850905, 0.861759, 0.984774, 0.981156],
],
)
# use higher tolerance because MKZ curve fitting has room for small errors
Expand Down
2 changes: 0 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
[tox]
envlist =
py39
py310
py311
py312
Expand All @@ -15,7 +14,6 @@ envlist =

[gh-actions]
python =
3.9: py39, cercis, check-self, flake8-basic, flake8-misc, flake8-docstrings, pre-commit
3.10: py310, cercis, check-self, flake8-basic, flake8-misc, flake8-docstrings, pre-commit
3.11: py311, cercis, check-self, flake8-basic, flake8-misc, flake8-docstrings, pre-commit
3.12: py312, cercis, check-self, flake8-basic, flake8-misc, flake8-docstrings, pre-commit
Expand Down