-
Notifications
You must be signed in to change notification settings - Fork 175
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
4 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,55 +1,32 @@ | ||
<<<<<<< HEAD | ||
import os | ||
======= | ||
import bson | ||
import gzip | ||
|
||
from pathlib import Path | ||
>>>>>>> 45fcce62 (Tidy polarization tests) | ||
|
||
from atomate.utils.testing import AtomateTest | ||
from atomate.vasp.firetasks.parse_outputs import PolarizationToDb | ||
|
||
__author__ = "Tess Smidt" | ||
__email__ = "[email protected]" | ||
|
||
<<<<<<< HEAD | ||
module_dir = os.path.dirname(os.path.abspath(__file__)) | ||
db_dir = os.path.join(module_dir, "..", "..", "..", "common", "test_files") | ||
ref_dir = os.path.join(module_dir, "..", "..", "test_files") | ||
module_dir = Path(__file__).resolve().parent | ||
db_dir = module_dir / "../../../common/test_files" | ||
ref_dir = module_dir / "../../test_files" | ||
|
||
|
||
DEBUG_MODE = ( | ||
True # If true, retains the database and output dirs at the end of the test | ||
) | ||
# If None, runs a "fake" VASP. Otherwise, runs VASP with this command... | ||
VASP_CMD = None | ||
======= | ||
module_dir = Path(__file__).resolve().parent | ||
db_dir = module_dir / "../../../common/test_files" | ||
<<<<<<< HEAD | ||
ref_dir = module_dir / "../..//test_files" | ||
>>>>>>> 45fcce62 (Tidy polarization tests) | ||
======= | ||
ref_dir = module_dir / "../../test_files" | ||
>>>>>>> fcdf2e63 (Finish tidying polarization tests) | ||
|
||
|
||
|
||
class TestPolarizationFiretasks(AtomateTest): | ||
def test_polarizationtodb(self): | ||
<<<<<<< HEAD | ||
import gzip | ||
|
||
import bson | ||
|
||
reference_dir = os.path.abspath(os.path.join(ref_dir, "ferroelectric_wf")) | ||
|
||
with gzip.open(os.path.join(reference_dir, "tasks.bson.gz")) as f: | ||
======= | ||
wf_dir = ref_dir / "ferroelectric_wf" | ||
|
||
with gzip.open(wf_dir / "tasks.bson.gz") as f: | ||
>>>>>>> 45fcce62 (Tidy polarization tests) | ||
coll_raw = f.read() | ||
|
||
coll = bson.decode_all(coll_raw) | ||
|
@@ -69,8 +46,4 @@ def test_polarizationtodb(self): | |
# Check recovered change in polarization | ||
coll = self.get_task_collection("polarization_tasks") | ||
d = coll.find_one() | ||
<<<<<<< HEAD | ||
self.assertAlmostEqual(d["polarization_change_norm"], 46.288752795325244, 5) | ||
======= | ||
self.assertAlmostEqual(d["polarization_change_norm"], 46.28875279532, 5) | ||
>>>>>>> 45fcce62 (Tidy polarization tests) |