Add initial backend structure with models, utilities, and settings management

- Introduced .gitignore to exclude common Python artifacts and IDE files.
- Added contour models for contour generation.
- Implemented cryptographic utilities for data encryption and decryption.
- Created CSV metadata model for handling wafer data.
- Developed time-indexed data segment model.
- Established local settings model for application configuration.
- Added Z-wafer data models and parser for CSV file handling.
- Implemented Marching Squares algorithm for contour generation.
This commit is contained in:
Jack.Le
2026-04-23 11:40:47 -07:00
parent 50955c740e
commit e43bf258e3
10 changed files with 997 additions and 0 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)