Commit Graph

64 Commits

Author SHA1 Message Date
Shane Smiskol
870d19f33d Reapply "File sourcing: Not all files are logs (#36025)"
This reverts commit 3570022b9a.

Fix test
2025-08-19 19:59:50 -07:00
Shane Smiskol
60c34a0837 LogReader: run source test (#36031)
run "slow" test
2025-08-19 19:58:47 -07:00
Maxime Desroches
3570022b9a Revert "File sourcing: Not all files are logs (#36025)"
This reverts commit 18b7ddef8f.
2025-08-19 17:11:53 -07:00
Harald Schäfer
18b7ddef8f File sourcing: Not all files are logs (#36025)
* Not all files are logs

* more refactor

* linting ok

* fix tests

* import exception

* whoops forgot to git add

* fix

---------

Co-authored-by: Shane Smiskol <shane@smiskol.com>
2025-08-19 16:25:13 -07:00
Shane Smiskol
1eef956cad LogReader sourcing: return dict (#35994)
* new return type

* fix test

* why not
2025-08-14 19:19:37 -07:00
Shane Smiskol
43ad1754da LogReader: fix broken test (#35758)
fix lr test
2025-07-18 16:17:01 -07:00
Harald Schäfer
87a6e369aa Framereader: minor cleanup (#35577)
* No wrapping

* unused test

* another list

* mypy

* cleaner

* Revert "cleaner"

This reverts commit ccc1446b9d649d64b20175e22a66e135c44b21e5.

* mypy
2025-06-19 09:49:51 -07:00
Shane Smiskol
9da055853f LogReader clean ups (#33446)
* buggin me

* no caps

* remove at least one level of indirection

* no recursion, remove a bunch of junk

* default is now allfault ??

* back

* fix tests
old-commit-hash: 5796bf12b6dac4f3fc8e55ecd9785c73044d8a08
2024-09-03 18:34:18 -07:00
Shane Smiskol
4f019b5f60 move selfdrive/car to opendbc (#32630)
* move most of /car

* move some car tests

move some car tests

* fix selfdrive/car/tests

* fix selfdrive/controls tests

* fix the rest of the selfdrive tests

* bump opendbc

* fix all tests

* few more non-test references

* remove opcar and move docs to car

fix these debugging scripts

fix docs

* bump opendbc and panda

forgot panda
old-commit-hash: e735a7f379
2024-08-17 00:54:51 -07:00
Maxime Desroches
8adfc992e3 fix pytest tests (#32867)
* fix tests

* no dot
old-commit-hash: 6f10b8a209
2024-06-28 23:58:19 +00:00
Adeeb Shihadeh
86b6103657 test_*.py files are no longer executable (#32610)
* test_*.py files are no longer executable

* cleanup empty lines

* update precommit

* fixme

* enable

* build
old-commit-hash: c59887c810
2024-06-03 15:48:56 -07:00
cl0cks4fe
639a634f7c Unittest to pytest (#32366)
* add pytest-asyncio

* switch common

* switch selfdrive

* switch system

* switch tools

* small fixes

* fix setUp and valgrind pytest

* switch to setup

* fix random

* switch mock

* switch test_lateral_limits

* revert test_ui

* fix poetry.lock

* add unittest to banned-api

* add inline ignores to remaining unittest imports

* revert test_models

* revert check_can_parser_performance

* one more skip

---------

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
old-commit-hash: dd9d5d4528
2024-05-17 11:01:44 -07:00
Justin Newberry
b899592b18 cars: platform enums -> prepend brand name (#31927)
* with brand name

* migrate

* Fix

* fixes

* more

* passes

* fix

* fix the doc

* collects

* these too

* more stuff

* body exception :/

* more

* hardcode i guess

* update ref

* toyota

* more toyota

* and here

* final!

* fix notebooks and ccs

* move this here
old-commit-hash: b0eb3ba4f4
2024-03-19 17:29:50 -07:00
thenhnn
77d6d1a8f1 PlatformConfig: automatically get platform_str from the enum name (#31868)
* get platform_str from the enum name

* fix tests

* add migration table

* remove impossible todo

* Add link to PR in MIGRATION table

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

* Remove useless brand name comments and rename RAM_1500 to RAM_1500_5TH_GEN

* rename RAM_HD to RAM_HD_5TH_GEN

* rename references to RAM_HD and RAM_1500

* change "mock" to "MOCK" and rename torque data of Nissan Leaf 2018 IC

* remove MOCK from fingerprints.py

* change hard-coded car model in test_can_fingerprint.py/test_timing

* migration

* update ref

* space

* prius

---------

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
Co-authored-by: justin newberry <justin@comma.ai>
Co-authored-by: Justin Newberry <jnewberry0502@gmail.com>
old-commit-hash: 489528dcae
2024-03-19 11:16:02 -07:00
Shane Smiskol
bc7664aa2b LogReader: fix sort by time and union types (#31565)
* fix :(

* test_sort_by_time

* this isn't required

* not slow, and just compare sorted

* messy

* works

* clean up

* clean up

* not here

* clean up

* clean up

* clean up

* makes network call

---------

Co-authored-by: Justin Newberry <justin@comma.ai>
old-commit-hash: e964c5944d
2024-03-08 02:49:24 -08:00
Justin Newberry
6f9f45182b disable commaCarSegments tests (#31632)
disable this test too
old-commit-hash: f4a7e8eae6
2024-02-28 16:47:08 -08:00
Justin Newberry
c799790b9b move with_http_server to selfdrive/test/helpers (#31597)
* move

* fix
old-commit-hash: 9d1cafd0fc
2024-02-26 12:53:17 -08:00
Cameron Clough
9bd90112d0 use pyupgrade to update to new typing syntax (#31580)
* add pyupgrade hook

* run pyupgrade (pre-commit run -a)

* ruff --fix

* Revert "add pyupgrade hook"

This reverts commit 56ec18bb6b8602a0b612f3803d96cdad14b52066.

* revert changes to third_party/

* manual type fixes

* explicit Optional wrapping capnp objects
old-commit-hash: 995250ae49
2024-02-24 16:41:23 -08:00
Greg Hogan
b4479b4155 URLFile: default value test (#31544)
* URLFile: default value test

* cleanup

* fix env

* improvements

* fix GET response

* only delete cache dir if it exists

* env pop

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

---------

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
old-commit-hash: 43f64ec500
2024-02-22 13:17:02 -08:00
Shane Smiskol
aeb904d5da test_fw_query_on_routes: get first qlog (#31496)
* fast

* this isn't internal

* see
old-commit-hash: c5f1f4c676
2024-02-16 17:55:15 -08:00
Justin Newberry
8dbdd4736c test_logreader: test internal scenarios (#31484)
* test source scenario

* test source scenario

* fix
old-commit-hash: 16d1339553
2024-02-15 12:10:56 -08:00
Justin Newberry
42f292b3ce test_logreader: test interactive mode + fix typo in AUTO_INTERACTIVE (#31481)
* fix spelling

* test interactive

* remove that

* test taht

* move that
old-commit-hash: 8aee0d2af2
2024-02-15 11:24:27 -08:00
Justin Newberry
38fc6f9dd6 LogReader: retain old behavior for direct parsing of files (#31419)
* maintain exception

* test that head is not called

* annoying mock

* test with cache
old-commit-hash: 1436f576df
2024-02-14 10:05:25 -08:00
Shane Smiskol
9d941a9682 SegmentRange: more explicit slice matching (#31451)
* more explicit

* fix it

* use non capturing group

* only needed for regex101

* make test_logreader.py executable

* fix

* stash

* passes test

* none

* type anotate

* test

* fix

* nice for syntax highlighting
old-commit-hash: 796671fe1a
2024-02-14 04:36:58 -08:00
Shane Smiskol
5c16ae62d8 SegmentRange: simplify slice (#31455)
* simplify slicing

* rm
old-commit-hash: 8fe9bc7a69
2024-02-14 04:17:03 -08:00
Shane Smiskol
ae65a01afd SegmentRange: test API call (#31456)
* test

* better

* better
old-commit-hash: c4f7991bb6
2024-02-14 03:29:08 -08:00
Shane Smiskol
7afdb2393d SegmentRange: type annotations (#31453)
* type annotate SegmentRange

* proper formatting

* oops

* numpy?

format test too

* draft

* fixed

* clean up

* rm

* more

* clean up

* clean up

* rm

* not here

* revert
old-commit-hash: 8276371009
2024-02-14 02:05:55 -08:00
Shane Smiskol
4c7ad7f3b7 tools/lib: format code (#31454)
easier to read. pylint used to catch all this stuff, but it's mostly missing in ruff :'(
old-commit-hash: 0846175f44
2024-02-14 01:56:17 -08:00
Justin Newberry
02aea8b757 test_caching: use with_http_server (#31393)
use http server
old-commit-hash: 664a3c86ba
2024-02-09 20:06:11 -08:00
Justin Newberry
bcd22c1683 LogReader: test auto mode fallback (#31390)
* test auto mode

* better

* slow

* better
old-commit-hash: f873224235
2024-02-09 15:22:43 -08:00
Justin Newberry
3f934381fe test_logreader: test run_across_segments (#31305)
* more logreader tests

* not in ci for now

* enable cache
old-commit-hash: b17f24d68e
2024-02-05 18:35:12 -08:00
Justin Newberry
16e0907129 LogReader: add ``.filter`` (#31222)
add filter
old-commit-hash: c782fbc34e
2024-01-29 17:33:47 -08:00
Justin Newberry
7d76ac8eba LogReader: replace get_first_message with LogReader.first (#31146)
* first

* str
old-commit-hash: dd0c474e6c
2024-01-24 10:21:57 -08:00
Justin Newberry
67bb21219c LogReader: no redownloading on multiple iterations (#31141)
* no redownload

* sort
old-commit-hash: 88dcaa51c4
2024-01-23 23:54:11 -08:00
Justin Newberry
8768be968b LogReader: don't use route for max_segment (#31129)
* dont use route

* fix and cleanup
old-commit-hash: d574013d7b
2024-01-23 14:51:45 -08:00
Justin Newberry
0ae82f96c6 SegmentRange: __str__ get preferred format (#31126)
get canonical
old-commit-hash: 35e1e8ecd2
2024-01-23 11:40:22 -08:00
Justin Newberry
f447062b66 CommaCarSegments: public database of segments for each platform (#31114)
* comma car segments

* comma car segments for test_models

* oneliner

Co-authored-by: Shane Smiskol <shane@smiskol.com>

* better name

* not used here

* sort

* remove print

* better comment

---------

Co-authored-by: Shane Smiskol <shane@smiskol.com>
old-commit-hash: caa9153974
2024-01-22 17:33:03 -08:00
Justin Newberry
a9676e7086 auto_source: optimize api calls and use head to determine if file exists (#31025)
* fast

* catch all

* source

* fix file_exists

* remove duplicate reset

* test multiple loops

* iterations

* cleanup imports
old-commit-hash: 2967cada71
2024-01-16 17:24:37 -08:00
Justin Newberry
35dcd7ccd8 LogReader: support lists of identifiers (#31020)
* support lists of logs

* mark as slow instead
old-commit-hash: 0739d5d7b2
2024-01-16 10:40:00 -08:00
Adeeb Shihadeh
96e9a7d3ce CI: speedup unit test job (#30995)
* start

* mv to buildjet

* fix
old-commit-hash: e17e66180c
2024-01-13 21:16:35 -08:00
Justin Newberry
c8cc30112d rename segmentrangereader to logreader (#30981)
* Replace multilogiterator

* replace logreader

* update readme

* fix from_Bytes

* new section

* reset before iter

* selector

* fix internal

* whitespace
old-commit-hash: 3d73512c07
2024-01-12 12:53:50 -08:00
Justin Newberry
1b65d5cd85 segmentrangereader: support direct parsing (#30973)
* use correct source

* revert

* cleanup imports

* clean

* direct parsing

* rename

* move up

* fixes

* fix that

* better error message
old-commit-hash: eb09294fc2
2024-01-11 16:56:48 -08:00
Justin Newberry
11449845e7 segmentrangereader: support more sources (#30970)
* support more sources

* remove this
old-commit-hash: fb994ae782
2024-01-11 12:55:19 -08:00
Justin Newberry
3b86243f1f SegmentRangeReader: log type selector (#30960)
* log type selector

* test this too

* and this

* invalid selector

* use strenum

* don't hardcode size

* oneline
old-commit-hash: be814ed447
2024-01-11 10:25:24 -08:00
Justin Newberry
1f434b2714 SegmentRangeReader: new format for reading multiple segments (#30940)
* segment range reader

* rename that

* revert that

* cleanup

* revert this for now

* revert this for now

* Fix + test

* rm that

* rm that

* use for auto_fingerprint

* simpler

* for notebook too

* match numpy indexing

* just use numpy directly

* remove that

* spacing

* spacing

* use qlog for auto fingerprint

* add 'read mode'

* pass in read mode

* add test for modes

* numpy indexing

* fix that case

* more examples

* fix the notebook

* cleanup the notebook

* cleaner

* fix those
old-commit-hash: 0d126e1e9e
2024-01-10 11:55:19 -08:00
Justin Newberry
7aecd2f91d url_file: fix non-200 files being cached (#30886)
* fix + test

* fix unclosed

* easier to read

Co-authored-by: Shane Smiskol <shane@smiskol.com>

* fix that

---------

Co-authored-by: Shane Smiskol <shane@smiskol.com>
old-commit-hash: fba521ecc6
2024-01-02 12:42:08 -08:00
Justin Newberry
a9153302a3 URLFile: don't cache non-existent file's lengths (#30071)
* urlfile empty

* simplify with mock

* better test name

* PR cleanup

* cleanup the length file
old-commit-hash: fa51bbc236
2023-10-04 12:57:56 -07:00
Justin Newberry
dc6078a6c3 System: use paths for download folders too (#29818)
* use paths for download folders too

* trailing slash

* reset that
old-commit-hash: 73eda51a11
2023-09-07 12:49:03 -07:00
Justin Newberry
3b91610c0b Precommit: ensure executable bit is set (#29784)
* precommit ensure executable

* exclude tinygrad

* bump submodules

* exclude tinygrad globally
old-commit-hash: 4e69937d0d
2023-09-05 16:33:26 -07:00
Justin Newberry
1cc555c37b Tests: expand temporary directory helpers for more directories (#29735)
* create helpers for testing

* document it

* fix other tests
old-commit-hash: 405d09714c
2023-08-31 14:00:31 -07:00