GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — doc inconsistency about return type of lqr - matrix vs array · Issue #418 · python-control/python-control

doc inconsistency about return type of lqr - matrix vs array #418

New issue
Copy link
New issue
Copy link
Closed
#477
#476
Closed
doc inconsistency about return type of lqr - matrix vs array#418
#477
#476
Copy link
Assignees
murrayrm
Labels
documentation
Milestone
0.8.4

Description

@jerabaul29
jerabaul29
opened on Jun 12, 2020
Issue body actions

I think the doc about the return type of the lqr function looks inconsistent:

https://python-control.readthedocs.io/en/0.8.1/generated/control.lqr.html

states that K is a 2-d array. But it looks a lot like a matrix actually :)

>>> K, _, _ = control.lqr(np.array([1]), np.array([1]), np.array([1]), np.array([1]))
>>> K
matrix([[2.41421356]])

This is Python 3.6.9, control 0.8.3, Ubuntu 18.04 defaults.

This leads to possibly subtle bugs:

https://stackoverflow.com/questions/62342225/how-to-squeeze-when-numpy-squeeze-does-not-seem-to-squeeze?

Do you think it may be a good idea to 1) update the doc 2) maybe change from matrix to array output altogether? :)

Activity

  1. murrayrm commented on Jun 12, 2020

    @murrayrm
    murrayrm
    on Jun 12, 2020
    Member
    More actions

    The plan is to shift away from the use of the np.matrix class at a future point. This functionality is already in place through the use of the use_numpy_matrix function. In version 0.8.3, the np.matrix class is still used for backward compatibility, but you can switch to using arrays through the function call

    control.use_numpy_matrix(False)
    

    When we release version 0.9.0, we will switch to have np.ndarray be the default class for all matrices in python-control.

    I'll leave this issue open for a bit because I think we generally need to update the documentation to reflect that fact that the return type for functions depends on how you have configured python-control. I've been collecting up documentation updates, so will include those changes in that PR.

    Reacted by JR
  2. murrayrm
    added
    documentation
    on Jun 12, 2020
  3. murrayrm
    self-assigned this
    on Jun 12, 2020
  4. murrayrm
    added this to the 0.8.4 milestone on Jun 12, 2020
  5. murrayrm
    added a commit that references this issue on Dec 22, 2020

    update lqr() return type documentation (addresses python-control#418)

    3e6347f
  6. bnavigator
    linked a pull request that will close this issueDocumentation update #476on Dec 22, 2020
  7. murrayrm
    closed this as completedin #476on Dec 24, 2020
  8. murrayrm
    added a commit that references this issue on Dec 24, 2020

    Documentation update (#476)

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

Metadata

Metadata

Assignees

  • @murrayrm
    murrayrm

Labels

documentation

Type

No type

Projects

No projects

    Milestone

    • 0.8.4

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402520 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.