Skip to content

Commit 35aa49b

Browse files
committed
update: set pseudo
1 parent 74069ac commit 35aa49b

File tree

1 file changed

+30
-17
lines changed

1 file changed

+30
-17
lines changed

other/materials_designer/specific_examples/run_bandgap_workflow.ipynb

Lines changed: 30 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,33 @@
3333
"id": "51105b005c535ca"
3434
},
3535
{
36-
"metadata": {},
36+
"metadata": {
37+
"ExecuteTime": {
38+
"end_time": "2025-06-30T17:49:35.443494Z",
39+
"start_time": "2025-06-30T17:49:35.381267Z"
40+
}
41+
},
3742
"cell_type": "code",
3843
"source": [
3944
"from mat3ra.api import ApiClient\n",
4045
"# Log in to get the API token\n",
4146
"auth_config = await ApiClient().login()"
4247
],
4348
"id": "23626cb27f6e7206",
44-
"outputs": [],
45-
"execution_count": null
49+
"outputs": [
50+
{
51+
"ename": "ModuleNotFoundError",
52+
"evalue": "No module named 'mat3ra.api'",
53+
"output_type": "error",
54+
"traceback": [
55+
"\u001B[0;31m---------------------------------------------------------------------------\u001B[0m",
56+
"\u001B[0;31mModuleNotFoundError\u001B[0m Traceback (most recent call last)",
57+
"Cell \u001B[0;32mIn[2], line 1\u001B[0m\n\u001B[0;32m----> 1\u001B[0m \u001B[38;5;28;01mfrom\u001B[39;00m\u001B[38;5;250m \u001B[39m\u001B[38;5;21;01mmat3ra\u001B[39;00m\u001B[38;5;21;01m.\u001B[39;00m\u001B[38;5;21;01mapi\u001B[39;00m\u001B[38;5;250m \u001B[39m\u001B[38;5;28;01mimport\u001B[39;00m ApiClient\n\u001B[1;32m 2\u001B[0m \u001B[38;5;66;03m# Log in to get the API token\u001B[39;00m\n\u001B[1;32m 3\u001B[0m auth_config \u001B[38;5;241m=\u001B[39m \u001B[38;5;28;01mawait\u001B[39;00m ApiClient()\u001B[38;5;241m.\u001B[39mlogin()\n",
58+
"\u001B[0;31mModuleNotFoundError\u001B[0m: No module named 'mat3ra.api'"
59+
]
60+
}
61+
],
62+
"execution_count": 2
4663
},
4764
{
4865
"metadata": {},
@@ -96,7 +113,7 @@
96113
{
97114
"metadata": {},
98115
"cell_type": "markdown",
99-
"source": "## 5. Create workflow",
116+
"source": "## 5. Get workflow and adjust its parameters",
100117
"id": "9bdd00f870caaeeb"
101118
},
102119
{
@@ -105,15 +122,12 @@
105122
"outputs": [],
106123
"execution_count": null,
107124
"source": [
108-
"from mat3ra.wode.workflow.vasp.band_structure import create_band_structure_workflow\n",
125+
"from mat3ra.wode.workflow.vasp.band_structure import BandStructureWorkflow\n",
126+
"from mat3ra.wode.pseudopotentials import PseudopotentialEnum\n",
109127
"\n",
110-
"band_gap_workflow = create_band_structure_workflow(\n",
111-
" material=material,\n",
112-
" kpoints=kpoints,\n",
113-
" cutoff=cutoff,\n",
114-
" smearing=smearing,\n",
115-
" number_of_bands=number_of_bands\n",
116-
")"
128+
"workflow = BandStructureWorkflow()\n",
129+
"workflow.set_kpoints(kpoints)\n",
130+
"workflow.set_pseudopotential(PseudopotentialEnum.PAW_HSE) # elements will be set automatically based on the material"
117131
],
118132
"id": "68d43f6c797f2fc4"
119133
},
@@ -129,9 +143,9 @@
129143
"outputs": [],
130144
"execution_count": null,
131145
"source": [
132-
"from mat3ra.wode.compute import ComputeConfiguration, QueueTypes\n",
146+
"from mat3ra.wode.compute import ComputeConfiguration, QueueEnum\n",
133147
"compute_config = ComputeConfiguration(\n",
134-
" queue = QueueTypes.OR8,\n",
148+
" queue = QueueEnum.OR8,\n",
135149
" nodes = 1,\n",
136150
" cores = 8,\n",
137151
")"
@@ -150,9 +164,8 @@
150164
"outputs": [],
151165
"execution_count": null,
152166
"source": [
153-
"from mat3ra.wode.job import JobConfiguration, create_job\n",
154-
"job_config = JobConfiguration(workflow=band_gap_workflow, material=material, compute = compute_config)\n",
155-
"job = create_job(job_config, auth_config=auth_config)\n",
167+
"from mat3ra.wode.job import create_job\n",
168+
"job = create_job(workflow=workflow, material=material, compute = compute_config, auth_config=auth_config)\n",
156169
"job.run()\n",
157170
"job.wait_for_complete()\n",
158171
"# job.check_status()\n",

0 commit comments

Comments
 (0)