Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions source_modelling/moment.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,11 +134,11 @@ def moment_rate_over_time_from_slip(

@typing.overload
def moment_to_magnitude(
moment: float, bold_m: typing.Literal[True]
moment: float, bold_m: typing.Literal[True] = True
) -> BoldM: ... # numpydoc ignore=GL08
@typing.overload
def moment_to_magnitude(
moment: float, bold_m: typing.Literal[False] = False
moment: float, bold_m: typing.Literal[False]
) -> Mw: ... # numpydoc ignore=GL08
def moment_to_magnitude(moment: float, bold_m: bool = True) -> BoldM | Mw:
"""Convert moment to magnitude.
Expand Down Expand Up @@ -189,11 +189,11 @@ def moment_to_magnitude(moment: float, bold_m: bool = True) -> BoldM | Mw:

@typing.overload
def magnitude_to_moment(
magnitude: BoldM, bold_m: typing.Literal[True]
magnitude: BoldM, bold_m: typing.Literal[True] = True
) -> float: ... # numpydoc ignore=GL08
@typing.overload
def magnitude_to_moment(
magnitude: Mw, bold_m: typing.Literal[False] = False
magnitude: Mw, bold_m: typing.Literal[False]
) -> float: ... # numpydoc ignore=GL08
def magnitude_to_moment(magnitude: BoldM | Mw, bold_m: bool = True) -> float:
"""Convert magnitude to moment.
Expand Down
2 changes: 1 addition & 1 deletion tests/test_moment.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ def test_point_source_slip_bad_dataframe():
}
)

moment_newton_metre = moment.magnitude_to_moment(Mw(5.0))
moment_newton_metre = moment.magnitude_to_moment(Mw(5.0), bold_m=False)

# Should raise KeyError when trying to access missing columns
with pytest.raises(KeyError):
Expand Down
Loading