mp-interns / eratosthenes

Intelligent sieving of material candidates for the computationally budget-conscious
BSD 2-Clause "Simplified" License
0 stars 2 forks source link

Getting current MP elasticity data #6

Closed dwinston closed 9 years ago

dwinston commented 9 years ago

@HGeerlings asked about simple programmatic access to MP's elastic constants data. While there are no specific methods in pymatgen's MPRester yet, you can use it's query method in consultation with our API repository to fish out what to do. All elasticity data for a material is stored under the 'elasticity' root level key. For example,

from pymatgen import MPRester
# Assuming you've done `export MAPI_KEY="USER_API_KEY"` at the command line
# See materialsproject.org/dashboard to get your API key
m = MPRester()
data = m.query(criteria={"elasticity": {"$exists": True}},
                         properties=["formula", "elasticity.K_VRH"])
# print("{} results".format(len(data)))
# data[:5]

Will give you bulk moduli and reduced cell formulae (see materialsproject/mapidoc#7 for a list of "aliases") for all MP materials that have elasticity data (you'd get tens of thousands of None-valued results if you set criteria={} above).

Let me know if there are issues getting the above to run for you.

HGeerlings commented 9 years ago

Seems to work great.

For reference, thought I would share a helpful link I found on the MP github (courtesy of Donny) that lists other elastic properties.

Thanks!

dwinston commented 9 years ago

OK, looks like everyone's up and running with this!