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 — lti squeeze: ndarray.ndim == 0 is also a scalar by bnavigator · Pull Request #595 · python-control/python-control

Conversation

@bnavigator

@bnavigator bnavigator commented Mar 28, 2021

Copy link
Copy Markdown
Contributor

Fixes #594

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@bnavigator
activate previously unreached test code
efb79a7
@coveralls

coveralls commented Mar 28, 2021 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Coverage Status

Coverage remained the same at 89.274% when pulling 5646146 on bnavigator:fix-594 into 8b900ca on python-control:master.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bnavigator bnavigator closed this Mar 28, 2021
@bnavigator bnavigator reopened this Mar 28, 2021
@bnavigator

bnavigator commented Mar 28, 2021

Copy link
Copy Markdown
Contributor Author

#594 is fixed, as one can check manually.

But I am confused that 4b44923 without f8fe08a cannot trigger a test failure.

And now I will really stop for today.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

bnavigator added 2 commits March 30, 2021 13:32
@bnavigator
test ndarray and python native omegas for test_squeeze
cdba09a
@bnavigator
ndarray.ndim==0 is a scalar
5646146
@bnavigator
bnavigator force-pushed the fix-594 branch from f8fe08a to cdba09a Compare March 30, 2021 11:34
@bnavigator

bnavigator commented Mar 30, 2021

Copy link
Copy Markdown
Contributor Author

Found it:

>>> np.array(0.1)
array(0.1)
>>> np.array(0.1)*1J
0.1j
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bnavigator
bnavigator marked this pull request as ready for review March 30, 2021 11:41
@bnavigator bnavigator mentioned this pull request Mar 30, 2021
a first implementation of the singular value plot as discussed in #592 #593
Merged
sawyerbfuller
sawyerbfuller approved these changes Apr 1, 2021
View reviewed changes
@sawyerbfuller

sawyerbfuller commented Apr 1, 2021

Copy link
Copy Markdown
Contributor

Found it:

>>> np.array(0.1)
array(0.1)
>>> np.array(0.1)*1J
0.1j

What is going on here? does np.array(0.1)*1 also return a scalar instead of an array?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bnavigator

bnavigator commented Apr 1, 2021

Copy link
Copy Markdown
Contributor Author

I guess it is a somewhat less intuitive result of the broadcasting mechanics.

>>> import numpy as np
>>> a=np.array(1.0)
>>> a
array(1.)
>>> a*1J
1j
>>> a*1
1.0
>>> 1*a
1.0
>>> 1J*a
1j
>>> a+1
2.0
>>> type(a)
<class 'numpy.ndarray'>
>>> type(1*a)
<class 'numpy.float64'>
>>> type(a*1J)
<class 'numpy.complex128'>

https://numpy.org/doc/stable/reference/arrays.scalars.html

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bnavigator
bnavigator merged commit de87cc6 into python-control:master Apr 1, 2021
@murrayrm murrayrm added this to the 0.9.1 milestone Dec 30, 2021
@bnavigator
bnavigator deleted the fix-594 branch February 18, 2024 20:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@sawyerbfuller sawyerbfuller sawyerbfuller approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

0.9.1

Development

Successfully merging this pull request may close these issues.

squeeze: return shape of the frequency response.

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@bnavigator @coveralls @sawyerbfuller @murrayrm
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — 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.