materialsproject / api

New API client for the Materials Project
https://materialsproject.github.io/api/
Other
105 stars 34 forks source link

How to obtain the k_vrh and g_vrh of the material #867

Open dream123321 opened 7 months ago

dream123321 commented 7 months ago

Problem

with MPRester("API_KEY") as mpr:
    docs = mpr.materials.summary.search(material_ids=['mp-66'],fields=['elements','k_vrh','g_vrh','band_gap'])

i = docs[0]
print(i.elements)
print(i.band_gap)

Result: [Element C] 4.1145

But add it after the code: print(i.k_vrh)

Result: File "/home/jh/mp/test.py", line 22, in print(i.k_vrh) File "/home/jh/anaconda3/envs/mp_test/lib/python3.10/site-packages/mp_api/client/core/client.py", line 925, in new_getattr raise AttributeError( AttributeError: 'MPDataDoc' object has no attribute 'k_vrh'

Proposed Solution

How to obtain the k_vrh and g_vrh of the material?

Alternatives

No response

munrojm commented 7 months ago

See this thread

dream123321 commented 7 months ago

See this thread

Thank you very much!