FileReader #5

Merged
bacant150 merged 15 commits from lab1_huranets into lab1 2026-02-26 10:04:10 +02:00
Showing only changes of commit 9473c5a621 - Show all commits

View File

@@ -74,8 +74,10 @@ class FileDatasource:
self._acc_reader = csv.reader(self._acc_f, skipinitialspace=True)
self._gps_reader = csv.reader(self._gps_f, skipinitialspace=True)
VladiusVostokus commented 2026-02-25 11:20:05 +02:00 (Migrated from github.com)
Review

You just can not return this variable from _detect_header_and_buffer() if it is not used

You just can not return this variable from _detect_header_and_buffer() if it is not used
bacant150 commented 2026-02-25 12:36:28 +02:00 (Migrated from github.com)
Review

removed unnecessary variables from _detect_header_and_buffer() and fixed the _rewind_acc() and _rewind_gps() methods

removed unnecessary variables from _detect_header_and_buffer() and fixed the _rewind_acc() and _rewind_gps() methods
self._rewind_acc()
self._rewind_gps()
# File pointer is already at 0 right after open(), so no need to rewind here.
# Skip header row once.
VladiusVostokus commented 2026-02-25 16:05:28 +02:00 (Migrated from github.com)
Review

if you open file, your read pointer is already 0, why to set it to 0 again?

if you open file, your read pointer is already 0, why to set it to 0 again?
bacant150 commented 2026-02-25 21:09:54 +02:00 (Migrated from github.com)
Review

I removed the unnecessary rewind from _open_files().

I removed the unnecessary rewind from _open_files().
next(self._acc_reader, None)
next(self._gps_reader, None)
def _close_files(self) -> None:
for f in (self._acc_f, self._gps_f):