Skip to content

Misleading deprecation warning for MPRester.get_entries  #4471

@DanielYang59

Description

@DanielYang59

Notice three issues for ext.matproj (or its tests):

  1. PMG_MAPI_KEY might not have been set correctly:

    SKIPPED [1] tests/ext/test_matproj.py:15: PMG_MAPI_KEY not set

  2. There is DeprecationWarning:
    if set(kwargs.keys()).intersection({"inc_structure", "conventional_unit_cell", "sort_by_e_above_hull"}):
    warnings.warn(
    "The inc_structure, conventional_unit_cell, and sort_by_e_above_hull arguments are deprecated. "
    "These arguments have no effect and will be removed in 2026.1.1.",
    DeprecationWarning,
    stacklevel=2,
    )

    but it appears to me at least conventional_unit_cell still have effect (not sure about others), e.g.
    entry = mprester.get_entry_by_material_id("mp-23", inc_structure=True, conventional_unit_cell=True)
  3. Trying to run tests for tests/ext/test_matproj.py::test_api_parity locally (with correct PMG_MAPI_KEY) gives:
    pymatgen.ext.matproj.MPRestError: No module named 'pymatgen.analysis.alloys', looks a bit similar to mpr.materials.grain_boundaries throws: ModuleNotFoundError: No module named 'pymatgen.analysis.gb' api#991? Update: looks like need to install pymatgen-analysis-alloys

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions