Refactor method names for clarity and consistency across the application
Build and Push Docker Image / build-and-push (push) Has been cancelled

- Renamed `initialize_csv` to `_initialize_csv_file` in `DataManager` for better clarity.
- Updated method calls in `GraphManager` from `_create_toggle_controls` to `_create_chart_toggles` and `_on_toggle_changed` to `_handle_toggle_changed`.
- Changed method names in `MedTrackerApp` from `on_closing` to `handle_window_closing`, `add_entry` to `add_new_entry`, and `load_data` to `refresh_data_display`.
- Adjusted corresponding test method names in `TestMedTrackerApp` to reflect the new method names.
- Updated `UIManager` method names from `setup_icon` to `setup_application_icon` and adjusted related tests accordingly.
This commit is contained in:
William Valentin
2025-07-30 12:32:17 -07:00
parent e0faf20a56
commit b7c01bc373
6 changed files with 106 additions and 575 deletions
+4 -4
View File
@@ -31,7 +31,7 @@ class GraphManager:
self.control_frame.grid(row=0, column=0, sticky="ew", padx=5, pady=5)
# Create toggle checkboxes
self._create_toggle_controls()
self._create_chart_toggles()
# Create graph frame
self.graph_frame: ttk.Frame = ttk.Frame(self.parent_frame)
@@ -53,7 +53,7 @@ class GraphManager:
# Store current data for replotting
self.current_data: pd.DataFrame = pd.DataFrame()
def _create_toggle_controls(self) -> None:
def _create_chart_toggles(self) -> None:
"""Create toggle controls for chart elements."""
ttk.Label(self.control_frame, text="Show/Hide Elements:").pack(
side="left", padx=5
@@ -71,11 +71,11 @@ class GraphManager:
self.control_frame,
text=label,
variable=self.toggle_vars[key],
command=self._on_toggle_changed,
command=self._handle_toggle_changed,
)
checkbox.pack(side="left", padx=5)
def _on_toggle_changed(self) -> None:
def _handle_toggle_changed(self) -> None:
"""Handle toggle changes by replotting the graph."""
if not self.current_data.empty:
self._plot_graph_data(self.current_data)