Commit Graph

14 Commits (dc96d4bee7b898172a6a15de4799af0e2d35605e)

Author SHA1 Message Date
George Hotz dc96d4bee7
Add More Types for mypy (#23268)
* mypy passes

* a few more

* a few in manager

* more types, will lint

* more

* simple types

* events type

* Update selfdrive/thermald/thermald.py

* Apply suggestions from code review

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2021-12-28 18:07:00 +01:00
Ewout ter Hoeven 332f568a82
Pyupgrade 3.6: Update syntax with Python 3.6+ features (#23305)
Updated Python code with Python 3.6+ features:
- utf-8 encoding is now the default (PEP 3120)
- Replace list comprehensions by Generator Expressions (PEP 289)
- Replace yield loop by yield from (PEP 380)
- Remove the (object) subclass when defining a class
- Replace the IOError alias by OSError (PEP 3151)
- Define sets with curly braces {} instead of set()
- Remove "r" parameter from open function, which is default

Co-Authored-By: Adeeb Shihadeh <8762862+adeebshihadeh@users.noreply.github.com>
Co-Authored-By: GregorKikelj <96022003+GregorKikelj@users.noreply.github.com>

Co-authored-by: Adeeb Shihadeh <8762862+adeebshihadeh@users.noreply.github.com>
Co-authored-by: GregorKikelj <96022003+GregorKikelj@users.noreply.github.com>
2021-12-24 11:18:39 -08:00
Ewout ter Hoeven 55390d273f
Convert format strings strings to f-strings (#23241)
* Convert all text strings to f-strings

Reformats all the text from the old "%-formatted" and .format(...) format to the newer f-string format, as defined in PEP 498. This requires Python 3.6+.

Flynt 0.69 was used to reformat the strings. 120 f-strings were created in 51 files.

F-strings are in general more readable, concise and performant. See also: https://www.python.org/dev/peps/pep-0498/#rationale

* revert pyextra changes

* revert ublox.py

Co-authored-by: Willem Melching <willem.melching@gmail.com>
2021-12-16 14:58:17 +01:00
Adeeb Shihadeh b27a19e9d1
cloudlog: add daemon name to context for python daemons (#23225)
* python

* manager is a daemon too

* Update selfdrive/manager/process.py

Co-authored-by: Comma Device <device@comma.ai>
2021-12-14 20:43:26 -08:00
Dean Lee ca88a8769b
watchdog_kick: non-allocating (#22892)
* non-allocating

* unpack

* call kick every second

* cleanup include
2021-11-17 12:02:31 +01:00
Adeeb Shihadeh 2f57f1729d
add shouldBeRunning field to managerState (#22246) 2021-09-15 19:51:55 -07:00
arfy slowy d74def61f8
fix: spelling typos (#21861)
* fix: typo spelling grammar

* revert

* Update selfdrive/locationd/calibrationd.py

* more revert

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2021-08-05 12:05:49 -07:00
Adeeb Shihadeh 09291b99bc
watchdog: restart while onroad (#21636) 2021-07-17 14:52:05 -07:00
Willem Melching 9291ca773c
Kill processes in parallel when going offroad (#20469)
* Kill processes in parallel when going offroad

* smaller diff

* handle edge case

* more readable

* set variable after actually sending signal

* newline
2021-03-25 17:27:49 +01:00
Willem Melching 958e7b0071 manager watchdog, log exit code 2021-03-09 13:11:40 +01:00
Willem Melching a94ba4fb8b
Add watchdog check to manager (#20277)
* this should work but doesnt

* Only offroad

* works

* make it work offorad

* reduce diff

* cleanup

* need util

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2021-03-08 19:17:46 -08:00
Willem Melching af2a847f06 manager: check if process is running before sending signal 2021-03-08 15:42:09 +01:00
Willem Melching 476558b547
Process config cleanup (#20276)
* add enabled flag

* remove hack

* only prepare when enabled
2021-03-08 12:18:58 +01:00
Willem Melching 5a3b511306
Manager cleanup (#20231)
* move manager in folder

* inital refactor

* call start

* small cleanup

* add comments

* use self.signal()

* order shouldnt matter

* newlines

* add helpers

* newlines

* add process config

* split out build part of manager

* this should fix most tests

* no sensord on pc

* dont start athena

* remove comment

* fix old athena test

* fix inject model

* fix test car models

* should be not none

* fix helpers exitcode

* ignore manage_athenad

* Use time.monotonic()

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>

* combine init, remove spinner

* move manager test

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2021-03-05 11:03:23 +01:00