Skip to content

Commit

Permalink
revert CI changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew-S-Rosen committed Feb 7, 2022
1 parent 2e9491f commit a66ab85
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 20 deletions.
10 changes: 5 additions & 5 deletions pymatgen/analysis/elasticity/tests/test_elastic.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,11 +263,11 @@ def test_init(self):
cijkl = Tensor.from_voigt(self.c2)
cijklmn = Tensor.from_voigt(self.c3)
exp = ElasticTensorExpansion([cijkl, cijklmn])
from_voigt = ElasticTensorExpansion.from_voigt([self.c2, self.c3])
ElasticTensorExpansion.from_voigt([self.c2, self.c3])
self.assertEqual(exp.order, 3)

def test_from_diff_fit(self):
exp = ElasticTensorExpansion.from_diff_fit(self.strains, self.pk_stresses)
ElasticTensorExpansion.from_diff_fit(self.strains, self.pk_stresses)

def test_calculate_stress(self):
calc_stress = self.exp.calculate_stress(self.strains[0])
Expand Down Expand Up @@ -333,7 +333,7 @@ def test_get_strain_from_stress(self):
self.assertArrayAlmostEqual(strain, strain_revert4, decimal=2)

def test_get_yield_stress(self):
ys = self.exp_cu_4.get_yield_stress([1, 0, 0])
self.exp_cu_4.get_yield_stress([1, 0, 0])


class NthOrderElasticTensorTest(PymatgenTest):
Expand Down Expand Up @@ -366,7 +366,7 @@ def test_calculate_stress(self):
calc_stress = self.c2.calculate_stress(self.strains[0])
self.assertArrayAlmostEqual(self.pk_stresses[0], calc_stress, decimal=0)
# Test calculation from voigt strain
calc_stress_voigt = self.c2.calculate_stress(self.strains[0].voigt)
self.c2.calculate_stress(self.strains[0].voigt)

def test_energy_density(self):
self.c3.energy_density(self.strains[0])
Expand Down Expand Up @@ -455,7 +455,7 @@ def test_generate_pseudo(self):
m4, abs = generate_pseudo(strain_states, order=4)

def test_fit(self):
cdf = diff_fit(self.strains, self.pk_stresses, self.data_dict["eq_stress"])
diff_fit(self.strains, self.pk_stresses, self.data_dict["eq_stress"])
reduced = [(e, pk) for e, pk in zip(self.strains, self.pk_stresses) if not (abs(abs(e) - 0.05) < 1e-10).any()]
# Get reduced dataset
r_strains, r_pk_stresses = zip(*reduced)
Expand Down
2 changes: 1 addition & 1 deletion pymatgen/analysis/tests/test_local_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -1476,7 +1476,7 @@ def tearDown(self):
warnings.filters = self.prev_warnings

def test_cn(self):
nn = Critic2NN()
Critic2NN()
# self.assertEqual(nn.get_cn(self.diamond, 0), 4)


Expand Down
4 changes: 2 additions & 2 deletions pymatgen/analysis/tests/test_molecule_matcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -674,7 +674,7 @@ def test_to_and_from_dict(self):
def test_missmatched_atoms(self):
mol2 = Molecule.from_file(os.path.join(test_dir, "Si2O_cluster.xyz"))
with self.assertRaises(ValueError):
res = self.mm.fit(mol2)
self.mm.fit(mol2)

def test_rotated_molecule(self):
mol2 = Molecule.from_file(os.path.join(test_dir, "Si_cluster_rotated.xyz"))
Expand Down Expand Up @@ -801,7 +801,7 @@ def setUpClass(cls):
def test_missmatched_atoms(self):
mol2 = Molecule.from_file(os.path.join(test_dir, "Si_cluster.xyz"))
with self.assertRaises(ValueError):
res = self.mm.fit(mol2)
self.mm.fit(mol2)

def test_rotated_molecule(self):
mol2 = Molecule.from_file(os.path.join(test_dir, "Si2O_cluster_rotated.xyz"))
Expand Down
2 changes: 1 addition & 1 deletion pymatgen/analysis/tests/test_path_finder.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class PathFinderTest(unittest.TestCase):
"""

def test_image_num(self):
module_dir = os.path.dirname(os.path.abspath(__file__))
os.path.dirname(os.path.abspath(__file__))
test_file_dir = os.path.join(PymatgenTest.TEST_FILES_DIR, "path_finder")
start_s = Poscar.from_file(os.path.join(test_file_dir, "LFP_POSCAR_s")).structure
end_s = Poscar.from_file(os.path.join(test_file_dir, "LFP_POSCAR_e")).structure
Expand Down
2 changes: 0 additions & 2 deletions pymatgen/command_line/tests/test_chargemol_caller.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
import os
import unittest

from monty.os.path import which

from pymatgen.command_line.chargemol_caller import ChargemolAnalysis
from pymatgen.util.testing import PymatgenTest

Expand Down
2 changes: 1 addition & 1 deletion pymatgen/command_line/tests/test_enumlib_caller.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ def test_partial_disorder(self):
@unittest.skip("Fails seemingly at random.")
def test_timeout(self):
s = Structure.from_file(filename=os.path.join(PymatgenTest.TEST_FILES_DIR, "garnet.cif"))
a = SpacegroupAnalyzer(s, 0.1)
SpacegroupAnalyzer(s, 0.1)
s["Al3+"] = {"Al3+": 0.5, "Ga3+": 0.5}
adaptor = EnumlibAdaptor(s, 1, 1, enum_precision_parameter=0.01, timeout=0.0000000000001)
self.assertRaises(TimeoutError, adaptor._run_multienum)
Expand Down
8 changes: 4 additions & 4 deletions pymatgen/command_line/tests/test_gulp_caller.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def test_run(self):

"""Some inherent checks are in the run_gulp function itself.
They should be suffcient for raising errors."""
gout = gc.run(gin)
gc.run(gin)

def test_decimal(self):
struct = Structure.from_str(
Expand Down Expand Up @@ -95,7 +95,7 @@ def test_decimal(self):
gio = GulpIO()
input = gio.buckingham_input(struct, ["relax conp"])
caller = GulpCaller()
gout = caller.run(input)
caller.run(input)


@unittest.skipIf(not gulp_present, "gulp not present.")
Expand Down Expand Up @@ -139,7 +139,7 @@ def test_library_line_explicit_path(self):

def test_library_line_wrong_file(self):
with self.assertRaises(GulpError):
gin = self.gio.library_line("temp_to_fail.lib")
self.gio.library_line("temp_to_fail.lib")

def test_buckingham_potential(self):
mgo_latt = [[4.212, 0, 0], [0, 4.212, 0], [0, 0, 4.212]]
Expand Down Expand Up @@ -260,7 +260,7 @@ def test_get_relaxed_structure(self):

@unittest.skip("Test later")
def test_tersoff_inpt(self):
gin = self.gio.tersoff_input(self.structure)
self.gio.tersoff_input(self.structure)


@unittest.skipIf(not gulp_present, "gulp not present.")
Expand Down
4 changes: 2 additions & 2 deletions pymatgen/io/lobster/tests/test_lobster.py
Original file line number Diff line number Diff line change
Expand Up @@ -635,8 +635,8 @@ def setUp(self):
# not spin polarized
doscar2 = os.path.join(test_dir_doscar, "DOSCAR.lobster.nonspin")
poscar2 = os.path.join(test_dir_doscar, "POSCAR.lobster.nonspin_DOS")
doscarzip = os.path.join(test_dir_doscar, "DOSCAR.lobster.nonspin_zip.gz")
poscarzip = os.path.join(test_dir_doscar, "POSCAR.lobster.nonspin_DOS_zip.gz")
os.path.join(test_dir_doscar, "DOSCAR.lobster.nonspin_zip.gz")
os.path.join(test_dir_doscar, "POSCAR.lobster.nonspin_DOS_zip.gz")
self.DOSCAR_spin_pol = Doscar(doscar=doscar, structure_file=poscar)
self.DOSCAR_nonspin_pol = Doscar(doscar=doscar2, structure_file=poscar2)

Expand Down
4 changes: 2 additions & 2 deletions pymatgen/io/qchem/tests/test_inputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ def test_scan_template(self):

bad_scan = {"stre": ["1 2 1.0 2.0 0.05", "3 4 1.5 2.0 0.05"], "bend": ["7 8 9 90 120 10"]}
with self.assertRaises(ValueError):
bad_scan_test = QCInput.scan_template(bad_scan)
QCInput.scan_template(bad_scan)

def test_van_der_waals_template(self):
vdw_params = {1: 1.20, 12: 1.72}
Expand Down Expand Up @@ -737,7 +737,7 @@ def test_read_bad_scan(self):
$end"""

with self.assertRaises(ValueError):
scan_test_2 = QCInput.read_scan(str_scan_2)
QCInput.read_scan(str_scan_2)

def test_read_negative(self):
str_molecule = """$molecule
Expand Down

0 comments on commit a66ab85

Please sign in to comment.