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

Metrics redesign #1389

Draft
wants to merge 38 commits into
base: main
Choose a base branch
from
Draft

Metrics redesign #1389

wants to merge 38 commits into from

Conversation

Liraim
Copy link
Collaborator

@Liraim Liraim commented Dec 10, 2024

No description provided.

@Liraim Liraim marked this pull request as draft December 10, 2024 12:35

@dataclasses.dataclass
class ColumnInfo:
type: ColumnType
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

usually renamed as type_ to not collide with type

self.data = data


class Scorer:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

need to think about naming, this class most definitely does not do "scoring" :)

return ColumnType.Unknown


class DatasetColumn:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dataclass?

self._alias = alias

@abc.abstractmethod
def generate_data(self, dataset: "Dataset") -> Union[DatasetColumn, Dict[str, DatasetColumn]]:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I try to avoid unions, because every it means i will need to do instance check somewhere. How about we use general interface with a dict, but have something like SingleColumnScorer that will delegate this method to another abs method that returns a single DatasetColumn?

raise NotImplementedError()

@property
def alias(self) -> str:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why this is not a field?

class MetricResult:
_widget: Optional[List[BaseWidgetInfo]] = None

def set_widget(self, widget: List[BaseWidgetInfo]):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems redundant

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

Successfully merging this pull request may close these issues.

2 participants