Skip to content

incorrect return type for TOVsolver.solver_code.m1_from_mc_m2(mc, m2) #122

Open
@rhaas80

Description

@rhaas80

the docs claim

Return type:
m1 (float or numpy array)

but given the actual code:

    m2 = np.array(m2)
    num1 = (2.0 / 3.0) ** (1.0 / 3.0) * mc**5.0
    denom1 = (
        9 * m2**7.0 * mc**5.0
        + np.sqrt(3.0)
        * np.sqrt(abs(27 * m2**14.0 * mc**10.0 - 4.0 * m2**9.0 * mc**15.0))
    ) ** (1.0 / 3.0)
    denom2 = 2.0 ** (1.0 / 3.0) * 3.0 ** (2.0 / 3.0) * m2**3.0
    return num1 / denom1 + denom1 / denom

the return type is always a numpy.ndarray (though potentially of dimensionality 0).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions