greetings
i am a new user and started my work recently, i got to know a little bit about the API from here but there are still things that i am confused
like sometimes i see people could download a certain data in a certain field but now i cant do that or even if i could , the results would be none, even though i know there are proper data in the website but cant download properly while using api like bulk modules or shear modules ( just example but there are more fields like these)
or i know there is a pymatgen analysis and i used it to some extent but i do not know how to get atomic fraction or other things like that
so here i am , wondering if there is an active group or chat that i could ask for guidance for current new API and if there is a good accessible library with code examples , would be great if someone could help me out
with MPRester(“api_key”) as mpr:
docs = mpr.materials.summary.search(total_magnetization=(89,90),
fields=[“bulk_modulus”, “shear_modulus”])
bulk_modulus_voigt = docs.bulk_modulus["voigt"]
bulk_modulus_reuss = docs.bulk_modulus["reuss"]
bulk_modulus_vrh = docs.bulk_modulus["vrh"]
shear_modulus_voigt = docs.shear_modulus["voigt"]
shear_modulus_reuss = docs.shear_modulus["reuss"]
shear_modulus_vrh = docs.shear_modulus["vrh"]
i am using this code and other codes like this method and they end up with none answers
also that total magnetization limit was just to decrease the number of materials so code would be lighter to change again and check the results
with regards
pedram
That is the correct code to get the bulk and shear modulus. If the value of the entry is None
after explicitly asking for it, it means we do not have the data for that entry. In this particular case, it looks like we don’t have bulk and shear modulus values calculated for any materials with a bulk total magnetization between 89 and 90.
– Jason
thanks a lot for responding , i was looking at the materials project data in matminer , it was last updated in 2018, and all of them had the bulk and shear modules
and also in materials project website when you change the value for bulk or shear modules(also putting the total magnetization 0_300 fixed) the number of materials after searching would change even thought they are none or _ , this made me think some of them should have values cause system response was changing , there was alot of materials so i did not check them all and just assumed i am doing something wrong with the code , but now i can move on
thanks again
also a quick question , if its not a bother, do you happen to know a place i can see code examples for analysis of raw data like formula and structure and after processing the data the code would generate new features like atomic fraction,and things like that?
No problem. I don’t have one resource to point you to other than the docs pages of mp-api, pymatgen, and matminer. You can also check out the workshop, even though the code is not updated (GitHub - materialsproject/workshop: The Materials Project Workshop Curriculum). In general, I would advise you to post a specific goal you have alongside the data you are working with and any relevant code snippets to this forum.
– Jason