Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Profiler - sorting by Total Time sorts by string order, not numeric order #2074

Closed
spyder-bot opened this issue Feb 17, 2015 · 3 comments
Closed

Comments

@spyder-bot
Copy link
Collaborator

From cmee...@gmail.com on 2014-12-04T04:30:08Z

Spyder Version: 2.3.1
Python Version: 2.7.6
Qt Version : 4.8.6, PyQt4 (API v2) 4.10.4 on Windows
pyflakes >=0.5.0: 0.8.1 (OK)
pep8 >=0.6 : 1.5.7 (OK)
IPython >=0.13 : 2.3.0 (OK)
pygments >=1.6 : 1.6 (OK)
pandas >=0.13.1 : 0.14.1 (OK)
sphinx >=0.6.6 : 1.2.3 (OK)
rope >=0.9.2 : 0.9.4 (OK)
matplotlib >=1.0: 1.4.0 (OK)
sympy >=0.7.0 : 0.7.5 (OK)
pylint >=0.25 : None (NOK)

What steps will reproduce the problem?

  1. Run the profiler (F10) on some code
    1. Sort by Total Time (default AFAIK)

What is the expected output? What do you see instead?

Observe that sorting descending by Total Time will yield e.g. the order 3.0 --> 20.0 --> 100.0, which is expected when sorting strings, but wrong when sorting numbers

Please provide any additional information below

. Depending on the sorting implementation, it is possible this can be fixed by simply adding key=float to the sorting function, i.e., instead of lst.sort(), do lst.sort(key=float).

Original issue: http://code.google.com/p/spyderlib/issues/detail?id=2074

@spyder-bot spyder-bot added this to the v2.3.3 milestone Feb 17, 2015
@spyder-bot
Copy link
Collaborator Author

From ccordoba12 on 2014-12-04T13:10:38Z

Daniel, could you take a look at this one?

Cc: dhoeg...@gmail.com
Labels: Cat-Profiler MS-v2.3.3

@spyder-bot
Copy link
Collaborator Author

From ccordoba12 on 2014-12-18T11:00:51Z

This issue was closed by revision 20c861affb72 .

Status: Fixed

@joooeey
Copy link

joooeey commented May 17, 2023

This issue is present again on the current Spyder version 5.4.3:

image

Versions: Python 3.10.10 64-bit | Qt 5.15.6 | PyQt5 5.15.7 | Linux 5.4.0-135-generic

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

No branches or pull requests

2 participants