diff --git a/pymatgen/entries/compatibility.py b/pymatgen/entries/compatibility.py index 4da614fe98a..dfb6c509bde 100644 --- a/pymatgen/entries/compatibility.py +++ b/pymatgen/entries/compatibility.py @@ -20,7 +20,7 @@ from collections import defaultdict from monty.design_patterns import cached_class -from monty.serialization import serial_loadf +from monty.serialization import loadfn from pymatgen.io.vaspio_set import MITVaspInputSet, MPVaspInputSet from pymatgen.core.periodic_table import Element @@ -136,7 +136,7 @@ class GasCorrection(Correction): corrections are to be applied or not. """ def __init__(self, config_file, correct_peroxide=True): - c = serial_loadf(config_file) + c = loadfn(config_file) self.cpd_energies = c['Advanced']['CompoundEnergies'] self.oxide_correction = c['OxideCorrections'] self.name = c['Name'] @@ -203,7 +203,7 @@ class AqueousCorrection(Correction): config_file: Path to the selected compatibility.yaml config file. """ def __init__(self, config_file): - c = serial_loadf(config_file) + c = loadfn(config_file) self.cpd_energies = c['AqueousCompoundEnergies'] self.name = c["Name"] @@ -262,7 +262,7 @@ def __init__(self, config_file, input_set, compat_type): raise CompatibilityError("Invalid compat_type {}" .format(compat_type)) - c = serial_loadf(config_file) + c = loadfn(config_file) self.input_set = input_set if compat_type == 'Advanced': diff --git a/pymatgen/io/vaspio_set.py b/pymatgen/io/vaspio_set.py index ba7c819980e..832b8ee40b9 100644 --- a/pymatgen/io/vaspio_set.py +++ b/pymatgen/io/vaspio_set.py @@ -28,7 +28,7 @@ import numpy as np -from monty.serialization import serial_loadf +from monty.serialization import loadfn from pymatgen.io.cifio import CifWriter from pymatgen.io.vaspio.vasp_input import Incar, Poscar, Potcar, Kpoints @@ -377,7 +377,7 @@ def from_file(name, filename, **kwargs): Returns: DictVaspInputSet """ - return DictVaspInputSet(name, serial_loadf(filename), **kwargs) + return DictVaspInputSet(name, loadfn(filename), **kwargs) MITVaspInputSet = partial(DictVaspInputSet.from_file, "MIT", @@ -431,7 +431,7 @@ def __init__(self, nimages=8, user_incar_settings=None, **kwargs): DictVaspInputSet.__init__( self, "MIT NEB", - serial_loadf(os.path.join(MODULE_DIR, "MITVaspInputSet.yaml")), + loadfn(os.path.join(MODULE_DIR, "MITVaspInputSet.yaml")), user_incar_settings=defaults, ediff_per_atom=False, **kwargs) self.nimages = nimages @@ -540,7 +540,7 @@ def __init__(self, start_temp, end_temp, nsteps, time_step=2, defaults.update(user_incar_settings) DictVaspInputSet.__init__( self, "MIT MD", - serial_loadf(os.path.join(MODULE_DIR, "MITVaspInputSet.yaml")), + loadfn(os.path.join(MODULE_DIR, "MITVaspInputSet.yaml")), hubbard_off=hubbard_off, sort_structure=sort_structure, user_incar_settings=defaults, **kwargs) @@ -554,7 +554,7 @@ def __init__(self, start_temp, end_temp, nsteps, time_step=2, #use VASP default ENCUT if 'ENCUT' not in self.user_incar_settings: del self.incar_settings['ENCUT'] - + if not spin_polarized: del self.incar_settings['MAGMOM'] @@ -645,7 +645,7 @@ class MPStaticVaspInputSet(DictVaspInputSet): def __init__(self, kpoints_density=90, sym_prec=0.1, **kwargs): DictVaspInputSet.__init__( self, "MP Static", - serial_loadf(os.path.join(MODULE_DIR, "MPVaspInputSet.yaml")), + loadfn(os.path.join(MODULE_DIR, "MPVaspInputSet.yaml")), **kwargs) self.incar_settings.update( {"IBRION": -1, "ISMEAR": -5, "LAECHG": True, "LCHARG": True, @@ -848,7 +848,7 @@ class MPStaticDielectricDFPTVaspInputSet(DictVaspInputSet): def __init__(self, user_incar_settings=None, ionic=True): DictVaspInputSet.__init__( self, "MaterialsProject Static Dielectric DFPT", - serial_loadf(os.path.join(MODULE_DIR, "MPVaspInputSet.yaml"))) + loadfn(os.path.join(MODULE_DIR, "MPVaspInputSet.yaml"))) self.user_incar_settings = user_incar_settings if \ user_incar_settings is not None else {} self.incar_settings.update(self.user_incar_settings) @@ -887,7 +887,7 @@ def __init__(self, user_incar_settings=None, added_kpoints=[], mode="Line", kpoints_density=100): DictVaspInputSet.__init__( self, "MaterialsProject HSE Band Structure", - serial_loadf(os.path.join(MODULE_DIR, "MPHSEVaspInputSet.yaml"))) + loadfn(os.path.join(MODULE_DIR, "MPHSEVaspInputSet.yaml"))) self.user_incar_settings = user_incar_settings if \ user_incar_settings is not None else {} self.incar_settings.update( @@ -987,7 +987,7 @@ def __init__(self, user_incar_settings, mode="Line", "'Uniform'!") DictVaspInputSet.__init__( self, "MaterialsProject Static", - serial_loadf(os.path.join(MODULE_DIR, "MPVaspInputSet.yaml")), + loadfn(os.path.join(MODULE_DIR, "MPVaspInputSet.yaml")), constrain_total_magmom=constrain_total_magmom, sort_structure=sort_structure) self.user_incar_settings = user_incar_settings diff --git a/requirements-travis.txt b/requirements-travis.txt index 5ed4ff07523..02b79e68836 100644 --- a/requirements-travis.txt +++ b/requirements-travis.txt @@ -3,6 +3,6 @@ PyDispatcher==2.0.3 numpy==1.8.1 pybtex==0.17 requests==2.2.1 -monty==0.2.4 +monty==0.3.0 pyhull==1.4.3 pyyaml==3.10 \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index a04727aee73..4817bd4f929 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,6 +4,6 @@ numpy==1.8.1 pybtex==0.17 requests==2.2.1 scipy==0.14.0 -monty==0.2.4 +monty==0.3.0 pyhull==1.4.3 pyyaml>=3.10 \ No newline at end of file diff --git a/setup.py b/setup.py index fe5a6477054..4e62f31defa 100644 --- a/setup.py +++ b/setup.py @@ -44,7 +44,7 @@ def get_spglib_ext(): version="2.9.13", install_requires=["numpy>=1.5", "pyhull>=1.4.3", "PyCifRW>=3.3", "requests>=1.0", "pybtex>=0.16", "pyyaml>=3.0", - "monty>=0.2.4"], + "monty>=0.3.0"], extras_require={"electronic_structure": ["scipy>=0.10"], "plotting": ["matplotlib>=1.1"], "ase_adaptor": ["ase>=3.3"],