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

use ndarray.tolist to convert numpy array to float #23485

Merged
merged 1 commit into from
Jan 11, 2022

Conversation

deanlee
Copy link
Contributor

@deanlee deanlee commented Jan 10, 2022

No description provided.

@pd0wm pd0wm added the refactor label Jan 11, 2022
@pd0wm
Copy link
Contributor

pd0wm commented Jan 11, 2022

Seems to be about 10x faster :)

In [9]: timeit.timeit('y = [float(a) for a in x]', setup='import numpy as np; x = np.zeros(20)')
Out[9]: 3.55299404499965

In [10]: timeit.timeit('y = x.tolist()', setup='import numpy as np; x = np.zeros(20)')
Out[10]: 0.37758147599924996

@pd0wm pd0wm merged commit 35ec6ac into commaai:master Jan 11, 2022
@deanlee deanlee deleted the us_astype branch January 11, 2022 15:56
budney added a commit to budney/openpilot that referenced this pull request Jan 14, 2022
7eca4d6 tools: better joystick instructions
ed5e58c Hyundai: use regular Hyundai safety mode and add radar DBC (commaai#23461)
233a6e4 LanePlanner: offsets cleanup (commaai#23459)
24213ac lfs: easier to use config (commaai#23490)
6e817f9 manager: default driverview to False (commaai#23492)
44592f4 statsd: run at 2Hz (commaai#23493)
35ec6ac use ndarray.tolist  to convert numpy array to float (commaai#23485)
8444f82 calibrationd: convert existing calibration to numpy (commaai#23494)
5fb9c6a thermald has slowly started to use more CPU
678732d AlertManager: cleanup add_many (commaai#23438)
85dcfbb update comment (commaai#23495)
a186bcc cleanup iterate keys in dictionaries (commaai#23497)
79577e4 boardd: remove ublox timestamp logging (commaai#23498)
dbae5e7 lateral_planner: use nympy.isnan().any() (commaai#23500)
b1a226b VW MQB: Add FW for 2022 Volkswagen Atlas (commaai#23501)
eb9f359 Toyota: Support Avalon 2022 (TSS2.5) (commaai#23381)
08a1ce0 update release notes
3816ecf bump opendbc
9941c99 process replay: handle inf and nan in absolute tolerance
de572c3 calibrationd: fix indentation (commaai#23502)
e5f9af4 calibrationd: Don't repeatedly call get_valid_idxs() (commaai#23473)
f808b17 use roll std from locationd (commaai#23449)
7d7c0ff tools: add bootlog helpers (commaai#23504)
ee52a61 add pre-commit hook for large files (commaai#23505)
c214aee cleanup .gitattributes (commaai#23503)
9e1428f Do not disable loggerd when below 5% space (commaai#23440)
48b6dfa controlsd: check self.enabled out of the any() (commaai#23507)
c84a085 bump cereal: more qlog decimation
fcfea4c Kia Niro EV - replace \000 by \x00 (commaai#23509)
6d16b0c can_printer.py: default no ascii
1538013 pandad: only reset pandas on first run (commaai#23511)
6d5dce2 Subaru: fix missing commas in fingerprints (commaai#23512)
2c94f15 linter: don't allow implicitly concatenated strings (commaai#23513)
d5f4fdb eliminate xx filereader (commaai#23514)
57156c4 Chrysler: remove standstill exception for gas disengage (commaai#23515)
df35ebd fix filereader cd:/ replacement
a6b46c3 filereader better name for cd:/ replacement
6dbae95 UI: reset interactivity timeout on PC (commaai#23508)
9f4fd73 Toyota: DBC signal renames (commaai#23452)
fd042a5 controlsd: cleanup parsing android log (commaai#23421)
feae375 swaglog.cc: add test case. fixed the ctx of the first message is empty (commaai#23226)
8c53adf swaglog: add daemon name to context (commaai#23518)
610b99f Log android system shutdown to param (commaai#23520)
ef3a549 thermald: remove modem version log (commaai#23524)
e72eb1d thermald: remove brightness setting on ui crash (commaai#23527)
ed23177 thermald: remove panda disconnect logic (commaai#23526)
53ca036 thermald: let manager handle shutdown (commaai#23528)
b75e410 boardd: panda_state_thread run closer to 2 Hz (commaai#23529)
785180d MainWindow::eventFilter: add static keyword for evts (commaai#23521)
75be122 ui/WifiManager: inherit from QObject instead of QWidget (commaai#23523)
39d904d ui/networking: combine connect functions into one (commaai#23522)
308a6f1 manager: log exit reason (commaai#23532)
budney added a commit to budney/openpilot that referenced this pull request Mar 24, 2022
7eca4d6 tools: better joystick instructions
ed5e58c Hyundai: use regular Hyundai safety mode and add radar DBC (commaai#23461)
233a6e4 LanePlanner: offsets cleanup (commaai#23459)
24213ac lfs: easier to use config (commaai#23490)
6e817f9 manager: default driverview to False (commaai#23492)
44592f4 statsd: run at 2Hz (commaai#23493)
35ec6ac use ndarray.tolist  to convert numpy array to float (commaai#23485)
8444f82 calibrationd: convert existing calibration to numpy (commaai#23494)
5fb9c6a thermald has slowly started to use more CPU
678732d AlertManager: cleanup add_many (commaai#23438)
85dcfbb update comment (commaai#23495)
a186bcc cleanup iterate keys in dictionaries (commaai#23497)
79577e4 boardd: remove ublox timestamp logging (commaai#23498)
dbae5e7 lateral_planner: use nympy.isnan().any() (commaai#23500)
b1a226b VW MQB: Add FW for 2022 Volkswagen Atlas (commaai#23501)
eb9f359 Toyota: Support Avalon 2022 (TSS2.5) (commaai#23381)
08a1ce0 update release notes
3816ecf bump opendbc
9941c99 process replay: handle inf and nan in absolute tolerance
de572c3 calibrationd: fix indentation (commaai#23502)
e5f9af4 calibrationd: Don't repeatedly call get_valid_idxs() (commaai#23473)
f808b17 use roll std from locationd (commaai#23449)
7d7c0ff tools: add bootlog helpers (commaai#23504)
ee52a61 add pre-commit hook for large files (commaai#23505)
c214aee cleanup .gitattributes (commaai#23503)
9e1428f Do not disable loggerd when below 5% space (commaai#23440)
48b6dfa controlsd: check self.enabled out of the any() (commaai#23507)
c84a085 bump cereal: more qlog decimation
fcfea4c Kia Niro EV - replace \000 by \x00 (commaai#23509)
6d16b0c can_printer.py: default no ascii
1538013 pandad: only reset pandas on first run (commaai#23511)
6d5dce2 Subaru: fix missing commas in fingerprints (commaai#23512)
2c94f15 linter: don't allow implicitly concatenated strings (commaai#23513)
d5f4fdb eliminate xx filereader (commaai#23514)
57156c4 Chrysler: remove standstill exception for gas disengage (commaai#23515)
df35ebd fix filereader cd:/ replacement
a6b46c3 filereader better name for cd:/ replacement
6dbae95 UI: reset interactivity timeout on PC (commaai#23508)
9f4fd73 Toyota: DBC signal renames (commaai#23452)
fd042a5 controlsd: cleanup parsing android log (commaai#23421)
feae375 swaglog.cc: add test case. fixed the ctx of the first message is empty (commaai#23226)
8c53adf swaglog: add daemon name to context (commaai#23518)
610b99f Log android system shutdown to param (commaai#23520)
ef3a549 thermald: remove modem version log (commaai#23524)
e72eb1d thermald: remove brightness setting on ui crash (commaai#23527)
ed23177 thermald: remove panda disconnect logic (commaai#23526)
53ca036 thermald: let manager handle shutdown (commaai#23528)
b75e410 boardd: panda_state_thread run closer to 2 Hz (commaai#23529)
785180d MainWindow::eventFilter: add static keyword for evts (commaai#23521)
75be122 ui/WifiManager: inherit from QObject instead of QWidget (commaai#23523)
39d904d ui/networking: combine connect functions into one (commaai#23522)
308a6f1 manager: log exit reason (commaai#23532)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants