Make the code pass lint checking

This commit is contained in:
porink0424
2024-08-07 16:14:05 +09:00
parent 159b6bfa93
commit 899be970ad
5 changed files with 32 additions and 34 deletions
+3 -1
View File
@@ -2,4 +2,6 @@ venv
.venv
standalone_app
vscode
tslib
tslib
jupyterlab
pkg
+2 -1
View File
@@ -3,7 +3,8 @@ try:
except ImportError:
# Fallback when using the package in dev mode without installing
# in editable mode with pip. It is highly recommended to install
# the package from a stable release or in editable mode: https://pip.pypa.io/en/stable/topics/local-project-installs/#editable-installs
# the package from a stable release or in editable mode:
# https://pip.pypa.io/en/stable/topics/local-project-installs/#editable-installs
import warnings
warnings.warn("Importing 'jupyterlab_optuna' outside a proper installation.")
__version__ = "dev"
+3 -1
View File
@@ -4,10 +4,11 @@ import json
import threading
from typing import TYPE_CHECKING
import tornado
from jupyter_server.base.handlers import APIHandler
from jupyter_server.utils import url_path_join
from optuna_dashboard.artifact._backend_to_store import to_artifact_store
import tornado
try:
from optuna.artifacts import FileSystemArtifactStore
@@ -19,6 +20,7 @@ from optuna_dashboard import wsgi
from tornado.web import FallbackHandler
from tornado.wsgi import WSGIContainer
if TYPE_CHECKING:
from _typeshed.wsgi import WSGIApplication
+23 -30
View File
@@ -114,6 +114,9 @@ export class JupyterlabAPIClient extends APIClient {
): Promise<void> =>
requestAPI<void>(`/api/studies/${studyId}`, {
method: "DELETE",
body: JSON.stringify({
remove_associated_artifacts: removeAssociatedArtifacts,
}),
}).then(() => {
return
})
@@ -177,16 +180,13 @@ export class JupyterlabAPIClient extends APIClient {
fileName: string,
dataUrl: string
): Promise<UploadArtifactAPIResponse> =>
requestAPI<UploadArtifactAPIResponse>(
`/api/artifacts/${studyId}`,
{
body: JSON.stringify({
file: dataUrl,
filename: fileName,
}),
method: "POST",
}
).then((res) => {
requestAPI<UploadArtifactAPIResponse>(`/api/artifacts/${studyId}`, {
body: JSON.stringify({
file: dataUrl,
filename: fileName,
}),
method: "POST",
}).then((res) => {
return res
})
deleteTrialArtifact = (
@@ -194,21 +194,15 @@ export class JupyterlabAPIClient extends APIClient {
trialId: number,
artifactId: string
): Promise<void> =>
requestAPI<void>(
`/api/artifacts/${studyId}/${trialId}/${artifactId}`,
{
method: "DELETE",
}
).then(() => {
requestAPI<void>(`/api/artifacts/${studyId}/${trialId}/${artifactId}`, {
method: "DELETE",
}).then(() => {
return
})
deleteStudyArtifact = (studyId: number, artifactId: string): Promise<void> =>
requestAPI<void>(
`/api/artifacts/${studyId}/${artifactId}`,
{
method: "DELETE",
}
).then(() => {
requestAPI<void>(`/api/artifacts/${studyId}/${artifactId}`, {
method: "DELETE",
}).then(() => {
return
})
tellTrial = async (
@@ -293,17 +287,16 @@ export class JupyterlabAPIClient extends APIClient {
}).then(() => {
return
})
getPlot = (studyId: number, plotType: PlotType): Promise<PlotResponse> =>
requestAPI<PlotResponse>(`/api/studies/${studyId}/plot/${plotType}`)
.then<PlotResponse>((res) => (res))
getPlot = (studyId: number, plotType: PlotType): Promise<PlotResponse> =>
requestAPI<PlotResponse>(
`/api/studies/${studyId}/plot/${plotType}`
).then<PlotResponse>((res) => res)
getCompareStudiesPlot = (
studyIds: number[],
plotType: CompareStudiesPlotType
): Promise<PlotResponse> => {
return requestAPI<PlotResponse>(
`/api/compare-studies/plot/${plotType}`, {
body: JSON.stringify({ study_ids: studyIds }),
}
).then<PlotResponse>((res) => (res))
return requestAPI<PlotResponse>(`/api/compare-studies/plot/${plotType}`, {
body: JSON.stringify({ study_ids: studyIds }),
}).then<PlotResponse>((res) => res)
}
}
@@ -182,7 +182,7 @@ const StartDashboardForm: FC<{
artifact_path: artifactPath,
}),
})
.then((res) => {
.then((_res) => {
setLoading(false)
showOptunaDashboard()
})