materialsproject/api

`SummaryRester.search` does not support formulae for `chemsys` any longer?

e-kwsm opened this issue · 2 comments

mp-api version: 0.37.5

According to the docstring of SummaryRester.search, chemsys argument may be formulae.

chemsys (str, List[str]): A chemical system, list of chemical systems
(e.g., Li-Fe-O, Si-*, [Si-O, Li-Fe-P]), or single formula (e.g., Fe2O3, Si*).

However it does not work—the following prints 0 26:

import warnings
from pymatgen.ext.matproj import MPRester

warnings.filterwarnings("ignore")

MP_API_KEY = ...  # key for new API
with MPRester(MP_API_KEY) as mpr:
    r_c = mpr.summary.search(chemsys="Fe2O3")
    r_f = mpr.summary.search(formula="Fe2O3")
    print(len(r_c), len(r_f))  # 0 26
    # chemical system works as expected
    r_c_cs = mpr.summary.search(chemsys="Fe-O")
    # print(len(r_c_cs))  # 136

Is the docstring outdated?

Yes, it should specify that only formula will accept single formula entries.

The same goes for the followings?

chemsys (str, List[str]): A chemical system, list of chemical systems
(e.g., Li-C-O, [C-O-H-N, Li-N]), or single formula (e.g., C2 H4).

chemsys (str, List[str]): A chemical system, list of chemical systems
(e.g., Li-C-O, [C-O-H-N, Li-N]), or single formula (e.g., C2 H4).

chemsys (str, List[str]): A chemical system, list of chemical systems
(e.g., Li-C-O, [C-O-H-N, Li-N]), or single formula (e.g., C2 H4).

chemsys (str, List[str]): A chemical system, list of chemical systems
(e.g., Li-C-O, [C-O-H-N, Li-N]), or single formula (e.g., C2 H4).

chemsys (str, List[str]): A chemical system, list of chemical systems
(e.g., Li-C-O, [C-O-H-N, Li-N]), or single formula (e.g., C2 H4).

chemsys (str, List[str]): A chemical system, list of chemical systems
(e.g., Li-C-O, [C-O-H-N, Li-N]), or single formula (e.g., C2 H4).

chemsys (str, List[str]): A chemical system, list of chemical systems
(e.g., Li-C-O, [C-O-H-N, Li-N]), or single formula (e.g., C2 H4).

chemsys (str, List[str]): A chemical system, list of chemical systems
(e.g., Li-C-O, [C-O-H-N, Li-N]), or single formula (e.g., C2 H4).

chemsys (str, List[str]): A chemical system, list of chemical systems
(e.g., Li-C-O, [C-O-H-N, Li-N]), or single formula (e.g., C2 H4).