Releases: materialsproject/pymatgen
v2023.6.28
- Use lru_cache to speed up get_el_sp by 400x (@v1kko).
- Related to lru_cache of get_el_sp, Species.properties is now deprecated in favor of setting Species(spin=5). The rationale is
that spin is the only supported property for Species anyway. Species and DummySpecies is now mostly immutable, i.e., setting specie.spin = 5 have no effect. This is as intended since the first version of pymatgen.
v2023.06.23
We're pleased to ship the latest and greatest Pymatgen v2023.06.23 today! 🎉 👨💻 🌮
Besides squashing many bugs, we give you a brand new Molecule.relax()
[code] courtesy of @arosen93 in #3044 to match the existing but now matGL
-M3GNet-powered Structure.relax()
[code].
What's more, we have some shiny new (Structure|Molecule).calculate()
[code] methods for single-point ASE calculations if you just want a quick energy estimate for example:
from pymatgen.core import Lattice, Structure
structure = Structure(
lattice=Lattice.cubic(2.8),
species=("Fe", "Fe"),
coords=((0, 0, 0), (0.5, 0.5, 0.5)),
)
print(f"M3GNet energy={structure.calculate().calc.results['energy'][0]:.4} eV")
>>> M3GNet energy=-16.84 eV
What's Changed
- Update
DictSet
to allow direct initialization by @kavanase in #3031 - DOC: remove "structure" from init by @lbluque in #3030
- MPAqueousCompatiblity: compute hydrate correction using reduced rather than full composition by @rkingsbury in #2886
- Don't do a hard
bandgap==0
check in the r2SCAN workflow by @arosen93 in #3036 - Improvements to
PDPlotter
: unary plots, 2D ternaries, better defaults, and highlight entries by @mattmcdermott in #3032 - Rename VaspInputSet.(potcar_functional->user_potcar_functional) and start testing
DictSet
by @janosh in #3035 - Simplify
dict["key"] if "key" in dict else None
todict.get("key")
by @janosh in #3038 - Fix LMAXMIX default in VASP INCAR now set based on element blocks in structure by @janosh in #3041
- Better error message to clarify Structure.species only supported for ordered by @janosh in #3046
IcohpValue.__str__
don'treturn None
by @janosh in #3052PourbaixDiagram
wrong composition bug fix by @montoyjh in #3053- Migrate GHA release job to PyPI trusted publishing by @janosh in #3055
- Add
(Structure|Molecule).calculate()
+Molecule.relax()
, improveStructure.relax()
by @arosen93 in #3044 - Don't require ASE as dependency by @arosen93 in #3062
- Update doc in periodic_table.py by @755452800 in #3063
- Skip
Molecule.relax()
tests by @arosen93 in #3060 - Use self-documenting f-strings instead of hard-coding var names by @janosh in #3064
- Fix
ValueError: Unexpected atomic number Z=0
by @janosh in #3066 - PymatgenTest add auto-used
tmp_path
fixture (replacesScratchDir
) by @janosh in #3067 - Remove assertEqual vestiges in tests by @janosh in #3069
- More pytest.approx() refactoring by @janosh in #3072
- Update test_kpath_lm.py, remove redundant test and simplify tests by @JaGeo in #3073
AseAtomsAdaptor
: EnsureMolecule.charge
andMolecule.spin_multiplicity
aren't lost upon interconversion by @arosen93 in #3056- Single-line
None
assignment by @janosh in #3074 - Breaking: change
Composition
bad key error type fromTypeError
toKeyError
by @janosh in #3075 - Fix
ase
tests not running due topymatgen/io/ase.py
shadowingase
package by @janosh in #3077 - Cosmetic fixes to
AseAtomsAdaptor
dictionary key ordering by @arosen93 in #3076 - Improvements to the documentation of the Lobsterenv module by @JaGeo in #3079
- More precise error message tests and more informative errors in some cases by @janosh in #3081
- Add
test_apply_scissor_(insulator|spin_polarized)
by @janosh in #3082 - Immutable class defaults by @janosh in #3085
- Fix hill_formula Composition property by @amkrajewski in #3086
- Fix doc string punctuation by @janosh in #3088
- Fix
DosPlotterTest.test_get_plot_limits()
assert floats equal not usingapprox
by @janosh in #3089 - Check for expected error msg in
pytest.raises()
by @janosh in #3091 - Fix
ValueError
when parsingvasprun.xml
with only some atom force constants by @janosh in #3092 - Fix
test_babel_pc_with_ro_depth_0_vs_depth_10
by @janosh in #3093 - Set
hashlib.md5(usedforsecurity=False)
when computing POTCAR hashes by @janosh in #3094 - Move
get_zmatrix
fromGaussianInput
toMolecule
by @JaGeo in #3095
Full Changelog: v2023.05.31...v2023.06.23
v2023.05.31
Attention ⚠️
user_potcar_settings
now defaults to {"W": "W_sv"}
in all VASP input sets if user_potcar_functional == "PBE_54"
(since the 5.4 POTCARs dropped W_pv
) (see #3022 for details)
What's Changed
- Drop deprecated SubstrateAnalyzer + ZSLGenerator reexports by @janosh in #2981
- Fix average error by @JaGeo in #2986
- Doc strings by @janosh in #2987
- Suspected Typo Fix in
pymatgen.io.vasp.optics
by @kavanase in #2989 - Enable ruff doc rules in CI by @janosh in #2990
- Add type hints for
pymatgen.io.ase
module by @arosen93 in #2991 - Hide all type-hint-only imports behind
if TYPE_CHECKING
by @janosh in #2992 - Orbital-resolved icohplist by @JaGeo in #2993
- Re-export
SiteCollection
+DummySpecies
frompymatgen.core
by @janosh in #2995 Species
parse oxi state from symbol str by @janosh in #2998- Add LightStructureEnvironments.from_structure_environments() fallback value if
ce_and_neighbors
is None by @janosh in #3002 - Support writing structures to compressed JSON (.json.gz .json.bz2 .json.xz .json.lzma) by @janosh in #3003
- Lookup
MPRester
API key in settings ifNone
provided as arg by @ml-evs in #3004 - Update
.pytest-split-durations
by @janosh in #3005 - Clean up by @janosh in #3010
- Fix
ValueError
whenstructure.selective_dynamics
has typenp.array
by @janosh in #3012 - Breaking: Overhaul
class PymatgenTest
by @janosh in #3014 - Optimize cython find_points_in _spheres by @lbluque in #3015
- MaterialsProjectCompatibility issue deprecation warning by @janosh in #3017
- Tweak variable names by @janosh in #3019
- Unignore
ruff
PD011
by @janosh in #3020 - Breaking: Default
user_potcar_settings
to{"W": "W_sv"}
in all input sets ifuser_potcar_functional == "PBE_54"
by @janosh in #3022
Full Changelog: v2023.5.10...v2023.05.31
v2023.5.10
- Fix mem leak in pbc_shortest_vector cython code. (@stichri)
- Set all cython code to language level 3.
v2023.5.8
❗ The Yb_2
deprecation release ❗
This release changes the Ytterbium (Yb) pseudo-potential (PSP) from Yb_2
to Yb_3
for all PBE_54
VASP input sets.
Background: The A-lab revealed that as a result of using Yb_2
the energy on Yb compounds is off by a lot, resulting in supposedly stable things being unsynthesizable. While an unfortunate mistake, it's also great to see how experiment can help surface simulation errors.
On pre-PBE_54
input sets, we now issue a warning that Yb_2
will give bad results for most systems since Yb is most often in oxidation state Yb3+.
Reason: The better fix Yb_3
only became available in the PBE_54
PSP set. Requiring it on pre-PBE_54
input sets would mean you can't run Yb compounds.
For more details see #2968 and #2969.
What's Changed
- Fix TypeError: a bytes-like object is required, not 'list' when passing triplet of bools to
find_points_in_spheres()
pbc
kwarg by @janosh in #2907 - Fix ValueError: not enough values to unpack in PDPlotter if no unstable entries in PD by @janosh in #2908
- Fix
VolumetricData.to_cube()
not preserving structure dimensions by @janosh in #2909 - Update team.rst by @jmmshn in #2912
- Faff by @janosh in #2915
- Add
formal_chempots
option toChemicalPotentialDiagram
to plot the formal chemical potentials rather than the DFT energies by @kavanase in #2916 - Modified dosplotter by @kaueltzen in #2844
- auto version by @jmmshn in #2925
- bug fix for potcar parsing by @jmmshn in #2910
- Fix breaking changes from pandas v2 by @janosh in #2935
- add kwarg to MoleculeGraph method and fix PackmolSet bug by @orionarcher in #2927
- fix on reading multiple route in Gaussian input file by @Ameyanagi in #2939
- Fix CI errors by @janosh in #2940
- Add ResParser support for reading files with spin values by @ScottNotFound in #2941
- Ignore bad unicode characters in Structure.from_file() by @janosh in #2948
- Minor modification for symmetrically distinct Miller index generation by @fyalcin in #2949
- Fixed Wulff shape for new versions of matplotlib by @CifLord in #2950
- Test figure returned by WulffShape.get_plot() contains single Axes3D by @janosh in #2953
- Fix
Cp2kOutput.spin_polarized()
likely not doing what author intended by @janosh in #2954 - For MPcules: Molecule Trajectory and graph hashes by @espottesmith in #2945
self.assertArrayEqual->assert
by @janosh in #2955- fix GaussianOutput bug with multiple route lines by @xjf729 in #2937
- Fix ValueError when passing
selective_dynamics
toPoscar
by @chiang-yuan in #2951 - Bump beautifulsoup4 from 4.11.1 to 4.12.2 by @dependabot in #2962
- Bump pypa/cibuildwheel from 2.11.4 to 2.12.3 by @dependabot in #2959
- Bump uncertainties from 3.1.6 to 3.1.7 by @dependabot in #2960
- Bump numpy from 1.23.2 to 1.24.3 by @dependabot in #2963
- Bump tabulate from 0.8.10 to 0.9.0 by @dependabot in #2961
- Bump pandas from 1.4.4 to 2.0.1 by @dependabot in #2964
- Link /addons from new subsection on /contributing page by @janosh in #2967
- Breaking: change
Yb
pseudo-potential on all VASP input sets fromYb_2
toYb_3
by @janosh in #2969 - fix recursion error by adding copy and deepcopy dunder methods by @orionarcher in #2973
- Revert to
Yb_2
on pre-PBE_54
input sets by @janosh in #2972 - Enable
flake8-pytest-style
viaruff
by @janosh in #2975 - Enable all ruff pylint rules (excl. PLR) by @janosh in #2977
- only return unique point group operations by @mueslo in #2942
New Contributors
- @kaueltzen made their first contribution in #2844
- @chiang-yuan made their first contribution in #2951
- @mueslo made their first contribution in #2942
Full Changelog: v2023.3.23...v2023.5.8
v2023.3.23
- Misc bug fixes.
- Enable Structure relaxations with TrajectoryObserver (@janosh)
v2023.3.10
Update docs
v2023.2.28
First release (in a while) with pre-built Linux wheels thanks to @njzjz! 🎉
What's Changed
- use
cibuildwheel
to build linux wheels by @njzjz in #2800 - Merge setup.cfg into pyproject.toml by @janosh in #2858
- del class AtomicFile, _maketemp(), ask_yesno() by @janosh in #2860
- fix reduced formula in Ion by @yang-ruoxi in #2864
- Prepare release 2023.2.28 by @janosh in #2867
Full Changelog: v2023.2.22...v2023.2.28
What's Changed
- use
cibuildwheel
to build linux wheels by @njzjz in #2800 - Merge setup.cfg into pyproject.toml by @janosh in #2858
- del class AtomicFile, _maketemp(), ask_yesno() by @janosh in #2860
- fix reduced formula in Ion by @yang-ruoxi in #2864
- Prepare release 2023.2.28 by @janosh in #2867
Full Changelog: v2023.2.22...v2023.2.28
v2023.2.22
What's Changed
- Fix pre-commit.ci isort error by @janosh in #2825
- Changes to Q-Chem IO to allow CDFT and coupling calculations by @espottesmith in #2674
- [pre-commit.ci] pre-commit autoupdate by @pre-commit-ci in #2834
- Add inplace flag to select whether to adjust entries in place by @peikai in #2841
- Default
check_stable
toFalse
inPatchedPhaseDiagram.get_decomp_and_e_above_hull()
for speed by @janosh in #2842 - Document difference between Composition.get_el_amt_dict() and Composition.as_dict() by @janosh in #2846
- Manually update OPTIMADE database aliases and add option to refresh on init by @ml-evs in #2848
- Add Ruff linter by @janosh in #2847
- Fix auto-fixable pydocstyle errors through ruff by @janosh in #2850
- Fix OPTIMADE client generated filters and URLs by @ml-evs in #2853
- Run pyupgrade and flake8-simplify through ruff by @janosh in #2851
- Fix typo in OPTIMADE client: remove quotes in response fields by @ml-evs in #2856
- Ruff c4+ruf rules by @janosh in #2854
- Add
python-version
3.11 to GH action matrix strategy by @janosh in #2714 - 2023.2.22 release by @janosh in #2857
Full Changelog: v2023.1.30...v2023.2.22
v2023.1.30
Update docs