Skip to content

linalg.lstsq: Warn that using future default will break for numpy < 1.14 #11015

@nathdwek

Description

@nathdwek

From 1.14, using linalg.lstsq without specifying rcond yields the following warning:

rcond parameter will change to the default of machine precision times max(M, N) where M and N are the input matrix dimensions.
To use the future default and silence this warning we advise to pass rcond=None, to keep using the old, explicitly pass rcond=-1.

Which seems to strongly indicate that rcond=None is the safe bet going further unless you have a reason not to.
However, the warning does not indicate that doing so will make such code break on any install which has still numpy <1.14 (which unfortunately with pip is not so infrequent).

TypeError: must be real number, not NoneType

This is a minor gripe and proper regression testing on the user end should prevent big problems, but I still think it would be nice to be more diligent when introducing those types of changes.

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