Skip to content

fix: correct 'last error' to 'last layer' in ValueError message - #122

Open
Jah-yee wants to merge 1 commit into
Caltech-geoquake:mainfrom
Jah-yee:fix/last-error-typo
Open

Jah-yee wants to merge 1 commit into
Caltech-geoquake:mainfrom
Jah-yee:fix/last-error-typo

Conversation

@Jah-yee

@Jah-yee Jah-yee commented Oct 11, 2026

Copy link
Copy Markdown

Summary

Fix a typo in the error message emitted by check_Vs_profile_format():
"last error" → "last layer".

Changes

  • PySeismoSoil/helper_generic.py: Changed the ValueError message for invalid
    material numbers from except for the last error to except for the last layer, consistent with the thickness check above it.

  • tests/test_class_Vs_profile.py: Updated test_Vs_profile_format__case_10
    to match the full error message (preventing future regressions on this
    specific wording).

Testing

The fix was verified by running the reproduction case from issue #121:

import numpy as np
from PySeismoSoil.class_Vs_profile import Vs_Profile

data = np.array(
    [[10, 20, 30, 0], [100, 120, 160, 190],
     [0.01, 0.01, 0.01, 0.01], [1600, 1600, 1600, 1600], [1, 0, 3, 0]],
    dtype=float,
).T
Vs_Profile(data)
# Before: ValueError: The "material number" column should be all positive, except for the last error.
# After:  ValueError: The "material number" column should be all positive, except for the last layer.

Closes #121

@Jah-yee
Jah-yee force-pushed the fix/last-error-typo branch from 7f6006e to cec41e4 Compare October 12, 2026 10:42

@Wkhanex Wkhanex left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Verified the corrected diagnostic with a synthetic two-layer, five-column profile: a zero material number in the first layer raises The "material number" column should be all positive, except for the last layer. A zero material number in the final layer is accepted, so the corrected wording matches the actual exception rule. I ran these checks using the extracted complete validator and its numeric helpers on Python 3.12/NumPy; the full library, tox and example notebooks were not run, and this is not a merge approval.

This branch has not been deployed

No deployments
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.

Material-number error says "last error" instead of "last layer"

2 participants