get_dataframe

Hello there,

I am new to matminer so if the question has been answered elsewhere please provide the link.

I would like to retrieve selected data from MP and Citrine (I do have the API_KEY for both database), using get_dataframe, based on the following criteria:

  • Cubic spacegroup

  • Some elasticity range

  • Hardness threshold

  • others properties

I was able to run some of the existing notebooks, but they are limited to what want to achieve.

Any example that some of you may have already explored is highly appreciated.

Best,

Brahim

Hi there,

For both classes (MPDataRetrieval and CitrineDataRetrieval), you should be able to set the request criteria through the “criteria” argument as a dictionary.

For info on how to make these dictionaries (setting the right keys, etc.), I’d recommend checking out the following resources:

For MP: (https://github.com/materialsproject/mapidoc) and (https://materialsproject.org/open)

For Citrine: https://citrineinformatics.github.io/api-documentation/

For example, to get ‘stable’ MP entries in a certain elasitcity range, you could do:

df = MPDataRetrieval().get_dataframe(criteria={“elasticity.K_VRH”: {"$lt": 200.0},

“elasticity”: {"$exists": 1, “$ne”: None}},

properties=[“material_id”, “structure”,

“elasticity.K_VRH”, “elasticity.G_VRH”,

“elasticity.G_Voigt”, “elasticity.K_Voigt”,

“elasticity.G_Reuss”, “elasticity.K_Reuss”,

“warnings”])

The keys described in the APIs should work with matminer’s classes, as long as the queries are made correctly. If they don’t, please let us know!

Thanks,

Alex

···

On Wednesday, February 27, 2019 at 1:10:33 PM UTC-8, Brahim wrote:

Hello there,

I am new to matminer so if the question has been answered elsewhere please provide the link.

I would like to retrieve selected data from MP and Citrine (I do have the API_KEY for both database), using get_dataframe, based on the following criteria:

  • Cubic spacegroup
  • Some elasticity range
  • Hardness threshold
  • others properties

I was able to run some of the existing notebooks, but they are limited to what want to achieve.

Any example that some of you may have already explored is highly appreciated.

Best,

Brahim

Hi Brahim,

If you are looking to filter by elements, you can do something like (for example, getting all materials with noble gases in them):

{‘elements’: {’$in’: [‘He’, ‘Ne’, ‘Ar’, ‘Kr’, ‘Xe’]}} .

if you are just doing one element, you don’t need $in if I remember correctly, you can just

{“elements”: “O”}

If you are looking to filter by anonymous formula (.e.g, AB2C4), check out the mapi doc (https://github.com/materialsproject/mapidoc/tree/master/materials/formula_anonymous) for fomula anonymous. You might be able to do something like:

{“formula_anonymous”: “AB2C4”}

You can also query by structure, for example by space group number

{“spacegroup.number”: 227}

As far as getting AB2O4 (or a particular class of materials), you’ll probably have to craft a bit more of an advanced query (a combination of the above options). For example:

{“formula_anonymous”: “AB2C4”, “elements” : “O”}

Thanks,

Alex

···

"Thanks for your prompt answer Alex. That’s right I am a bit struggling with setting the right keys for the criteria.
Do you have an idea how to setup the “elements” to query a particular class of materials. Examples spinals with formula AB2O4.

Thanks in advance

Brahim"

On Wednesday, February 27, 2019 at 1:10:33 PM UTC-8, Brahim wrote:

Hello there,

I am new to matminer so if the question has been answered elsewhere please provide the link.

I would like to retrieve selected data from MP and Citrine (I do have the API_KEY for both database), using get_dataframe, based on the following criteria:

  • Cubic spacegroup
  • Some elasticity range
  • Hardness threshold
  • others properties

I was able to run some of the existing notebooks, but they are limited to what want to achieve.

Any example that some of you may have already explored is highly appreciated.

Best,

Brahim

Thanks Alex.

These are great recommendations to start with.

Best,

Brahim

···

On Thursday, February 28, 2019 at 2:03:59 AM UTC-5, [email protected] wrote:

Hi Brahim,

If you are looking to filter by elements, you can do something like (for example, getting all materials with noble gases in them):

{‘elements’: {’$in’: [‘He’, ‘Ne’, ‘Ar’, ‘Kr’, ‘Xe’]}} .

if you are just doing one element, you don’t need $in if I remember correctly, you can just

{“elements”: “O”}

If you are looking to filter by anonymous formula (.e.g, AB2C4), check out the mapi doc (https://github.com/materialsproject/mapidoc/tree/master/materials/formula_anonymous) for fomula anonymous. You might be able to do something like:

{“formula_anonymous”: “AB2C4”}

You can also query by structure, for example by space group number

{“spacegroup.number”: 227}

As far as getting AB2O4 (or a particular class of materials), you’ll probably have to craft a bit more of an advanced query (a combination of the above options). For example:

{“formula_anonymous”: “AB2C4”, “elements” : “O”}

Thanks,

Alex


"Thanks for your prompt answer Alex. That’s right I am a bit struggling with setting the right keys for the criteria.
Do you have an idea how to setup the “elements” to query a particular class of materials. Examples spinals with formula AB2O4.

Thanks in advance

Brahim"

On Wednesday, February 27, 2019 at 1:10:33 PM UTC-8, Brahim wrote:

Hello there,

I am new to matminer so if the question has been answered elsewhere please provide the link.

I would like to retrieve selected data from MP and Citrine (I do have the API_KEY for both database), using get_dataframe, based on the following criteria:

  • Cubic spacegroup
  • Some elasticity range
  • Hardness threshold
  • others properties

I was able to run some of the existing notebooks, but they are limited to what want to achieve.

Any example that some of you may have already explored is highly appreciated.

Best,

Brahim