[go: nahoru, domu]

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

Filter DataGrid rows by multiple conditions #700

Merged
merged 5 commits into from
Nov 28, 2023

Conversation

c-bata
Copy link
Member
@c-bata c-bata commented Nov 16, 2023

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.

  • I agree this patch may be ported to Goptuna by other Goptuna contributors.

Reference Issues/PRs

Refs #696

What does this implement/fix? Explain your changes.

Filter DataGrid rows by multiple conditions.

Screenshot 2023-11-16 10 41 51

@c-bata c-bata marked this pull request as draft November 16, 2023 06:09
@c-bata
Copy link
Member Author
c-bata commented Nov 16, 2023

I'll make this PR ready for review once #698 will be merged.

Copy link
codecov bot commented Nov 16, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (bf7c930) 63.77% compared to head (fc77515) 65.23%.
Report is 23 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #700      +/-   ##
==========================================
+ Coverage   63.77%   65.23%   +1.46%     
==========================================
  Files          35       35              
  Lines        2280     2284       +4     
==========================================
+ Hits         1454     1490      +36     
+ Misses        826      794      -32     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@c-bata c-bata marked this pull request as ready for review November 16, 2023 07:45
@c-bata
Copy link
Member Author
c-bata commented Nov 16, 2023

@nabenabe0928 Could you review this PR?

Copy link
Collaborator
@nabenabe0928 nabenabe0928 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your PR!
I made some minor comments")

Btw, shall we add the tests for filterChoices in another PR or shall we do it in this PR?

optuna_dashboard/ts/components/DataGrid.tsx Outdated Show resolved Hide resolved
optuna_dashboard/ts/components/DataGrid.tsx Outdated Show resolved Hide resolved
optuna_dashboard/ts/components/DataGrid.tsx Outdated Show resolved Hide resolved
optuna_dashboard/ts/components/DataGrid.tsx Outdated Show resolved Hide resolved
optuna_dashboard/ts/components/DataGrid.tsx Show resolved Hide resolved
@nabenabe0928
Copy link
Collaborator

For the local test, I used the following:

import optuna

import numpy as np


def create_study_with_various_trials(storage: str) -> None:
    rng = np.random.RandomState(42)

    def _objective_intermediate_values(trial: optuna.Trial) -> float:
        x = trial.suggest_categorical("x", choices=["a", "b", "c"])
        rnd = rng.random()
        if rnd < 0.25:
            trial.report(trial.number, step=0)
            trial.report(trial.number + 1, step=1)
        elif rnd < 0.5:
            trial.report(trial.number, step=0)
            raise optuna.TrialPruned()
        elif rnd < 0.75:
            raise optuna.TrialPruned()
        else:
            raise ValueError("Unexpected Error.")

        return 0.0

    study = optuna.create_study(study_name="various-trials", storage=storage)
    study.optimize(_objective_intermediate_values, n_trials=40, catch=(Exception,))

create_study_with_various_trials(storage=storage)

@nabenabe0928 nabenabe0928 removed their assignment Nov 22, 2023
c-bata and others added 3 commits November 28, 2023 14:20
Co-authored-by: Shuhei Watanabe <47781922+nabenabe0928@users.noreply.github.com>
@c-bata
Copy link
Member Author
c-bata commented Nov 28, 2023

@nabenabe0928 Thank you for your review. I applied your suggestions.

Btw, shall we add the tests for filterChoices in another PR or shall we do it in this PR?

Yes, let us work on it in another PR.

Copy link
Collaborator
@nabenabe0928 nabenabe0928 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the changes, LGTM!

@c-bata c-bata merged commit c8dfa45 into optuna:main Nov 28, 2023
11 checks passed
@c-bata c-bata deleted the refactor-datagrid-filter branch November 28, 2023 08:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants