-
Notifications
You must be signed in to change notification settings - Fork 0
Small change to allow workflow to use convention-aware magnitudes without # ty: ignore #19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -34,6 +34,7 @@ | |||||||||||||||||
|
|
||||||||||||||||||
| from nshmdb import query | ||||||||||||||||||
| from qcore import coordinates | ||||||||||||||||||
| from source_modelling.moment import BoldM | ||||||||||||||||||
| from source_modelling.sources import Fault, Plane | ||||||||||||||||||
|
|
||||||||||||||||||
|
|
||||||||||||||||||
|
|
@@ -153,7 +154,7 @@ def add_rupture( | |||||||||||||||||
| ) | ||||||||||||||||||
|
|
||||||||||||||||||
| def most_likely_fault( | ||||||||||||||||||
| self, rupture_id: int, parent_fault_magnitudes: dict[str, float] | ||||||||||||||||||
| self, rupture_id: int, parent_fault_magnitudes: dict[str, BoldM] | ||||||||||||||||||
| ) -> dict[str, float]: | ||||||||||||||||||
|
Comment on lines
156
to
158
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. By changing the type annotation of To allow both def most_likely_fault(
self,
rupture_id: int,
parent_fault_magnitudes: Mapping[str, Union[float, BoldM]],
) -> dict[str, float]: |
||||||||||||||||||
| """ | ||||||||||||||||||
| Calculate the cumulative activity rate for each fault involved in a specified rupture. | ||||||||||||||||||
|
|
@@ -174,9 +175,10 @@ def most_likely_fault( | |||||||||||||||||
| ---------- | ||||||||||||||||||
| rupture_id : int | ||||||||||||||||||
| The unique identifier of the rupture to query. | ||||||||||||||||||
| parent_fault_magnitudes : dict[str, float] | ||||||||||||||||||
| A mapping of parent fault names to their expected magnitudes. These magnitudes | ||||||||||||||||||
| define the target values for querying activity rates in the MFD table. | ||||||||||||||||||
| parent_fault_magnitudes : dict[str, BoldM] | ||||||||||||||||||
| A mapping of parent fault names to their expected magnitudes (in the | ||||||||||||||||||
| `BoldM` convention). These magnitudes define the target values for | ||||||||||||||||||
| querying activity rates in the MFD table. | ||||||||||||||||||
|
Comment on lines
+178
to
+181
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Update the docstring to reflect that
Suggested change
|
||||||||||||||||||
|
|
||||||||||||||||||
| Returns | ||||||||||||||||||
| ------- | ||||||||||||||||||
|
|
||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,5 +6,5 @@ pygmt-helper | |
| pytest | ||
| qcore-utils | ||
| shapely | ||
| source-modelling | ||
| source-modelling>=2026.6.2 | ||
| typer | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Import
MappingandUnionfromtypingto support a more flexible type signature forparent_fault_magnitudesthat accepts both standardfloatandBoldMvalues.