Skip to content

Use of the out argument for inplace models is dangerous #14

@DougBurke

Description

@DougBurke

out = np.zeros(egrid.size - 1)
x.apec(energies=egrid, pars=pars, out=out)

will use the memory in out rather than creating a new array [it also returns the out array].

This only works when out has the correct datatype (np.float32 or np.float64) for the model, otherwise it will not be updated (the returned value is correct, but is not the same object as out).

This is crazy and dangerous.

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