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

Fix unit test with optuna master #793

Merged
merged 1 commit into from
Feb 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Fix unit test with optuna master
keisuke-umezawa committed Feb 6, 2024
commit 522b6ff836ba4068b545001c382ac65db291c8d3
4 changes: 2 additions & 2 deletions python_tests/test_cached_extra_study_property.py
Original file line number Diff line number Diff line change
@@ -132,7 +132,7 @@ def test_contains_failed_trials(self) -> None:
create_trial(
state=TrialState.COMPLETE, value=0, distributions=distributions, params=params
),
create_trial(state=TrialState.FAIL, value=0, distributions={}, params={}),
create_trial(state=TrialState.FAIL, value=None, distributions={}, params={}),
create_trial(
state=TrialState.COMPLETE, value=0, distributions=distributions, params=params
),
@@ -235,7 +235,7 @@ def test_contains_failed_trials(self) -> None:
),
create_trial(
state=TrialState.FAIL,
value=0,
value=None,
distributions={},
params={},
user_attrs={"bar": "bar"},

Unchanged files with check annotations Beta

@app.get("/api/compare-studies/plot/<plot_type>")
@json_api_view
def get_compare_studies_plot(plot_type: str) -> dict[str, Any]:
study_ids = map(int, request.query.getall("study_ids[]"))
studies = [

Check warning on line 295 in optuna_dashboard/_app.py

Codecov / codecov/patch

optuna_dashboard/_app.py#L294-L295

Added lines #L294 - L295 were not covered by tests
optuna.load_study(study_name=storage.get_study_name_from_id(study_id), storage=storage)
for study_id in study_ids
]
if plot_type == "edf":
fig = optuna.visualization.plot_edf(studies)

Check warning on line 300 in optuna_dashboard/_app.py

Codecov / codecov/patch

optuna_dashboard/_app.py#L299-L300

Added lines #L299 - L300 were not covered by tests
else:
response.status = 404 # Not found
return {"reason": f"plot_type={plot_type} is not supported."}
return fig.to_json()

Check warning on line 304 in optuna_dashboard/_app.py

Codecov / codecov/patch

optuna_dashboard/_app.py#L302-L304

Added lines #L302 - L304 were not covered by tests
@app.put("/api/studies/<study_id:int>/note")
@json_api_view