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

Feature/clean button #838

Merged
merged 9 commits into from
Oct 4, 2024
Merged

Conversation

mikibonacci
Copy link
Member

This fixes #815

For now, the clean remote data button is always shown for a finished workchain; if the remote folders are empty, the button is still there but is disabled. I am not sure if we should always display it, and that the name of the button is the best suited one.

waiting for some comments @AndresOrtegaGuerrero , @superstar54

also, modified a bit the logic of kill button (hidden by default,
as sometimes it is loaded - seen for a second - but not necessary)
Copy link

codecov bot commented Oct 3, 2024

Codecov Report

Attention: Patch coverage is 48.38710% with 16 lines in your changes missing coverage. Please review.

Project coverage is 67.84%. Comparing base (2b3963a) to head (0ad6b37).
Report is 89 commits behind head on main.

Files with missing lines Patch % Lines
src/aiidalab_qe/app/result/__init__.py 48.38% 16 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #838      +/-   ##
==========================================
- Coverage   67.95%   67.84%   -0.12%     
==========================================
  Files          50       50              
  Lines        4475     4503      +28     
==========================================
+ Hits         3041     3055      +14     
- Misses       1434     1448      +14     
Flag Coverage Δ
python-3.11 67.84% <48.38%> (-0.12%) ⬇️
python-3.9 67.87% <48.38%> (-0.12%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

def _update_clean_scratch_button_layout(self):
"""Update the layout of the kill button."""
# The button is hidden by default, but if we load a new process, we hide again.
if self.process is None or self.process == "":

Choose a reason for hiding this comment

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

if not self.process:

Copy link
Member Author

Choose a reason for hiding this comment

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

Done!

)
except (OSError, KeyError):
pass
self.clean_scratch_button.disabled = False not in cleaned_bool

Choose a reason for hiding this comment

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

not any(clean_bool)
Does this one work ?

Copy link
Member Author

@mikibonacci mikibonacci Oct 3, 2024

Choose a reason for hiding this comment

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

yes, I implemented self...disabled=all(cleaned_bool)

Copy link
Member

@AndresOrtegaGuerrero AndresOrtegaGuerrero left a comment

Choose a reason for hiding this comment

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

LGTM! , thank you Miki

@mikibonacci mikibonacci merged commit 73f2534 into aiidalab:main Oct 4, 2024
8 checks passed
@mikibonacci mikibonacci deleted the feature/clean_button branch October 4, 2024 09:32
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.

Add button to clean up the scratch
2 participants