Releases: materialsproject/pymatgen
v2023.9.10
What's Changed
🐛 Bug Fixes
- Fix code comment in ASE adapter by @Andrew-S-Rosen in #3298
- Fix IndexError when parsing Hessian from Gaussian frequency job by @janosh in #3308
🛠 Enhancements
- Add an input arg check for
Kpoints.automatic_density_by_lengths
by @Andrew-S-Rosen in #3299
🏥 Package Health
- Remove pydantic < 2 from
setup.py
and bump monty inrequirements.txt
by @Andrew-S-Rosen in #3303 - Move
py.typed
to package root by @Andrew-S-Rosen in #3307 - Consistent casing
setup->setUp
across test classes by @janosh in #3305
🤷♂️ Other Changes
Full Changelog: v2023.9.2...v2023.9.10
v2023.9.2
What's Changed
- Add
Lattice
propertyparams_dict
by @janosh in #3239 - Generate SupercellTransformation from minimum boundary distance by @JiQi535 in #3238
- More concise
test_from_boundary_distance
by @janosh in #3242 - Breaking: remove deprecated keyword
properties
fromSpecies
by @janosh in #3243 - Typo in Docs for PeriodicsSite by @jmmshn in #3249
- Fix
Vasprun.converged_electronic
check ifALGO=CHI
inINCAR
by @janosh in #3250 - Breaking: Have plot methods return
plt.Axes
object, notmatplotlib
module by @janosh in #3237 - Fix
ruff
D212 by @janosh in #3251 - Fix some Kpoints generated using wrong mesh types by @matthewkuner in #3245
- read
mag
from OSZICAR by @chiang-yuan in #3146 - Use
numpy.testing.assert_allclose
overassert np.allclose
by @janosh in #3253 - Don't let tests pollute the
pymatgen
repo by @janosh in #3255 - Update
compatibility.md
by @mbercx in #3260 - Google-style doc string return types by @janosh in #3258
- Quasi-RRHO Thermochemistry Analysis Module by @arepstein in #2028
- Add keyword
check_occu: bool = True
toCifParser.get_structures()
by @jonathanjdenney in #2836 - Fix bug in feff inputs.py by @kaifengZheng in #3256
- Cancel concurrent CI runs to save budget by @janosh in #3263
- Fix
Procar.get_projection_on_elements
for structures with multiple same-element ionic sites by @Na-Kawa in #3261 - Fix
TestMPScanStaticSet.test_as_from_dict()
by @janosh in #3266 - Bump activesupport from 7.0.6 to 7.0.7.2 in /docs by @dependabot in #3267
- Fix
TestMPStaticSet
usingMPRelaxSet
intest_user_incar_kspacing
andtest_kspacing_override
by @janosh in #3268 - Fix
nelectrons
not updating when replacing species inMolecule
by @janosh in #3269 - Add
properties
to Structure and Molecule by @gpetretto in #3264 - Fix
CifParser.get_structures(check_occu=False)
by @janosh in #3272 - Add
PotcarSingle.__repr__
by @janosh in #3273 __str__
to__repr__
by @janosh in #3274- Ion: handle dissolved gas formulas by @rkingsbury in #3275
- Add VASP input set
MatPESStaticSet
by @SophiaRuan in #3254 - Fix
test_valid_magmom_struct()
error message regex by @janosh in #3276 - fix tests of MatPESStaticSet by @SophiaRuan in #3281
- Breaking: bump minimum Python version to 3.9 by @janosh in #3283
- Breaking: Update
AseAtomsAdaptor
to handleStructure.properties
/Molecule.properties
by @Andrew-S-Rosen in #3270 - Slightly relax the constraint satisfy condition of get_primitive_structure() by @fyalcin in #3285
- [WIP] add custodian modified incar settings to incar and modify tests by @SophiaRuan in #3284
- Add keyword
bandgap_tol: float = 1e-4
toMPScanRelaxSet
by @janosh in #3287 np.(arange->linspace)
inio/vasp/optics.py
get_delta
,get_setp
andepsilon_imag
by @LucasGVerga in #3286- MatPESStaticSet restore GGA tag removal if xc_functional.upper() == "R2SCAN" by @janosh in #3288
- Bump pypa/cibuildwheel from 2.14.1 to 2.15.0 by @dependabot in #3294
- Bump cython from 3.0.0 to 3.0.2 by @dependabot in #3292
- Bump scipy from 1.11.1 to 1.11.2 by @dependabot in #3291
- Bump plotly from 5.11.0 to 5.16.1 by @dependabot in #3289
- Bump joblib from 1.3.1 to 1.3.2 by @dependabot in #3290
- Bump mp-api from 0.33.3 to 0.35.1 by @dependabot in #3293
- xyz.iter() -> iter(xyz) by @janosh in #3228
- Deprecate overlooked
from/as_..._string
methods by @janosh in #3295
New Contributors
- @mbercx made their first contribution in #3260
- @jonathanjdenney made their first contribution in #2836
- @kaifengZheng made their first contribution in #3256
- @Na-Kawa made their first contribution in #3261
- @SophiaRuan made their first contribution in #3254
- @LucasGVerga made their first contribution in #3286
Full Changelog: v2023.8.10...v2023.9.2
v2023.8.10
What's Changed
- fix
estimate_nbands
function by @matthewkuner in #3149 - Add
CifParser.get_structures(on_error='warn')
by @janosh in #3175 ruff . --fix
by @janosh in #3176AseAtomsAdaptor
: Retaintags
property when interconvertingAtoms
andStructure
/Molecule
by @arosen93 in #3151- Fix a bug in pwscf.py. The proc_val function modifies string values. by @pablogalaviz in #3172
- Delete commented out print statements by @janosh in #3178
- lots of
from_string
should beclassmethod
by @njzjz in #3177 - Extend lobsterenv for coop/cobi by @naik-aakash in #3050
- BUG: fix setting zero magmoms by @lbluque in #3179
- Prefer
pymatviz
interactive plotly version of periodic table heatmap if available by @janosh in #3180 - Better Composition
repr
by @janosh in #3182 - Breaking: Return True for
Element in Composition
ifSpecies.symbol
matchesElement
by @janosh in #3184 - Revert
LMAXMIX
"fix" added in #3041 by @janosh in #3189 - Add
bader_exe_path
keyword toBaderAnalysis
and runbader
tests in CI by @janosh in #3191 - Unskip and fix
packmol
tests by @janosh in #3195 - Propagate labels through various Structure operations by @stefsmeets in #3183
- Delete variable self assignments by @janosh in #3196
- Improve
Structure
tests by @janosh in #3197 - Bump pypa/cibuildwheel from 2.12.3 to 2.14.1 by @dependabot in #3202
- Bump numpy from 1.24.3 to 1.25.2 by @dependabot in #3201
- Bump matplotlib from 3.5.2 to 3.7.2 by @dependabot in #3200
- Bump scipy from 1.9.0 to 1.11.1 by @dependabot in #3199
- Test
class XYZ
edge cases by @janosh in #3206 - Fix
EnergyAdjustment.__repr__
by @janosh in #3207 - Markdownlint by @janosh in #3209
- Fix codecov by @janosh in #3210
- Update
pytest-split
durations by @janosh in #3211 - Fix GitHub language statistics after test files migration by @janosh in #3214
- Fix
automatic_density_by_lengths
and add tests for it by @janosh in #3218 - Prefer
len(structure)
overstructure.num_sites
by @janosh in #3219 - Add
PhaseDiagram
methodget_reference_energy
by @janosh in #3222 - Fix isomorphic for molecular graphs by @rohithsrinivaas in #3221
- Add
Structure.elements
property by @janosh in #3223 - Add keyword
in_place: bool = True
toSiteCollection.replace_species
by @janosh in #3224 - list offending elements in
BVAnalyzer.get_valences
error message by @janosh in #3225 - Add
Entry.elements
property by @janosh in #3226 - Move
PymatgenTest.TEST_FILES_DIR
attribute into module scope by @janosh in #3227 - f-string path construction everywhere, no need for
os.path.join(...)
by @janosh in #3229 - speed up
bader_caller
andchargemol_caller
by @chiang-yuan in #3192 - Fix
ruff
PYI041 and ignore PYI024 by @janosh in #3232 - Deprecate
get_string()
methods in favor ofget_str()
by @janosh in #3231 Structure/Molecule.to()
now always return same string written to file by @janosh in #3236
New Contributors
- @matthewkuner made their first contribution in #3149
- @pablogalaviz made their first contribution in #3172
- @rohithsrinivaas made their first contribution in #3221
Full Changelog: v2023.7.20...v2023.8.10
v2023.7.20
What's Changed
- Unreadable string concat ops to f-string by @janosh in #3162
- Revert
mp-api<0.34.0
pin by @janosh in #3165 - Fix CI error
"pdentries_test.csv"
not found by @janosh in #3168 - Fix issues with labels by @stefsmeets in #3169
- v2023.7.20 by @janosh in #3171
Full Changelog: v2023.7.17...v2023.7.20
v2023.7.17
What's Changed
- Fix
MagOrderingTransformation
by enforcing implicit-zero magnetic moments inSpaceGroupAnalyzer
by @mattmcdermott in #3070 - Bug fix:
CollinearMagneticAnalyzer
should not fail whenSpecies.spin = None
by @mattmcdermott in #3157 - Deprecate
from_string
by @janosh in #3158
Full Changelog: v2023.7.14...v2023.7.17
v2023.7.14
What's Changed
- Don't waste
pytest.approx()
function calls on integers by @janosh in #3150 - Add
check_potcar: bool = True
toMaterialsProject2020Compatibility
,MaterialsProjectDFTMixingScheme
andPotcarCorrection
by @janosh in #3143 - Rename
PMG_DISABLE_POTCAR_CHECKS
toPMG_POTCAR_CHECKS
by @janosh in #3153 - Fix "Incompatible POTCAR" error on ComputedEntries with oxidation states by @janosh in #3155
- Read site labels from cif file (2) by @stefsmeets in #3137
Full Changelog: v2023.7.11...v2023.7.14
v2023.7.11
What's Changed
- Add citations for Lobster modules and tiny addition to DOSCAR processing by @JaGeo in #3114
SpaceGroup.__repr__
by @janosh in #3122- Deprecate
pymatgen.util.convergence
by @janosh in #3123 - Add
pymatgen.io.openmm
package toaddons.rst
by @orionarcher in #3124 - Migrate from
warnings.catch_warnings(record=True)
topytest.warns()
by @janosh in #3125 - Fix for missing lattice matches in ZSLGenerator by @fyalcin in #3127
- Bump
ruff
+ fixPERF402
violations by @janosh in #3129 - Test error messages by @janosh in #3131
- Enable
ruff
PT011
by @janosh in #3133 - Read site labels from cif file by @stefsmeets in #3136
- Refactor
analysis/graphs.py
usingdict.pop()
by @janosh in #3139 - Breaking: Rename
[SomeCode]ParserError
to[SomeCode]ParseError
and inherit fromSyntaxError
by @janosh in #3140 - explicit test POTCAR by @jmmshn in #3141
Full Changelog: v2023.6.28...v2023.7.11
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