From c99ff74e77d3e2a178d13ed07031494627d403c7 Mon Sep 17 00:00:00 2001 From: Cloudac7 <812556867@qq.com> Date: Mon, 8 Mar 2021 16:13:14 +0800 Subject: [PATCH] solve pymatgen incompatible issue --- dpgen/auto_test/mpdb.py | 4 ++-- dpgen/data/gen.py | 2 +- dpgen/data/surf.py | 2 +- dpgen/dispatcher/LSF.py | 2 +- tests/auto_test/test_elastic.py | 2 +- tests/auto_test/test_mpdb.py | 2 +- tests/auto_test/test_surface.py | 2 +- tests/auto_test/test_vacancy.py | 2 +- tests/data/test_gen_bulk.py | 2 +- tests/data/test_gen_surf.py | 2 +- tests/data/test_gen_surf_poscar.py | 2 +- 11 files changed, 12 insertions(+), 12 deletions(-) diff --git a/dpgen/auto_test/mpdb.py b/dpgen/auto_test/mpdb.py index 4a76c9c8d..fa91d72fb 100644 --- a/dpgen/auto_test/mpdb.py +++ b/dpgen/auto_test/mpdb.py @@ -1,7 +1,7 @@ import os from dpgen import dlog -from pymatgen import MPRester,Structure -from pymatgen.ext.matproj import MPRestError +from pymatgen.ext.matproj import MPRester, MPRestError +from pymatgen.core import Structure web="materials.org" diff --git a/dpgen/data/gen.py b/dpgen/data/gen.py index ce1573a61..91b649a2a 100644 --- a/dpgen/data/gen.py +++ b/dpgen/data/gen.py @@ -21,7 +21,7 @@ import dpgen.data.tools.diamond as diamond import dpgen.data.tools.sc as sc from dpgen.generator.lib.vasp import incar_upper -from pymatgen import Structure +from pymatgen.core import Structure from pymatgen.io.vasp import Incar from dpgen.remote.decide_machine import decide_fp_machine from dpgen import ROOT_PATH diff --git a/dpgen/data/surf.py b/dpgen/data/surf.py index 8cf29d39d..322d26ad4 100644 --- a/dpgen/data/surf.py +++ b/dpgen/data/surf.py @@ -15,7 +15,7 @@ from dpgen.dispatcher.Dispatcher import Dispatcher, make_dispatcher #-----PMG--------- from pymatgen.io.vasp import Poscar -from pymatgen import Structure,Element +from pymatgen.core import Structure, Element from pymatgen.io.ase import AseAtomsAdaptor #-----ASE------- from ase.io import read diff --git a/dpgen/dispatcher/LSF.py b/dpgen/dispatcher/LSF.py index b28b4eec3..0fa407f18 100644 --- a/dpgen/dispatcher/LSF.py +++ b/dpgen/dispatcher/LSF.py @@ -14,7 +14,7 @@ def check_status(self): except: return JobStatus.terminated if job_id == "" : - raise RuntimeError("job %s is has not been submitted" % self.remote_root) + raise RuntimeError("job %s has not been submitted" % self.context.remote_root) ret, stdin, stdout, stderr\ = self.context.block_call ("bjobs " + job_id) err_str = stderr.read().decode('utf-8') diff --git a/tests/auto_test/test_elastic.py b/tests/auto_test/test_elastic.py index b8f464571..5750e5d48 100644 --- a/tests/auto_test/test_elastic.py +++ b/tests/auto_test/test_elastic.py @@ -5,7 +5,7 @@ import dpdata from monty.serialization import loadfn, dumpfn from pymatgen.analysis.elasticity.strain import Strain, Deformation -from pymatgen import Structure +from pymatgen.core import Structure from pymatgen.io.vasp import Incar sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))) diff --git a/tests/auto_test/test_mpdb.py b/tests/auto_test/test_mpdb.py index 8323d77b0..1c3eca745 100644 --- a/tests/auto_test/test_mpdb.py +++ b/tests/auto_test/test_mpdb.py @@ -1,7 +1,7 @@ import os import sys import unittest -from pymatgen import Structure +from pymatgen.core import Structure from pymatgen.analysis.structure_matcher import StructureMatcher from monty.serialization import loadfn,dumpfn diff --git a/tests/auto_test/test_surface.py b/tests/auto_test/test_surface.py index 7e02bc880..12f72f608 100644 --- a/tests/auto_test/test_surface.py +++ b/tests/auto_test/test_surface.py @@ -4,7 +4,7 @@ import unittest import dpdata from monty.serialization import loadfn, dumpfn -from pymatgen import Structure +from pymatgen.core import Structure from pymatgen.io.vasp import Incar from pymatgen.core.surface import SlabGenerator diff --git a/tests/auto_test/test_vacancy.py b/tests/auto_test/test_vacancy.py index cb27bccd0..fa8894ed6 100644 --- a/tests/auto_test/test_vacancy.py +++ b/tests/auto_test/test_vacancy.py @@ -4,7 +4,7 @@ import unittest import dpdata from monty.serialization import loadfn, dumpfn -from pymatgen import Structure +from pymatgen.core import Structure from pymatgen.io.vasp import Incar from pymatgen.symmetry.analyzer import SpacegroupAnalyzer from pymatgen.analysis.defects.core import Vacancy as pmg_Vacancy diff --git a/tests/data/test_gen_bulk.py b/tests/data/test_gen_bulk.py index 92eb29084..73572d4e8 100644 --- a/tests/data/test_gen_bulk.py +++ b/tests/data/test_gen_bulk.py @@ -1,6 +1,6 @@ import os,sys,json,glob,shutil import unittest -from pymatgen import Structure,Composition +from pymatgen.core import Structure, Composition sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))) __package__ = 'data' diff --git a/tests/data/test_gen_surf.py b/tests/data/test_gen_surf.py index 63e9ed7a4..d40f6e1ab 100644 --- a/tests/data/test_gen_surf.py +++ b/tests/data/test_gen_surf.py @@ -1,6 +1,6 @@ import os,sys,json,glob,shutil import unittest -from pymatgen import Structure,Element +from pymatgen.core import Structure, Element sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))) __package__ = 'data' diff --git a/tests/data/test_gen_surf_poscar.py b/tests/data/test_gen_surf_poscar.py index 1ed44eac3..b47cb308b 100644 --- a/tests/data/test_gen_surf_poscar.py +++ b/tests/data/test_gen_surf_poscar.py @@ -1,6 +1,6 @@ import os,sys,json,glob,shutil import unittest -from pymatgen import Structure,Element +from pymatgen.core import Structure, Element sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))) __package__ = 'data'