Skip to content

Commit 01487c8

Browse files
authored
Fix incorrect return type documentation for m1_from_mc_m2 function
This commit corrects the documentation for the m1_from_mc_m2 function to accurately reflect its behavior: Update return value documentation to specify that the function always returns a numpy.ndarray (even for scalar inputs) Clarify that the return array will have the same shape as the input m2 parameter if m2 is an array Improve overall docstring clarity with more descriptive function summary and parameter descriptions Keep the actual function logic unchanged as it is working as intended
1 parent c92f772 commit 01487c8

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

TOVsolver/solver_code.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,20 @@
77

88

99
def m1_from_mc_m2(mc, m2):
10-
"""a function that feed back the companion star mass from GW event measurement.
10+
"""Calculate companion star mass from chirp mass and one component mass
11+
12+
Given the chirp mass from a gravitational wave event and one component mass,
13+
calculate the other component mass.
1114
1215
Args:
13-
mc (float): chrip mass of a GW event, unit in solar mass.
14-
m2 (float or numpy array): the determined mass for one of the star, this is computed from sampling of EoS.
16+
mc (float): Chirp mass of a GW event, in solar mass units
17+
m2 (float or numpy.ndarray): Mass of one component, in solar mass units
1518
1619
Returns:
17-
m1 (array): the companion star mass in solar mass.
20+
numpy.ndarray: Mass of the companion star (m1), in solar mass units.
21+
Will have the same shape as the input m2 if m2 is an array.
1822
"""
23+
1924
m2 = np.array(m2)
2025
num1 = (2.0 / 3.0) ** (1.0 / 3.0) * mc**5.0
2126
denom1 = (

0 commit comments

Comments
 (0)