Skip to content

Commit 3dda96a

Browse files
authored
Merge pull request #8023 from jenshnielsen/fix_docs_rebuild
Ensure notebook runs correctly with non clean output folder
2 parents 5a71038 + 6595f11 commit 3dda96a

1 file changed

Lines changed: 74 additions & 42 deletions

File tree

docs/examples/DataSet/The-Experiment-Container.ipynb

Lines changed: 74 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
"metadata": {},
2323
"outputs": [],
2424
"source": [
25+
"import uuid\n",
2526
"from pathlib import Path\n",
2627
"\n",
2728
"from qcodes.dataset import (\n",
@@ -48,11 +49,14 @@
4849
},
4950
{
5051
"cell_type": "code",
51-
"execution_count": null,
52+
"execution_count": 2,
5253
"metadata": {},
5354
"outputs": [],
5455
"source": [
55-
"db_file_path = Path.cwd().parent / \"example_output\" / \"exp_container_tutorial.db\"\n",
56+
"db_file_path = (\n",
57+
" Path.cwd().parent / \"example_output\" / f\"exp_container_tutorial_{uuid.uuid4()}.db\"\n",
58+
")\n",
59+
"# we create a database with an uuid in the name to ensure we always start with a clean database for this tutorial\n",
5660
"initialise_or_create_database_at(db_file_path)"
5761
]
5862
},
@@ -145,12 +149,12 @@
145149
{
146150
"data": {
147151
"text/plain": [
148-
"[first_exp#old_sample#1@C:\\Users\\a-fbonabi\\temp_work\\exp_container_tutorial.db\n",
149-
" -----------------------------------------------------------------------------,\n",
150-
" second_exp#slightly_newer_sample#2@C:\\Users\\a-fbonabi\\temp_work\\exp_container_tutorial.db\n",
151-
" -----------------------------------------------------------------------------------------,\n",
152-
" third_exp#brand_new_sample#3@C:\\Users\\a-fbonabi\\temp_work\\exp_container_tutorial.db\n",
153-
" -----------------------------------------------------------------------------------]"
152+
"[first_exp#old_sample#1@d:\\source\\repos\\worktrees\\qcodes_docs_parallel\\docs\\examples\\example_output\\exp_container_tutorial_7ef46669-2463-4dfd-9da8-b03183d5c86e.db\n",
153+
" -----------------------------------------------------------------------------------------------------------------------------------------------------------------,\n",
154+
" second_exp#slightly_newer_sample#2@d:\\source\\repos\\worktrees\\qcodes_docs_parallel\\docs\\examples\\example_output\\exp_container_tutorial_7ef46669-2463-4dfd-9da8-b03183d5c86e.db\n",
155+
" -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------,\n",
156+
" third_exp#brand_new_sample#3@d:\\source\\repos\\worktrees\\qcodes_docs_parallel\\docs\\examples\\example_output\\exp_container_tutorial_7ef46669-2463-4dfd-9da8-b03183d5c86e.db\n",
157+
" -----------------------------------------------------------------------------------------------------------------------------------------------------------------------]"
154158
]
155159
},
156160
"execution_count": 6,
@@ -218,8 +222,8 @@
218222
{
219223
"data": {
220224
"text/plain": [
221-
"run_a #1@C:\\Users\\a-fbonabi\\temp_work\\exp_container_tutorial.db\n",
222-
"---------------------------------------------------------------"
225+
"run_a #1@d:\\source\\repos\\worktrees\\qcodes_docs_parallel\\docs\\examples\\example_output\\exp_container_tutorial_7ef46669-2463-4dfd-9da8-b03183d5c86e.db\n",
226+
"---------------------------------------------------------------------------------------------------------------------------------------------------"
223227
]
224228
},
225229
"execution_count": 8,
@@ -246,9 +250,9 @@
246250
{
247251
"data": {
248252
"text/plain": [
249-
"third_exp#brand_new_sample#3@C:\\Users\\a-fbonabi\\temp_work\\exp_container_tutorial.db\n",
250-
"-----------------------------------------------------------------------------------\n",
251-
"1-run_a-1--0"
253+
"third_exp#brand_new_sample#3@d:\\source\\repos\\worktrees\\qcodes_docs_parallel\\docs\\examples\\example_output\\exp_container_tutorial_7ef46669-2463-4dfd-9da8-b03183d5c86e.db\n",
254+
"-----------------------------------------------------------------------------------------------------------------------------------------------------------------------\n",
255+
"1-run_a-1-None-0"
252256
]
253257
},
254258
"execution_count": 9,
@@ -275,8 +279,8 @@
275279
{
276280
"data": {
277281
"text/plain": [
278-
"second_exp#slightly_newer_sample#2@C:\\Users\\a-fbonabi\\temp_work\\exp_container_tutorial.db\n",
279-
"-----------------------------------------------------------------------------------------"
282+
"second_exp#slightly_newer_sample#2@d:\\source\\repos\\worktrees\\qcodes_docs_parallel\\docs\\examples\\example_output\\exp_container_tutorial_7ef46669-2463-4dfd-9da8-b03183d5c86e.db\n",
283+
"-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------"
280284
]
281285
},
282286
"execution_count": 10,
@@ -323,8 +327,8 @@
323327
{
324328
"data": {
325329
"text/plain": [
326-
"first_run_b #2@C:\\Users\\a-fbonabi\\temp_work\\exp_container_tutorial.db\n",
327-
"---------------------------------------------------------------------"
330+
"first_run_b #2@d:\\source\\repos\\worktrees\\qcodes_docs_parallel\\docs\\examples\\example_output\\exp_container_tutorial_7ef46669-2463-4dfd-9da8-b03183d5c86e.db\n",
331+
"---------------------------------------------------------------------------------------------------------------------------------------------------------"
328332
]
329333
},
330334
"execution_count": 12,
@@ -344,8 +348,8 @@
344348
{
345349
"data": {
346350
"text/plain": [
347-
"second_run_b #3@C:\\Users\\a-fbonabi\\temp_work\\exp_container_tutorial.db\n",
348-
"----------------------------------------------------------------------"
351+
"second_run_b #3@d:\\source\\repos\\worktrees\\qcodes_docs_parallel\\docs\\examples\\example_output\\exp_container_tutorial_7ef46669-2463-4dfd-9da8-b03183d5c86e.db\n",
352+
"----------------------------------------------------------------------------------------------------------------------------------------------------------"
349353
]
350354
},
351355
"execution_count": 13,
@@ -372,10 +376,10 @@
372376
{
373377
"data": {
374378
"text/plain": [
375-
"second_exp#slightly_newer_sample#2@C:\\Users\\a-fbonabi\\temp_work\\exp_container_tutorial.db\n",
376-
"-----------------------------------------------------------------------------------------\n",
377-
"2-first_run_b-1--0\n",
378-
"3-second_run_b-2--0"
379+
"second_exp#slightly_newer_sample#2@d:\\source\\repos\\worktrees\\qcodes_docs_parallel\\docs\\examples\\example_output\\exp_container_tutorial_7ef46669-2463-4dfd-9da8-b03183d5c86e.db\n",
380+
"-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n",
381+
"2-first_run_b-1-None-0\n",
382+
"3-second_run_b-2-None-0"
379383
]
380384
},
381385
"execution_count": 14,
@@ -402,8 +406,8 @@
402406
{
403407
"data": {
404408
"text/plain": [
405-
"first_run #4@C:\\Users\\a-fbonabi\\temp_work\\exp_container_tutorial.db\n",
406-
"-------------------------------------------------------------------"
409+
"first_run #4@d:\\source\\repos\\worktrees\\qcodes_docs_parallel\\docs\\examples\\example_output\\exp_container_tutorial_7ef46669-2463-4dfd-9da8-b03183d5c86e.db\n",
410+
"-------------------------------------------------------------------------------------------------------------------------------------------------------"
407411
]
408412
},
409413
"execution_count": 15,
@@ -423,9 +427,9 @@
423427
{
424428
"data": {
425429
"text/plain": [
426-
"first_exp#old_sample#1@C:\\Users\\a-fbonabi\\temp_work\\exp_container_tutorial.db\n",
427-
"-----------------------------------------------------------------------------\n",
428-
"4-first_run-1--0"
430+
"first_exp#old_sample#1@d:\\source\\repos\\worktrees\\qcodes_docs_parallel\\docs\\examples\\example_output\\exp_container_tutorial_7ef46669-2463-4dfd-9da8-b03183d5c86e.db\n",
431+
"-----------------------------------------------------------------------------------------------------------------------------------------------------------------\n",
432+
"4-first_run-1-None-0"
429433
]
430434
},
431435
"execution_count": 16,
@@ -502,9 +506,9 @@
502506
{
503507
"data": {
504508
"text/plain": [
505-
"first_exp#old_sample#1@C:\\Users\\a-fbonabi\\temp_work\\exp_container_tutorial.db\n",
506-
"-----------------------------------------------------------------------------\n",
507-
"4-first_run-1--0"
509+
"first_exp#old_sample#1@d:\\source\\repos\\worktrees\\qcodes_docs_parallel\\docs\\examples\\example_output\\exp_container_tutorial_7ef46669-2463-4dfd-9da8-b03183d5c86e.db\n",
510+
"-----------------------------------------------------------------------------------------------------------------------------------------------------------------\n",
511+
"4-first_run-1-None-0"
508512
]
509513
},
510514
"execution_count": 19,
@@ -587,8 +591,8 @@
587591
{
588592
"data": {
589593
"text/plain": [
590-
"default_run #5@C:\\Users\\a-fbonabi\\temp_work\\exp_container_tutorial.db\n",
591-
"---------------------------------------------------------------------"
594+
"default_run #5@d:\\source\\repos\\worktrees\\qcodes_docs_parallel\\docs\\examples\\example_output\\exp_container_tutorial_7ef46669-2463-4dfd-9da8-b03183d5c86e.db\n",
595+
"---------------------------------------------------------------------------------------------------------------------------------------------------------"
592596
]
593597
},
594598
"execution_count": 23,
@@ -615,10 +619,10 @@
615619
{
616620
"data": {
617621
"text/plain": [
618-
"third_exp#brand_new_sample#3@C:\\Users\\a-fbonabi\\temp_work\\exp_container_tutorial.db\n",
619-
"-----------------------------------------------------------------------------------\n",
620-
"1-run_a-1--0\n",
621-
"5-default_run-2--0"
622+
"third_exp#brand_new_sample#3@d:\\source\\repos\\worktrees\\qcodes_docs_parallel\\docs\\examples\\example_output\\exp_container_tutorial_7ef46669-2463-4dfd-9da8-b03183d5c86e.db\n",
623+
"-----------------------------------------------------------------------------------------------------------------------------------------------------------------------\n",
624+
"1-run_a-1-None-0\n",
625+
"5-default_run-2-None-0"
622626
]
623627
},
624628
"execution_count": 24,
@@ -639,9 +643,23 @@
639643
},
640644
{
641645
"cell_type": "code",
642-
"execution_count": null,
646+
"execution_count": 25,
643647
"metadata": {},
644-
"outputs": [],
648+
"outputs": [
649+
{
650+
"data": {
651+
"text/plain": [
652+
"second_exp#slightly_newer_sample#2@d:\\source\\repos\\worktrees\\qcodes_docs_parallel\\docs\\examples\\example_output\\exp_container_tutorial_7ef46669-2463-4dfd-9da8-b03183d5c86e.db\n",
653+
"-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n",
654+
"2-first_run_b-1-None-0\n",
655+
"3-second_run_b-2-None-0"
656+
]
657+
},
658+
"execution_count": 25,
659+
"metadata": {},
660+
"output_type": "execute_result"
661+
}
662+
],
645663
"source": [
646664
"load_experiment_by_name(\n",
647665
" \"second_exp\", sample=\"slightly_newer_sample\"\n",
@@ -650,9 +668,23 @@
650668
},
651669
{
652670
"cell_type": "code",
653-
"execution_count": null,
671+
"execution_count": 26,
654672
"metadata": {},
655-
"outputs": [],
673+
"outputs": [
674+
{
675+
"data": {
676+
"text/plain": [
677+
"third_exp#brand_new_sample#3@d:\\source\\repos\\worktrees\\qcodes_docs_parallel\\docs\\examples\\example_output\\exp_container_tutorial_7ef46669-2463-4dfd-9da8-b03183d5c86e.db\n",
678+
"-----------------------------------------------------------------------------------------------------------------------------------------------------------------------\n",
679+
"1-run_a-1-None-0\n",
680+
"5-default_run-2-None-0"
681+
]
682+
},
683+
"execution_count": 26,
684+
"metadata": {},
685+
"output_type": "execute_result"
686+
}
687+
],
656688
"source": [
657689
"load_last_experiment() # loads the last experiment in the database"
658690
]
@@ -674,7 +706,7 @@
674706
"name": "python",
675707
"nbconvert_exporter": "python",
676708
"pygments_lexer": "ipython3",
677-
"version": "3.13.2"
709+
"version": "3.12.12"
678710
},
679711
"toc": {
680712
"base_numbering": 1,

0 commit comments

Comments
 (0)