Skip to content

Improve NumPy code in equalizing differences lecture #361

Closed
@jstac

Description

@jstac

The NumPy code does not adhere to PEP8 and the class could easily be removed, so that compute_gap is just a function of the different parameters.

Then we could get rid of all the separate functions in the code block that starts with

# ϕ_R
def ϕ_R(mc, R_new):
    mc_new = equalizing_diff(R_new, mc.T, mc.γ_h, mc.γ_c, mc.w_h0, mc.D, mc.π)
    return mc_new.compute_gap()

ϕ_R = np.vectorize(ϕ_R)

@thomassargent30 Would you be willing to let @HumphreyYang and I simplify the NumPy part of the code without changing what it does?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions