Skip to content

Updated numpy is causing unit test error #231

Closed

Description

@murrayrm

This problem was first flagged in slycot issue #35.

In statesp_test.py the following code is used to check for a deprecation warning:

        # Deprecated version of the call (should generate warning)
        import warnings
        with warnings.catch_warnings(record=True) as w:
            warnings.simplefilter("always")
            sys.evalfr(1.)
            assert len(w) = 1
            assert issubclass(w[-1].category, PendingDeprecationWarning)

A new release of numpy is generating a deprecation warning on top of the one coming from python-control:

/Users/murray/Dropbox/macosx/src/python-control/murrayrm/control/statesp.py:390: PendingDeprecationWarning: StateSpace.evalfr(omega) will be depracted in a future release of python-control; use evalfr(sys, omega*1j) instead
  PendingDeprecationWarning)
/Users/murray/anaconda/envs/python3.5-test-slycot/lib/python3.5/site-packages/numpy/matrixlib/defmatrix.py:68: PendingDeprecationWarning: the matrix subclass is not the recommended way to represent matrices or deal with linear algebra (see https://docs.scipy.org/doc/numpy/user/numpy-for-matlab-users.html). Please adjust your code to use regular ndarray.
  return matrix(data, dtype=dtype, copy=False)

As a consequence, we get two warnings instead of one and the unit test fails.

Short term fix would be to update the unit test, but the better fix would be to address the underlying numpy warning.

Activity

  1. murrayrm commented on Jul 29, 2018

    @murrayrm
    MemberAuthor

    Fixed in PR #232

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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