-
Notifications
You must be signed in to change notification settings - Fork 18
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
Adding the download button for QeAppWorkChains. #850
Adding the download button for QeAppWorkChains. #850
Conversation
we provide a DownloadDataWidget to download, separately: - AiiDA archive: export_{node.pk}.aiida - AiiDA raw data export_{node.pk}_raw.zip both are zip files.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #850 +/- ##
==========================================
- Coverage 67.53% 67.10% -0.43%
==========================================
Files 50 51 +1
Lines 4620 4688 +68
==========================================
+ Hits 3120 3146 +26
- Misses 1500 1542 +42
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Hi @superstar54 and @AndresOrtegaGuerrero , this PR is ready for review. The main new thing is the Files are downloaded as zip archives. A part the implementation, which probably needs to be improved, only one issue: with google chrome the downloads are seen as insecure (I think because they are zip files, and we have http instead of https). Thanks! |
@mikibonacci thank you , do you think we can include the import aiida node , is too much for this PR ? |
Hi @AndresOrtegaGuerrero , thanks for looking at this PR. for the import button, I think I can do a second PR so we don't add too much to this one. But also, I am a bit concerned on what the user may try to upload... for example, maybe they expect that if a PwBaseWorkChain is imported, this will be visible in the app... but this is not always true (true only if we import the whole QeAppWorkChain). Actually, we should be safe enough, as the user typically will just export and import using the app buttons. To summarize, I think we can do it in another PR, maybe not a critical one. We have already the upload widget from euphonic vibro-app, so should be easy to use similar code and just play with the import API of AiiDA |
- only one `_download_data` method, which allow to download raw and .aiida data (once at the time). - QeAppWorkChain node is reloaded when the bitestream creation is done, this is needed to remain in the same Session (otherwise SQLAlchemy will complain that the Db request is not in the same session of the notebook.
Hi @AndresOrtegaGuerrero , I addressed the docstring and the download methods merging. I also put a reloading of the workchain node in the |
One question why the aiida file is saved as a zip? |
Hi @AndresOrtegaGuerrero , it is just the standard archive format when you create an archive (see this in aiida-core create.py file at line 173. What do you think? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @mikibonacci , thanks for the work!
One concern regarding large data. What if the download takes long time? Will it block the whole notebook?
I clicked the download button, and then went the step 1, I got this error:
DetachedInstanceError: Instance <DbNode at 0x7f05fd706280> is not bound to a Session; attribute refresh operation cannot proceed (Background on this error at: https://sqlalche.me/e/20/bhk3)
- moreover, flipped the button and the "Workflow completed successfully!" HTML.
…i/aiidalab-qe into feature/download_data
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @mikibonacci , thanks for the update. It's a good way to download it in another thread!
Maybe one bug: when download the raw
data, it always in this status: Downloading data...
Co-authored-by: Xing Wang <[email protected]>
Co-authored-by: Xing Wang <[email protected]>
Co-authored-by: Xing Wang <[email protected]>
…i/aiidalab-qe into feature/download_data
Hi @superstar54 , thanks for reviewing the PR. I addressed your valuable comments and suggestions. However, I don't understand the bug you mention: are the data downloaded in your local machine but the "Downloading data..." still there? Because if the data are a lot, it will take a while, and I think we should leave the string there up to completion |
In my test, tt's a small calculation, the |
This is needed for old AiiDA version which does not implement it.
Hi @superstar54 , I think I solved the issue. I just disable the raw data download if the ProcessDumper cannot be imported. I have not found a way to catch the error from the second thread (for now). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
* Adding the download button for QeAppWorkChains. we provide a DownloadDataWidget to download, separately: - AiiDA archive: export_{node.pk}.aiida - AiiDA raw data export_{node.pk}_raw.zip both are zip files. * Changing decode argument. * Branch for debugging the non persistency * improvements on the download widget: - only one `_download_data` method, which allow to download raw and .aiida data (once at the time). - QeAppWorkChain node is reloaded when the bitestream creation is done, this is needed to remain in the same Session (otherwise SQLAlchemy will complain that the Db request is not in the same session of the notebook. * Improving docstring. * Increasing time in test * Reverting the selenium wait time in testing * Download in a second thread, to not block the app. * Added description to the download buttons - moreover, flipped the button and the "Workflow completed successfully!" HTML. * Doubling the waiting time in the test_qe_app_select_silicon_and_confirm * Update src/aiidalab_qe/app/result/utils/download_data.py Co-authored-by: Xing Wang <[email protected]> * Update src/aiidalab_qe/app/result/utils/download_data.py Co-authored-by: Xing Wang <[email protected]> * Update src/aiidalab_qe/app/result/utils/download_data.py Co-authored-by: Xing Wang <[email protected]> * using Vertical box for buttons. * Adding a message if the process dumper is not available. This is needed for old AiiDA version which does not implement it. * Adding the linter disable for the trial ProcessDumper import * Adding init file in the new result/utils folder. --------- Co-authored-by: Xing Wang <[email protected]>
This fixes #823
We provide a DownloadDataWidget to download, separately:
both are zip files.