Skip to content

Commit

Permalink
Merge pull request #103 from materialsproject/fix_download_notebook
Browse files Browse the repository at this point in the history
Update `MPRester` import and add `has_props` to query in download notebook
  • Loading branch information
jmmshn authored Oct 3, 2022
2 parents b4b7d6b + d4608ea commit 3247aa2
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions notebooks/download_from_api.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
"metadata": {},
"outputs": [],
"source": [
"from mp_api import MPRester\n",
"from mp_api.client import MPRester\n",
"with MPRester(API_KEY) as mpr:\n",
" chgcar = mpr.get_charge_density_from_material_id(\"mp-149\")\n",
"type(chgcar)"
Expand Down Expand Up @@ -137,9 +137,14 @@
"metadata": {},
"outputs": [],
"source": [
"from mp_api import MPRester\n",
"from mp_api.client import MPRester\n",
"from emmet.core.summary import HasProps\n",
"\n",
"with MPRester(API_KEY) as mpr:\n",
" hexagonal_materials = mpr.summary.search(crystal_system=\"Hexagonal\", is_stable=True, fields=[\"material_id\"])"
" hexagonal_materials = mpr.summary.search(crystal_system=\"Hexagonal\", \n",
" is_stable=True,\n",
" has_props=[HasProps.charge_density], \n",
" fields=[\"material_id\"])"
]
},
{
Expand Down

0 comments on commit 3247aa2

Please sign in to comment.