Skip to content

Commit 7941ba4

Browse files
rwsmith7531daico007pre-commit-ci[bot]
authored
Write LJ parameters with 5 decimal places instead of 3 with MCF writer. (#1095)
* Write LJ parameters with 5 decimal places instead of 3 with MCF writer. * fix assert value to include more sigfig * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: Co Quach <43968221+daico007@users.noreply.github.com> Co-authored-by: Co Quach <daico007@gmail.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 3d64ab4 commit 7941ba4

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

mbuild/formats/cassandramcf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@ def _write_atom_information(mcf_file, structure, in_ring, IG_CONSTANT_KCAL):
377377
for i in range(len(structure.atoms)):
378378
mcf_file.write(
379379
"{:<4d} {:<6s} {:<2s} {:7.3f} {:12.8f} "
380-
"{:3s} {:8.3f} {:8.3f}".format(
380+
"{:3s} {:8.5f} {:8.5f}".format(
381381
i + 1,
382382
types[i],
383383
elements[i],

mbuild/tests/test_cassandramcf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ def test_save_forcefield(self, ethane):
220220
assert isclose(float(mcf_data[atom_section_start + 2][3]), 12.011)
221221
assert isclose(float(mcf_data[atom_section_start + 2][4]), -0.18)
222222
assert mcf_data[atom_section_start + 2][5] == "LJ"
223-
assert isclose(float(mcf_data[atom_section_start + 2][6]), 33.212)
223+
assert isclose(float(mcf_data[atom_section_start + 2][6]), 33.21249)
224224
assert isclose(float(mcf_data[atom_section_start + 2][7]), 3.500)
225225

226226
# Bond info
@@ -317,7 +317,7 @@ def test_save_ring_forcefield(self, benzene):
317317
assert isclose(float(mcf_data[atom_section_start + 2][3]), 12.011)
318318
assert isclose(float(mcf_data[atom_section_start + 2][4]), -0.115)
319319
assert mcf_data[atom_section_start + 2][5] == "LJ"
320-
assert isclose(float(mcf_data[atom_section_start + 2][6]), 35.225)
320+
assert isclose(float(mcf_data[atom_section_start + 2][6]), 35.22537)
321321
assert isclose(float(mcf_data[atom_section_start + 2][7]), 3.550)
322322
assert mcf_data[atom_section_start + 2][8] == "ring"
323323

0 commit comments

Comments
 (0)