Skip to content

[upstream PR #313] Integration blocked: replace use of np.array(copy=False) with np.asarray() #106

@GeorgePearse

Description

@GeorgePearse

Upstream PR: rlabbe/filterpy#313
Issue Type: Cherry-pick failed: fatal: bad object 958146407395ecc7b813a4ba4c532e699c5c0b59


Problem

Error: Cherry-pick failed: fatal: bad object 958146407395ecc7b813a4ba4c532e699c5c0b59


Original Description

From the author's textbook, several cells fail. Example:

import kf_book.mkf_internal as mkf_internal

mean = [2., 17.]
cov = [[10., 0.], 
       [0., 4.]]

mkf_internal.plot_3d_covariance(mean, cov)

Yields:

---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
...
ValueError: Unable to avoid copy while creating an array as requested.
If using `np.array(obj, copy=False)` replace it with `np.asarray(obj)` to allow a copy when needed (no behavior change in NumPy 1.x).
For more details, see https://numpy.org/devdocs/numpy_2_0_migration_guide.html#adapting-to-changes-in-the-copy-keyword.

This pull request applies this change to this function, noting the change may still be required elsewhere.

Metadata

Metadata

Assignees

No one assigned

    Labels

    upstream-pr-blockedUpstream PR blocked by conflicts or errors

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions