Skip to content

Commit 3247aa2

Browse files
authored
Merge pull request #103 from materialsproject/fix_download_notebook
Update `MPRester` import and add `has_props` to query in download notebook
2 parents b4b7d6b + d4608ea commit 3247aa2

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

notebooks/download_from_api.ipynb

+8-3
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
"metadata": {},
5454
"outputs": [],
5555
"source": [
56-
"from mp_api import MPRester\n",
56+
"from mp_api.client import MPRester\n",
5757
"with MPRester(API_KEY) as mpr:\n",
5858
" chgcar = mpr.get_charge_density_from_material_id(\"mp-149\")\n",
5959
"type(chgcar)"
@@ -137,9 +137,14 @@
137137
"metadata": {},
138138
"outputs": [],
139139
"source": [
140-
"from mp_api import MPRester\n",
140+
"from mp_api.client import MPRester\n",
141+
"from emmet.core.summary import HasProps\n",
142+
"\n",
141143
"with MPRester(API_KEY) as mpr:\n",
142-
" hexagonal_materials = mpr.summary.search(crystal_system=\"Hexagonal\", is_stable=True, fields=[\"material_id\"])"
144+
" hexagonal_materials = mpr.summary.search(crystal_system=\"Hexagonal\", \n",
145+
" is_stable=True,\n",
146+
" has_props=[HasProps.charge_density], \n",
147+
" fields=[\"material_id\"])"
143148
]
144149
},
145150
{

0 commit comments

Comments
 (0)