-
Notifications
You must be signed in to change notification settings - Fork 513
[OPIK-668]: BaseMetric safer defaults #1826
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
base: main
Are you sure you want to change the base?
Conversation
Test Results0 tests 0 ✅ 0s ⏱️ Results for commit fd16bbb. |
Test Results0 tests 0 ✅ 0s ⏱️ Results for commit fd16bbb. ♻️ This comment has been updated with latest results. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's also get some eyes from the SDK team.
def __init__(self, name: str | None = None, track: bool = True) -> None: | ||
self.name = name if name is not None else self.__class__.__name__ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe the following would be enough:
def __init__(self, name: str = None, track: bool = True) -> None:
self.name = name if name is not None else self.__class__.__name__
Or even better:
def __init__(self, name: str = __class__.__name__, track: bool = True) -> None:
self.name = name
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ldaugusto @andrescrz
BaseMetric is not supposed to be instantiated directly, it's a base for other metric classes. So, there is no point in adding a default value to it at all, subclasses will have their own default names anyway.
I suggest closing the PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Test coverage?
…default
Details
Issues
Resolves #
Testing
Documentation