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

Code fix/download csv #723

Merged
merged 34 commits into from
Dec 8, 2023
Merged

Conversation

eukaryo
Copy link
Contributor

@eukaryo eukaryo commented Dec 6, 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

I will take over this PR:
#648

What does this implement/fix? Explain your changes.

  • added a function to make a csv file in backend.
  • added a button to download the file in frontend. (in the bottom of TrialTable page)

Copy link

codecov bot commented Dec 6, 2023

Codecov Report

Attention: 2 lines in your changes are missing coverage. Please review.

Comparison is base (9e314a9) 67.20% compared to head (f63b5e9) 67.66%.
Report is 24 commits behind head on main.

Files Patch % Lines
optuna_dashboard/_app.py 94.59% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #723      +/-   ##
==========================================
+ Coverage   67.20%   67.66%   +0.46%     
==========================================
  Files          35       35              
  Lines        2293     2329      +36     
==========================================
+ Hits         1541     1576      +35     
- Misses        752      753       +1     

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

@eukaryo
Copy link
Contributor Author

eukaryo commented Dec 6, 2023

The download button appears like this:
スクリーンショット 2023-12-06 115350

@eukaryo eukaryo requested a review from c-bata December 6, 2023 04:33
@c-bata c-bata removed their request for review December 6, 2023 04:53
@c-bata
Copy link
Member

c-bata commented Dec 6, 2023

@nabenabe0928 @HideakiImamura 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 the PR, the new feature looks very convenient!
I checked the Python file for now and refactored a bit.

optuna_dashboard/_app.py Outdated Show resolved Hide resolved
optuna_dashboard/_app.py Outdated Show resolved Hide resolved
optuna_dashboard/_app.py Outdated Show resolved Hide resolved
optuna_dashboard/_app.py Outdated Show resolved Hide resolved
optuna_dashboard/_app.py Outdated Show resolved Hide resolved
optuna_dashboard/_app.py Outdated Show resolved Hide resolved
eukaryo and others added 3 commits December 6, 2023 16:26
Co-authored-by: Shuhei Watanabe <[email protected]>
Co-authored-by: Shuhei Watanabe <[email protected]>
Co-authored-by: Shuhei Watanabe <[email protected]>
Copy link
Member

@HideakiImamura HideakiImamura left a comment

Choose a reason for hiding this comment

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

I think you should check the all of studies in https://gist.github.com/HideakiImamura/668d6f5703c58255e54ece03cd270f2f.

@eukaryo
Copy link
Contributor Author

eukaryo commented Dec 6, 2023

I tried moving the button at the top, and making the text Download CSV file itself also as a part of button.
スクリーンショット 2023-12-06 184206

optuna_dashboard/ts/components/StudyDetail.tsx Outdated Show resolved Hide resolved
optuna_dashboard/ts/components/StudyDetail.tsx Outdated Show resolved Hide resolved
python_tests/test_csv_download.py Outdated Show resolved Hide resolved
python_tests/test_csv_download.py Outdated Show resolved Hide resolved
python_tests/test_csv_download.py Outdated Show resolved Hide resolved
python_tests/test_csv_download.py Outdated Show resolved Hide resolved
Copy link
Member

@HideakiImamura HideakiImamura left a comment

Choose a reason for hiding this comment

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

LGTM.

@HideakiImamura HideakiImamura removed their assignment Dec 7, 2023
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!!
I added simple tests, please check below.

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.

Sorry, I added simple tests.

python_tests/test_csv_download.py Outdated Show resolved Hide resolved
python_tests/test_csv_download.py Outdated Show resolved Hide resolved
python_tests/test_csv_download.py Show resolved Hide resolved
python_tests/test_csv_download.py Outdated Show resolved Hide resolved
python_tests/test_csv_download.py Outdated Show resolved Hide resolved
@eukaryo
Copy link
Contributor Author

eukaryo commented Dec 7, 2023

Thank you for adding the tests! I suppose there was another option to separate such expansions into a different PR, but for this instance, I think it's fine to include them in 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 adding the tests, LGTM!

@HideakiImamura HideakiImamura merged commit 4e3f168 into optuna:main Dec 8, 2023
17 checks passed
@HideakiImamura HideakiImamura added the enhancement New feature or request label Dec 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants