Repository navigation
Fix misleading docstrings in fsp, CFM and rupture_propagation - #163
Merged
Merged
Conversation
…ation Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #148
What was wrong
Several docstrings and comments contradicted the code:
fsp.py:segment_countwas described as the number of subfaults and commented as== len(data). It is actually the number of fault segments (Nsg).nx/nzwere documented asfloat or None, but they are parsed with:dand annotatedint | None.time_window_countwas described as "the time windows" when it is their count (Ntw).community_fault_model.py: the module docstring said the CFM is stored in a GeoPackage, but the code loadsNZ_CFM_v1_0.shp. A comment claimed traces are transformed to WGS84, but the code only swaps the axis order and tags the frame as EPSG:2193. The D90/Dfc down-dip depth fields were documented as "Not sure!".rupture_propagation.py:spanning_tree_with_probabilitieswas annotated and documented as returninglist[nx.DiGraph], butSpanningTreeIteratoryields undirectednx.Graphobjects.What changed
Only docstrings, comments and the one return type hint listed in the issue. No runtime behaviour changes, so no test was added. The existing suite passes (801 tests), and ruff check/format are clean on the changed files.
Reviewer notes
fsp.pydocstring,time_window_countstill saysfloat or Noneto match its dataclass annotation (float | None), even though the header parses it as an int. I left the annotation alone because the issue scoped this to docs.🤖 Generated with Claude Code