Skip to content

Comments

Remove 760m/s boundary on μ formula (G/Gmax param) in HH model#35

Merged
xia-fr merged 20 commits intomainfrom
2025-10-12-mu-edits-corrected-xia
Oct 17, 2025
Merged

Remove 760m/s boundary on μ formula (G/Gmax param) in HH model#35
xia-fr merged 20 commits intomainfrom
2025-10-12-mu-edits-corrected-xia

Conversation

@xia-fr
Copy link
Collaborator

@xia-fr xia-fr commented Oct 13, 2025

We remove the 760m/s Vs limit which was resulting in occasional instabilities for smooth Vs profiles that cross the 760m/s boundary. (correct this time)

We remove the 760m/s Vs limit which was resulting in occasional instabilities for smooth Vs profiles that cross the 760m/s boundary. (correct this time)
mu[j] = 1.0
# END IF
# softer soil: use Vardanega & Bolton (2011) CGJ formula
# fx (251012): we remove the 760m/s limitation on applying the
Copy link
Collaborator

Choose a reason for hiding this comment

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

No need to use name and date in comments. Git blame and git history can keep track of who/when made this change.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Got it, I'll keep that in mind.

Removed the initials and date on the explanatory comment in the code
@jsh9
Copy link
Collaborator

jsh9 commented Oct 14, 2025

Hi @xia-fr , just a reminder that quite a few unit tests failed. You can see the Checks (16) section for more details. These need to be fixed before we can merge changes.

# formula, where mu was being set to 1.0 for Vs higher than 760m/s,
# which caused occasional instabilities for Vs profiles that cross
# 760m/s in a smooth manner. We allow the CGJ formula to apply
# to stiffer soils as well.
Copy link
Collaborator

@jsh9 jsh9 Oct 15, 2025

Choose a reason for hiding this comment

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

Hi @xia-fr , I trust you know what you are doing by making these changes.

Can you update versions in pyproject.toml, and also add an entry to CHANGELOG.md?

In your comment here, there's no need to say what you changed (because future code readers can only see the new code in the Python file, not the code diff). Write "what's changed" into CHANGELOG and the PR title (which will become the commit message, which is intended to describe "what's changed in this commit").

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)))
Copy link
Collaborator

Choose a reason for hiding this comment

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

Instead of replacing an existing test case, you can add your new test case below the old one.

@xia-fr xia-fr changed the title Update helper_hh_calibration.py Removed 760m/s boundary on mu estimation formula in helper_hh_calibration.py Oct 16, 2025
@xia-fr xia-fr changed the title Removed 760m/s boundary on mu estimation formula in helper_hh_calibration.py Removed 760m/s boundary on mu estimation formula when generating G/Gmax curve parameters for the hybrid hyperbolic model Oct 16, 2025
@jsh9
Copy link
Collaborator

jsh9 commented Oct 16, 2025

I'd update the PR title this way:

- Removed 760m/s boundary on mu estimation formula when generating G/Gmax curve parameters for the hybrid hyperbolic model
+ Remove 760m/s boundary on μ formula (G/Gmax param) in HH model

Because commit messages are better to be very concise, so imperative mood and abbreviations are preferred wherever possible.

(VS code even warns people when their commit msg exceeds 50 chars)

@@ -1,2 +1,2 @@
pip install flake8
flake8 ./PySeismoSoil --count --statistics --ignore=C901,E203,E741,E221,W605,E502,E116,W504,E266,E114,E222 --max-line-length=99 --max-complexity=10
Copy link
Collaborator

@jsh9 jsh9 Oct 16, 2025

Choose a reason for hiding this comment

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

I think we should delete this file, because linting/workflow is done in tox and Gitlab workflow.

You can leave this file unchanged in this PR and I can deal with it in my other PR.

"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

CHANGELOG.md Outdated
Copy link
Collaborator

Choose a reason for hiding this comment

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

I guess we should probably update this date 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 edited the date corresponding to 0.6.3 to today's date, lmk if that should be something else

@@ -1,32 +1,48 @@
---
Copy link
Collaborator

Choose a reason for hiding this comment

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

The changes I made in this config may be too disruptive because they'll format other places irrelevant to your current change.

This could pollute the commit with many unrelated changes (which will then pollute Git blame and Git history, making future debugging more time consuming).

You can keep this file as is in this PR, and I'll handle them in my PR.

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 think the checks are currently failing here because of something related to the old tox/pytest setup and not because of the actual functionality of the code (as can be seen by them not failing in your PR)

Copy link
Collaborator

Choose a reason for hiding this comment

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

I see. What I meant was: if you change this file in your PR here, you'll introduce hundreds of lines of diffs that are unrelated to your intention (remove 760 m/s boundary in HH model formulas).

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Got it, that makes sense.

@xia-fr xia-fr changed the title Removed 760m/s boundary on mu estimation formula when generating G/Gmax curve parameters for the hybrid hyperbolic model Remove 760m/s boundary on μ formula (G/Gmax param) in HH model Oct 16, 2025
@jsh9
Copy link
Collaborator

jsh9 commented Oct 16, 2025

Github workflow failed because of 2 reasons:

  1. This error here:
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  E       TypeError: Use () not None as shape arguments
  

It relates to this change: #35 (comment)

I guess newer versions of numpy requires () rather than None now. You can change it to ()

  1. Auto formatting.

You can run pre-commit run -a in your terminal before you commit your changes. (Hence then name "pre commit")

@jsh9
Copy link
Collaborator

jsh9 commented Oct 16, 2025

It's becoming more of a convention nowadays that:

  • A .pre-commit-config.yaml file in a repo means maintainers can run pre-commit run -a to auto-format (or auto-check) code or files
  • A tox.ini in a repo means tests and checks will be run via tox

@jsh9
Copy link
Collaborator

jsh9 commented Oct 17, 2025

Hi @xia-fr , I think this PR all looks good.

You can click "squash and merge", and draft a new release.

Go to "Releases"

image

then "draft a new release":

image

Create a tag v0.6.3:

image

And click "Generate release notes":

image

@xia-fr xia-fr merged commit 1455bbd into main Oct 17, 2025
13 checks passed
@jsh9
Copy link
Collaborator

jsh9 commented Oct 19, 2025

Hi @xia-fr , the 0.6.3 release somehow showed up as a draft (i.e., not published), so I just published it manually: https://github.com/Caltech-geoquake/PySeismoSoil/releases/tag/v0.6.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants