Remove 760m/s boundary on μ formula (G/Gmax param) in HH model#35
Remove 760m/s boundary on μ formula (G/Gmax param) in HH model#35
Conversation
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 |
There was a problem hiding this comment.
No need to use name and date in comments. Git blame and git history can keep track of who/when made this change.
There was a problem hiding this comment.
Got it, I'll keep that in mind.
Removed the initials and date on the explanatory comment in the code
|
Hi @xia-fr , just a reminder that quite a few unit tests failed. You can see the |
Modified the benchmark in case_2_with_both_Vs_profile_and_GGmax_curves()
Addressing DeprecationWarning: Passing None into shape arguments as an alias for () is deprecated.
| # 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. |
There was a problem hiding this comment.
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))) |
There was a problem hiding this comment.
Instead of replacing an existing test case, you can add your new test case below the old one.
|
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 modelBecause 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 | |||
There was a problem hiding this comment.
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" |
There was a problem hiding this comment.
There's a place in README.md that says "requires python ≥ 3.9". Can you update that place too?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
I guess we should probably update this date too
There was a problem hiding this comment.
I edited the date corresponding to 0.6.3 to today's date, lmk if that should be something else
.pre-commit-config.yaml
Outdated
| @@ -1,32 +1,48 @@ | |||
| --- | |||
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
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).
There was a problem hiding this comment.
Got it, that makes sense.
|
Github workflow failed because of 2 reasons:
It relates to this change: #35 (comment) I guess newer versions of numpy requires
You can run |
|
It's becoming more of a convention nowadays that:
|
|
Hi @xia-fr , I think this PR all looks good. You can click "squash and merge", and draft a new release. Go to "Releases"
then "draft a new release":
Create a tag
And click "Generate release notes":
|
|
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 |




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)