forked from aiidalab/aiidalab-qe
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement example archive importer (aiidalab#1126)
This PR implements a new notebook (linked from the home page via new button) to import example calculations from aiidalab-qe-examples, per request (aiidalab#1117)
- Loading branch information
1 parent
192050d
commit 4dd3741
Showing
4 changed files
with
251 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": { | ||
"vscode": { | ||
"languageId": "javascript" | ||
} | ||
}, | ||
"outputs": [], | ||
"source": [ | ||
"%%javascript\n", | ||
"IPython.OutputArea.prototype._should_scroll = function(lines) {\n", | ||
" return false;\n", | ||
"}\n", | ||
"document.title='AiiDAlab QE | Import examples'" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"%%capture\n", | ||
"from aiida import load_profile\n", | ||
"\n", | ||
"load_profile()" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"%%capture\n", | ||
"from aiidalab_widgets_base.utils.loaders import load_css\n", | ||
"\n", | ||
"load_css(css_path=\"src/aiidalab_qe/app/static/styles\")" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"# AiiDAlab Quantum ESPRESSO - Example calculations\n", | ||
"\n", | ||
"We provide here a set of example calculations performed with the AiiDAlab Quantum ESPRESSO app for you to import into your AiiDA instance. Choose one or more examples to import, then click the **<span style=\"color: #4caf50;\"><i class=\"fa fa-download\"></i> Import</span>** button. A report on each import will be appended to the log below. Once imported, you can click the **<span style=\"color: #2196f3;\"><i class=\"fa fa-list\"></i> Calculation history</span>** button to view details of any given imported calculation and/or launch it in an instance of the app to view its inputs and outputs.\n", | ||
"\n", | ||
"If you have any questions or issues regarding the examples, please open an issue in the [aiidalab-qe-examples](https://github.com/aiidalab/aiidalab-qe-examples) repository.\n" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"from aiidalab_qe.common.widgets import ArchiveImporter\n", | ||
"\n", | ||
"importer = ArchiveImporter(\n", | ||
" repo=\"aiidalab/aiidalab-qe-examples\",\n", | ||
" branch=\"main\",\n", | ||
" archive_list=\"examples_list.txt\",\n", | ||
" archives_dir=\"examples\",\n", | ||
" logger={\n", | ||
" \"placeholder\": \"Archive import output will be shown here.\",\n", | ||
" \"clear_on_import\": True,\n", | ||
" },\n", | ||
")\n", | ||
"importer" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"importer.render()" | ||
] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "base", | ||
"language": "python", | ||
"name": "python3" | ||
}, | ||
"language_info": { | ||
"codemirror_mode": { | ||
"name": "ipython", | ||
"version": 3 | ||
}, | ||
"file_extension": ".py", | ||
"mimetype": "text/x-python", | ||
"name": "python", | ||
"nbconvert_exporter": "python", | ||
"pygments_lexer": "ipython3", | ||
"version": "3.9.13" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 2 | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters