pypi pymatgen 2025.4.10
v2025.4.10

latest releases: 2025.4.24, 2025.4.20, 2025.4.19...
14 days ago
  • Parity with MPRester.materials.summary.search in MPResterBasic.
  • PR #4355 Fix round-trip constraints handling of AseAtomsAdaptor by @yantar92
    • src/pymatgen/io/ase.py (AseAtomsAdaptor.get_structure): When no explicit constraint is given for a site in ASE Atoms object, use "T T T" selective dynamics (no constraint). The old code is plain wrong.
    • tests/io/test_ase.py (test_back_forth): Add new test case.
      Fixes #4354.
      Thanks to @yaoyi92 for reporting!
  • PR #4352 Replace to_dict with as_dict by @DanielYang59
    • Deprecate to_dict with as_dict, to close #4351
    • Updated contributing.md to note preferred naming convention
    • Regenerate docs
      The recent additional of JDFTx IOs have a relatively short grace period of 6 months, and others have one year
  • PR #4342 Correct Mn "ionic radii" in core.periodic_table.json by @DanielYang59
    • Correct Mn "ionic radii" in core.periodic_table.json
      Our csv parser should copy the high spin ionic radii to the base entry:
    image https://github.com/materialsproject/pymatgen/blob/4c7892f5c9dcc51a1389b3ad2ada77632989a13e/dev_scripts/update_pt_data.py#L84-L87
  • PR #4341 Remove "Electrical resistivity" for Se as "high" by @DanielYang59

    Summary

    • Remove "Electrical resistivity" for Se as "high", to fix #4312
      Current the data for Electrical resistivity of Se is "high" (with 10<sup>-8</sup> &Omega; m as the unit), and our parser would interpret it to:
    from pymatgen.core import Element
    print(Element.Se.electrical_resistivity)  # 1e-08 m ohm
    This is the only data as "high" in periodic_table.json AFAIK.
    After this, it would be None with a warning:
    /Users/yang/developer/pymatgen/debug/test_elements.py:3: UserWarning: No data available for electrical_resistivity for Se
    print(Element.Se.electrical_resistivity)
    None
    
  • PR #4334 Updated Potentials Class in FEFF io to consider radius by @CharlesCardot
    Changed the Potentials class to consider the same radius that is used in
    the Atoms class. This is necessary to avoid a situation where the radius is small enough to only have a subset of the unique elements in a structure, but all the elements have potentials defined, which causes FEFF to fail when run.
    Major changes:
    • fix 1: Previous behavior: When creating a FEFFDictset using the feff.io tools, the potentials class defined a potential for every unique element in a structure, while the atoms class defined an atom coordinate for every atom in a radius around the absorbing atom. If the radius was defined to be small, only a subset of the unique atoms in the structure would be included in the atom class. New behavior: Updated the potentials class to only create potentials for atoms inside the radius specified when creating a FEFFDictset. Without this, a too small radius for a structure with unique elements outside of that radius would cause FEFF to fail, given that there was a Potential defined for an element that did not exist in the Atoms flag.

    Todos

    None, the work is complete
  • PR #4068 Fix monty imports, enhance test for Outcar parser to cover uncompressed format by @DanielYang59

    Summary

    • Test monty fix for reverse readline, close #4033 and close #4237
    • Replace reverse_readline with faster reverse_readfile
    • Fix incorrect monty imports
    • Enhance unit test for reported Outcar parser (need to test unzipped format)
  • PR #4331 Optimized cube file parsing in from_cube for improved speed by @OliMarc

    Summary

    Major Changes:

    This PR enhances the from_cube function in io.common.VolumetricData to significantly improve performance. When processing large .cube files, the original implementation took minutes to read and set Pymatgen objects. The optimized version incorporates several key improvements: file reading is now handled with readlines() instead of multiple readline() calls, reducing I/O operations. Voxel data parsing has been rewritten to use NumPy vectorized parsing instead of loops, making numerical processing faster. Atom site parsing has been improved by replacing the loop-based readline() approach with list comprehensions. Additionally, volumetric data parsing now leverages np.fromstring() instead of converting lists to NumPy arrays.
  • PR #4329 Add protostructure and prototype functions from aviary by @CompRhys
    Adds functions to get protostructure labels from spglib, moyo and aflow-sym. This avoids users who wish to use this functionality from needing to download aviary to use these functions.
  • PR #4321 [Breaking] from_ase_atoms constructor for (I)Structure/(I)Molecule returns the corresponding type by @DanielYang59

    Summary

    • Fix from_ase_atoms for Molecule, to close #4320
    • Add tests
  • PR #4296 Make dict representation of SymmetrizedStructure MSONable by @DanielYang59

    Summary

    • Make dict representation of SymmetrizedStructure MSONable, to fix #3018
    • Unit test
  • PR #4323 Tweak POSCAR / XDATCAR to accommodate malformed files by @esoteric-ephemera
    Related to this matsci.org issue: sometimes the XDATCAR can be malformed because fortran uses fixed format floats when printing. In those cases, there's no space between coordinates:
    Direct configuration= 2
    -0.63265286-0.11227753 -0.15402785
    -0.12414874 -0.01213420 -0.28106824
    ...
    
    In some cases, this issue is reparable (a negative sign separates coordinates). This PR implements a fix when it is reparable and adds a few Trajectory-like convenience features to Xdatcar

Don't miss a new pymatgen release

NewReleases is sending notifications on new releases.