Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
e-kwsm opened this issue Oct 25, 2023 · 2 comments
Open

Comments

@e-kwsm
Copy link

e-kwsm commented Oct 25, 2023

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?

@munrojm
Copy link
Member

munrojm commented Oct 31, 2023

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

@e-kwsm
Copy link
Author

e-kwsm commented Nov 4, 2023

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants