Avoiding Value Error: (Double check the intensities, most of them are nonpositive)

Hi,

I am trying to access the XANES Spectra, K-edge for Oxygen for a data science project; however, I keep running into an error when searching for these using mpr.materials.xas.search() with the appropriate variables I am looking for and then filtering for the fields that are meaningful to me. Would someone be able to let me know how to access all the data without running into this error?

Hi @Dru, this is a probably an error with older XAS data that we’re currently looking into. To retrieve all the XAS data, you can use this code:

from mp_api.client import MPRester

query = {< your query here as a dict>}

with MPRester(api_key = "your_api_key", monty_decode=False, use_document_model = False) as mpr:
    xas_docs = mpr.materials.xas.search(**query)

Just note that the data will be in a dict format, rather than the XAS document schema you’d usually get.