refactor: prune orphaned attic modules and standardize project configurations

- Move orphaned modules (data_segment.py, contour_models.py, marching_squares.py) to attic/.
- Standardize local settings logic, serial port parameters, and graph view plots.
- Update pyproject.toml pyside6-project dependencies and configure gitignore.
This commit is contained in:
jack
2026-06-18 17:09:24 -07:00
parent 93868bcde4
commit 5514653b94
14 changed files with 23 additions and 47 deletions
+55
View File
@@ -0,0 +1,55 @@
from datetime import datetime, timedelta
# ===== Time-Indexed Data Segment =====
class DataSegment:
# ===== Lifecycle =====
def __init__(
self,
full_data: list[float],
start_time: datetime,
start_index: int,
end_index: int,
):
if not isinstance(start_index, int):
raise TypeError("start_index must be an integer")
if not isinstance(end_index, int):
raise TypeError("end_index must be an integer")
"""
full_data: The complete list of sensor readings.
start_time: The timestamp of the very first reading in full_data.
start_index: The offset (in seconds) from start_time to the beginning of this segment.
end_index: The offset (in seconds) from start_time to the end of this segment.
"""
self.full_data = full_data
self._base_start_time = start_time
self._start_index = start_index
self._end_index = end_index
self.chamber = ""
self.notes = ""
# ===== Index Properties =====
@property
def start_index(self) -> int:
return self._start_index
@start_index.setter
def start_index(self, value: int):
self._start_index = value
@property
def end_index(self) -> int:
return self._end_index
@end_index.setter
def end_index(self, value: int):
self._end_index = value
# ===== Derived Time Properties =====
@property
def start_time(self) -> datetime:
return self._base_start_time + timedelta(seconds=self.start_index)
@property
def end_time(self) -> datetime:
return self._base_start_time + timedelta(seconds=self.end_index)