-
-
Notifications
You must be signed in to change notification settings - Fork 83
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
Resolve plotly.py dependency issue #773
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.
Looks good to me. I left one suggestion though.
const plotlypyIsAvailable = useRecoilValue<boolean>(plotlypyIsAvailableState) | ||
if (query.get("plotlypy_rendering") === "true") { | ||
return <ContourBackend study={study} /> | ||
if (plotlypyIsAvailable) { | ||
return <ContourBackend study={study} /> | ||
} else { | ||
console.warn( | ||
"Use frontend rendering because plotlypy is specified but not available." | ||
) | ||
return <ContourFrontend study={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.
Perhaps, we could define the following wrapper function in state.ts
:
export const usePlotlypyIsAvailable = (): boolean => {
const query = useQuery()
const plotlypyIsAvailable = useRecoilValue<boolean>(plotlypyIsAvailableState)
if (query.get("plotlypy_rendering") === "true") {
if (plotlyPyIsAvailable) {
return true
}
console.warn(...)
}
return false
}
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.
Furthermore, we could use notistack to show a warning message to users like below:
optuna-dashboard/optuna_dashboard/ts/action.ts
Lines 234 to 236 in 8033e79
enqueueSnackbar(`Failed to fetch study list.`, { | |
variant: "error", | |
}) |
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.
Yeah, I will introduce this function when I implement backend rendering of other graphs 👍
Thanks for the review! I worked on #773 (comment) by another PR: #778. Let me merge this now. |
Contributor License Agreement
This repository (
optuna-dashboard
) and Goptuna share common code.This pull request may therefore be ported to Goptuna.
Make sure that you understand the consequences concerning licenses and check the box below if you accept the term before creating this pull request.
Reference Issues/PRs
Follow-up of #764
What does this implement/fix? Explain your changes.