Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "examples/facets/ext/facets"]
path = examples/facets/ext/facets
url = git@gitlab.esrf.fr:polack/facets
4 changes: 4 additions & 0 deletions examples/facets/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.ipynb_checkpoints/
__pycache__

/*.lock
47 changes: 47 additions & 0 deletions examples/facets/README.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
= Facets Runner

Example of a complete exploitation workflow using Ewoks helpers driven from Jupyter
notebooks.

This is a work in progress:
The code uses a patchwork of existing processes, some of it reworked using generative AI.

Do not rely on anything in here other than for ephemeral tests.

== Using the repository

=== Initialisation

[,sh]
----
git clone --filter=blob:none --no-checkout --depth 1 -b facets_workflow https://github.com/epolack/cdiutils facets_workflow
cd facets_workflow
git sparse-checkout set examples/facets
git submodule update --init
----

=== Creating a kernel

[,sh]
----
poetry lock && poetry install
poetry run python -m ipykernel install --user --name="facets" --display-name="Facets"
----
or directly with _uv_.
[,sh]
----
uv run python -m ipykernel install --user --name="facets" --display-name="Facets"
----

=== Run Jupyter locally with a with kerneldequate

[,sh]
----
poetry lock && poetry install
poetry run jupyter lab --no-browser [--NotebookApp.token='']
----
or directly with _uv_.
[,sh]
----
uv run jupyter lab --no-browser [--NotebookApp.token='']
----
1 change: 1 addition & 0 deletions examples/facets/ext/facets
Submodule facets added at 77a574
67 changes: 67 additions & 0 deletions examples/facets/notebooks/00_master.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
{
"cells": [
{
"cell_type": "markdown",
"id": "2bc58d0e-d10f-4a12-a9aa-ec678028fb98",
"metadata": {},
"source": [
"# Full-circle Atomistic Comparison of Experiment, Theory and Simulation\n",
"\n",
"Runs all notebooks.\n",
"\n",
"Parameters should be set only in the first notebook.\n",
"\n",
"Could use papermill for tests\n",
"```bash\n",
"papermill notebook_1.ipynb executed_notebook_1.ipynb\n",
"```"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "21b2b9a1-368b-448d-9967-5864d938ff30",
"metadata": {},
"outputs": [],
"source": [
"%%time\n",
"import os\n",
"project_root = os.getcwd()\n",
"\n",
"notebooks_to_run = [\"01_experiment.ipynb\", \"02_theory.ipynb\", \"03_simulation.ipynb\", \"04_facets.ipynb\"]\n",
"\n",
"for notebook in notebooks_to_run:\n",
" os.chdir(project_root)\n",
" %run ./{notebook}"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Facets",
"language": "python",
"name": "facets"
},
"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.13.5"
},
"widgets": {
"application/vnd.jupyter.widget-state+json": {
"state": {},
"version_major": 2,
"version_minor": 0
}
}
},
"nbformat": 4,
"nbformat_minor": 5
}
Loading
Loading