Skip to content

Commit 081a625

Browse files
author
Simon Gravelle
committed
performed some tests
1 parent a893d21 commit 081a625

File tree

1 file changed

+4
-24
lines changed

1 file changed

+4
-24
lines changed

integration_tests/test_monte_carlo_move.py

Lines changed: 4 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,17 @@ def setUp(self):
2525
sig_1 = 3 * ureg.angstrom # Define LJ parameters (sigma)
2626
eps_1 = 0.1 * ureg.kcal/ureg.mol # Define LJ parameters (epsilon)
2727
mss_1 = 10 * ureg.gram/ureg.mol # Define atom mass
28-
L = 20 * ureg.angstrom # Define box size
28+
L = 14 * ureg.angstrom # Define box size
2929
rc = 2.5 * sig_1 # Define cut_off
3030
T = 300 * ureg.kelvin # Pick the desired temperature
3131
displace_mc = sig_1/4 # choose the displace_mc
3232

3333
# Initialize the MonteCarlo object
3434
self.mc = MonteCarlo(
3535
ureg = ureg,
36-
maximum_steps = 50000,
37-
thermo_period = 1000,
38-
dumping_period = 1000,
36+
maximum_steps = 5000,
37+
thermo_period = 100,
38+
dumping_period = 100,
3939
number_atoms = [nmb_1],
4040
epsilon = [eps_1],
4141
sigma = [sig_1],
@@ -48,26 +48,6 @@ def setUp(self):
4848
displace_mc = displace_mc,
4949
)
5050

51-
"""
52-
def test_monte_carlo_run(self):
53-
# Test if the Monte Carlo simulation runs without errors.
54-
try:
55-
# Run the Monte Carlo simulation (this should not raise an exception)
56-
ti = time.time()
57-
58-
# Profile the run() method
59-
self.mc.run()
60-
# self.mc.run()
61-
# If it runs successfully, assert True
62-
tf = time.time()
63-
64-
print("Duration:", np.round(tf-ti, 2), "s")
65-
self.assertTrue(True)
66-
except Exception as e:
67-
# If any exception occurs, fail the test and print the error
68-
self.fail(f"Monte Carlo simulation failed with error: {e}")
69-
"""
70-
7151
def test_monte_carlo_run(self):
7252
"""Test if the Monte Carlo simulation runs without errors."""
7353
profiler = cProfile.Profile()

0 commit comments

Comments
 (0)