Skip to content

Clarify use of likelihood parameters in likelihood.get_convolved_Px_AA #13

@andreufont

Description

@andreufont

While reviewing the code I found these lines in the code that computes the convolved Px model:

        # make sure the likelihood params match the iz. First make a deepcopy
        if like_params is not None:
            like_params = copy.deepcopy(like_params)
        for ip, par in enumerate(like_params):
            if type(par.value) in [list, np.ndarray] and len(par.value)>1:
                like_params[ip].value = par.value[np.array(iz)]

You are doing a deep copy of like_params, and assigning it to like_params?

Looking at the second part, it looks like this is related to having parameters with arrays of values, so maybe this is something that we'd like to get rid of anyway, but I was curious about this use of deepcopy.

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