-
Notifications
You must be signed in to change notification settings - Fork 4
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
[Feature] Change study to a property #5
Conversation
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.
Thanks for the contribution. BTW, please install pre-commit
so that makes code lint.
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.
LGTM
mqboost/engine.py
Outdated
|
||
@property | ||
def study(self) -> optuna.Study: | ||
return self._study |
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.
Could you replace this line with something like:
return self._study | |
return getattr(self, "_study", None) |
This helps prevent calling a variable before it's assigned.
What does this PR do?
Change
optuna.Study
to property.How to test this?