New MP API and Emmet docs vs pymatgen objects

Many parts of the new MP API return documents as “Emmet documents” (i.e., pydantic validated documents) as opposed to standard pymatgen objects. For example Emmet’s DosData instead of pymatgen’s CompleteDos.

I am aware of some of the technical and other reasons for this dichotomy, but my question is whether there is an easy way to convert from Emmet documents to pymatgen objects? Or, does the user need to figure out the conversion (likely by custom use of pymatgen’s from_dict() function)?

Note that having Emmet documents be MSONable with a compatible representation to pymatgen would help in the interconversion if there is no natural / automatic way to do it.

Could you clarify which parts of the mp-api client you’re referring to? In the following example, the dos object is of type pymatgen.electronic_structure.dos.CompleteDos.

docs = mpr.materials.summary.search(
    has_props=["dos"], fields=["material_id"],
    chunk_size=1, num_chunks=1
)
dos = mpr.materials.electronic_structure_dos.get_dos_from_material_id(
    docs[0].material_id
)

For the DOS specifically, I am referring to DosData as returned by the SummaryRester. Yes, one can do a separate query for the DOS, but it would be much easier (and more efficient) if the SummaryRester could just return me the DOS in pymatgen format. Similarly with the band structure, the SummaryRester I believe returns something not in the pymatgen format with the expectation that the user makes a separate call to get the band structure in a pymatgen format.

Note that the DOS was meant only as one example of the issue. There at least a few more examples. For example, when it comes to VASP Inputs, TaskRester only returns the KPoints in its native pymatgen format. All the other files (Incar, Poscar, Potcar) need to be converted in some way to get them into pymatgen format.