cleanlab / cleanlab/cleanvision

[Discussion] Consider maybe switching to a Reporter class

Open
#102 1 comment 0 reactions 0 assignees View on GitHub
question
Dominant language
Python
Stars
1.2k
Forks
83
PR merge metrics
No merged PRs in 30d

Description

Suggestion from @elisno (original [link](https://github.com/cleanlab/cleanvision/pull/91#discussion_r1106463546))

> 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.
```python
@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:
...
```

Contributor guide

Open the contributing guide

Research direction

Start by reviewing the existing Imagelab.report entry point and the report data named in the discussion: issues, issue_summary, and filtered results. Compare the proposed Reporter responsibilities, including report(), to_string(), to_html(), and __repr__, with the current reporting API; done requires an agreed design and implementation scope, which the issue does not yet provide.

Written by the indexing model from the issue text.

Assessment

Tech stack
pandas, python
Domain
backend-api-design, computer-vision
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.