Skip to content

[Discussion] Consider maybe switching to a Reporter class #102

Description

@jwmueller

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:
        ...

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions