Suggestion from @elisno (original link)
In the future, would you be open to exploring an OO-approach where the report data (issues, issue_summary, filtered results) in encapsulated in a separate object? The class would still take sensible defaults and allow us to add more parameters to it, while this methods has a shorter/more stable signature.
@dataclass
class Reporter:
issues: pd.Dataframe # Imagelab.issues still keeps track of filepaths, right?
issue_summary: pd.DataFrame
...
def __post_init__(self) -> None:
self._report: Any = # Initialize an empty "report" object
def report(self) -> "Self":
...
def to_string(self) -> str:
...
def to_html(self) -> str:
...
def __repr__(self) -> str:
...
class Imagelab:
def report(self, reporter: Optional[Reporter] = None) -> Reporter:
...
Suggestion from @elisno (original link)