Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
jwmueller opened this issue Feb 17, 2023 · 1 comment
Open

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

jwmueller opened this issue Feb 17, 2023 · 1 comment
Labels
question Further information is requested

Comments

@jwmueller
Copy link
Member

jwmueller commented Feb 17, 2023

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:
        ...
@jwmueller jwmueller changed the title Consider maybe switching to a Reporter class [Discussion] Consider maybe switching to a Reporter class Feb 17, 2023
@jwmueller jwmueller added the question Further information is requested label Feb 17, 2023
@jwmueller
Copy link
Member Author

question from @sanjanag : Where will the filtering arguments go?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant