Generalize config path. (#802)

* Generalize config path.

* Fix format.

* Fix typo.

[ROCm/rocprofiler-compute commit: 8585cd8e8f]
This commit is contained in:
xuchen-amd
2025-07-09 18:57:21 -04:00
committed by GitHub
parent f730199ef7
commit 9ebbf4bb03
2 changed files with 182 additions and 128 deletions
@@ -4,7 +4,8 @@ Panel Widget Modules
Contains the panel widgets used in the main layout.
"""
from typing import Any, Dict
from importlib import resources
from typing import Any, Dict, Optional
from textual.containers import ScrollableContainer
from textual.widgets import Label
@@ -15,12 +16,16 @@ from rocprof_compute_tui.widgets.collapsibles import build_all_sections
class AnalyzeView(ScrollableContainer):
"""Center panel with analysis results."""
def __init__(
self, config_path: str = "src/rocprof_compute_tui/utils/analyze_config.yaml"
):
def __init__(self, config_path: Optional[str] = None):
super().__init__(id="analyze-view")
self.dfs = {}
self.config_path = config_path
if config_path is None:
config_path = (
resources.files("rocprof_compute_tui.utils") / "analyze_config.yaml"
)
self.config_path = str(config_path)
def compose(self):
"""