Skip to content

Commit 533a4f2

Browse files
authored
fix integration test (#833)
1 parent 7b3935f commit 533a4f2

File tree

2 files changed

+24
-24
lines changed

2 files changed

+24
-24
lines changed

notebooks/5-1-gpaw.ipynb

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@
1818
"source": [
1919
"import subprocess\n",
2020
"from ase.build import bulk\n",
21-
"from atomistics.workflows.evcurve.helper import (\n",
22-
" analyse_structures_helper as evcurve_analyse_structures,\n",
23-
" generate_structures_helper as evcurve_generate_structures,\n",
21+
"from atomistics.workflows import (\n",
22+
" analyse_results_for_energy_volume_curve,\n",
23+
" get_tasks_for_energy_volume_curve,\n",
2424
")\n",
2525
"import matplotlib.pyplot as plt\n",
2626
"import pprint\n",
@@ -66,7 +66,7 @@
6666
"metadata": {},
6767
"outputs": [],
6868
"source": [
69-
"structure_dict = evcurve_generate_structures(\n",
69+
"task_dict = get_tasks_for_energy_volume_curve(\n",
7070
" structure=bulk(\"Al\", a=4.05, cubic=True),\n",
7171
" num_points=7,\n",
7272
" vol_range=0.05,\n",
@@ -77,7 +77,7 @@
7777
{
7878
"metadata": {},
7979
"cell_type": "markdown",
80-
"source": "The resulting dictionary of structures `structure_dict` is transformed to simplify the parallel execution:",
80+
"source": "The resulting dictionary of structures `task_dict` is transformed to simplify the parallel execution:",
8181
"id": "8bf60b7b0f5af31a"
8282
},
8383
{
@@ -87,7 +87,7 @@
8787
"metadata": {},
8888
"outputs": [],
8989
"source": [
90-
"task_loop_dict = {k: {\"calc_energy\": v} for k, v in structure_dict.items()}"
90+
"task_loop_dict = {k: {\"calc_energy\": v} for k, v in task_dict[\"calc_energy\"].items()}"
9191
]
9292
},
9393
{
@@ -219,12 +219,12 @@
219219
" task_dict=v, \n",
220220
" kpts=(3, 3, 3), \n",
221221
" encut=300,\n",
222-
" resource_dict={\"cores\": 2},\n",
222+
" resource_dict={\"cores\": 1},\n",
223223
" )\n",
224224
" sleep(1)\n",
225225
" pprint.pp(subprocess.check_output([\"flux\", \"jobs\", \"-a\"], universal_newlines=True).split(\"\\n\"))\n",
226226
" result_dict = {\n",
227-
" k: f.result()[-1] \n",
227+
" k: f.result()\n",
228228
" for k, f in tqdm(future_dict.items())\n",
229229
" }\n",
230230
" sleep(1)\n",
@@ -244,9 +244,9 @@
244244
"metadata": {},
245245
"outputs": [],
246246
"source": [
247-
"fit_dict = evcurve_analyse_structures(\n",
247+
"fit_dict = analyse_results_for_energy_volume_curve(\n",
248248
" output_dict={\"energy\": result_dict},\n",
249-
" structure_dict=structure_dict,\n",
249+
" task_dict=task_dict,\n",
250250
" fit_type=\"polynomial\",\n",
251251
" fit_order=3,\n",
252252
")"
@@ -416,12 +416,12 @@
416416
" task_dict=v, \n",
417417
" kpts=(3, 3, 3), \n",
418418
" encut=300,\n",
419-
" resource_dict={\"cores\": 2},\n",
419+
" resource_dict={\"cores\": 1},\n",
420420
" )\n",
421421
" sleep(1)\n",
422422
" pprint.pp(subprocess.check_output([\"flux\", \"jobs\", \"-a\"], universal_newlines=True).split(\"\\n\"))\n",
423423
" result_dict = {\n",
424-
" k: f.result()[-1] \n",
424+
" k: f.result()\n",
425425
" for k, f in tqdm(future_dict.items())\n",
426426
" }\n",
427427
" sleep(1)\n",
@@ -441,9 +441,9 @@
441441
"metadata": {},
442442
"outputs": [],
443443
"source": [
444-
"fit_dict = evcurve_analyse_structures(\n",
444+
"fit_dict = analyse_results_for_energy_volume_curve(\n",
445445
" output_dict={\"energy\": result_dict},\n",
446-
" structure_dict=structure_dict,\n",
446+
" task_dict=task_dict,\n",
447447
" fit_type=\"polynomial\",\n",
448448
" fit_order=3,\n",
449449
")"

notebooks/5-2-quantum-espresso.ipynb

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@
1919
"import os\n",
2020
"import subprocess\n",
2121
"from ase.build import bulk\n",
22-
"from atomistics.workflows.evcurve.helper import (\n",
23-
" analyse_structures_helper as evcurve_analyse_structures,\n",
24-
" generate_structures_helper as evcurve_generate_structures,\n",
22+
"from atomistics.workflows import (\n",
23+
" analyse_results_for_energy_volume_curve,\n",
24+
" get_tasks_for_energy_volume_curve,\n",
2525
")\n",
2626
"import matplotlib.pyplot as plt\n",
2727
"import pprint\n",
@@ -90,7 +90,7 @@
9090
"metadata": {},
9191
"outputs": [],
9292
"source": [
93-
"structure_dict = evcurve_generate_structures(\n",
93+
"task_dict = get_tasks_for_energy_volume_curve(\n",
9494
" structure=bulk(\"Al\", a=4.15, cubic=True),\n",
9595
" num_points=7,\n",
9696
" vol_range=0.05,\n",
@@ -101,7 +101,7 @@
101101
{
102102
"metadata": {},
103103
"cell_type": "markdown",
104-
"source": "The resulting dictionary of structures `structure_dict` is transformed to simplify the parallel execution:",
104+
"source": "The resulting dictionary of structures `task_dict` is transformed to simplify the parallel execution:",
105105
"id": "91dc9dc13d40835e"
106106
},
107107
{
@@ -111,7 +111,7 @@
111111
"metadata": {},
112112
"outputs": [],
113113
"source": [
114-
"task_loop_dict = {k: {\"calc_energy\": v} for k, v in structure_dict.items()}"
114+
"task_loop_dict = {k: {\"calc_energy\": v} for k, v in task_dict[\"calc_energy\"].items()}"
115115
]
116116
},
117117
{
@@ -273,9 +273,9 @@
273273
"metadata": {},
274274
"outputs": [],
275275
"source": [
276-
"fit_dict = evcurve_analyse_structures(\n",
276+
"fit_dict = analyse_results_for_energy_volume_curve(\n",
277277
" output_dict={\"energy\": result_dict},\n",
278-
" structure_dict=structure_dict,\n",
278+
" task_dict=task_dict,\n",
279279
" fit_type=\"polynomial\",\n",
280280
" fit_order=3,\n",
281281
")"
@@ -475,9 +475,9 @@
475475
"metadata": {},
476476
"outputs": [],
477477
"source": [
478-
"fit_dict = evcurve_analyse_structures(\n",
478+
"fit_dict = analyse_results_for_energy_volume_curve(\n",
479479
" output_dict={\"energy\": result_dict},\n",
480-
" structure_dict=structure_dict,\n",
480+
" task_dict=task_dict,\n",
481481
" fit_type=\"polynomial\",\n",
482482
" fit_order=3,\n",
483483
")"

0 commit comments

Comments
 (0)