forked from mosdef-hub/mbuild
-
Notifications
You must be signed in to change notification settings - Fork 1
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
15 changed files
with
149 additions
and
47 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
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
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
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
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
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 |
---|---|---|
|
@@ -26,3 +26,4 @@ def main(): | |
|
||
if __name__ == "__main__": | ||
main() | ||
methane.visualize() |
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
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
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
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 |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import pytest | ||
|
||
import mbuild as mb | ||
from mbuild.tests.base_test import BaseTest | ||
|
||
|
||
class TestMask(BaseTest): | ||
|
||
@pytest.mark.skipif(True, reason='Needs implementing!') | ||
def test_apply_mask(self): | ||
pass | ||
|
||
def test_random_2d(self): | ||
mask = mb.random_mask_2d(100) | ||
assert len(mask) == 100 | ||
|
||
def test_random_3d(self): | ||
mask = mb.random_mask_3d(100) | ||
assert len(mask) == 100 | ||
|
||
def test_grid_2d(self): | ||
mask = mb.grid_mask_2d(10, 5) | ||
assert len(mask) == 50 | ||
|
||
def test_grid_3d(self): | ||
mask = mb.grid_mask_3d(10, 5, 2) | ||
assert len(mask) == 100 | ||
|
||
def test_sphere(self): | ||
mask = mb.sphere_mask(100) | ||
assert len(mask) == 100 | ||
|
||
def test_disk(self): | ||
mask = mb.disk_mask(100) | ||
assert len(mask) == 100 |
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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import mbuild as mb | ||
from mbuild.tests.base_test import BaseTest | ||
|
||
|
||
class TestPacking(BaseTest): | ||
|
||
def test_fill_box(self, ethane): | ||
filled = mb.fill_box(ethane, n_compounds=20, box=[2, 2, 2]) | ||
assert filled.n_atoms == 20 * 8 | ||
assert filled.n_bonds == 20 * 7 | ||
|
||
def test_solvate(self, ethane, h2o): | ||
solvated = mb.solvate(ethane, h2o, n_solvent=100, box=[4, 4, 4]) | ||
assert solvated.n_atoms == 8 + 100 * 3 | ||
assert solvated.n_bonds == 7 + 100 * 2 |
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import mbuild as mb | ||
from mbuild.tests.base_test import BaseTest | ||
|
||
|
||
class TestPolymer(BaseTest): | ||
|
||
def test_polymer(self, ch2): | ||
n = 6 | ||
c6 = mb.Polymer(ch2, n=n) | ||
assert c6.n_atoms == n * 3 | ||
assert c6.n_bonds == n * 2 + (n - 1) |
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 |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import pytest | ||
|
||
import mbuild as mb | ||
from mbuild.tests.base_test import BaseTest | ||
|
||
|
||
class TestTiledCompound(BaseTest): | ||
|
||
def test_2d_replication(self, betacristobalite): | ||
nx = 2 | ||
ny = 3 | ||
nz = 1 | ||
tiled = mb.TiledCompound(betacristobalite, [nx, ny, nz]) | ||
assert tiled.n_atoms == 1800 * nx * ny * nz | ||
assert tiled.n_bonds == 2300 * nx * ny * nz | ||
|
||
def test_incorrect_periodicity(self, betacristobalite): | ||
nx = 2 | ||
ny = 3 | ||
nz = 2 | ||
with pytest.raises(ValueError): | ||
mb.TiledCompound(betacristobalite, [nx, ny, nz]) | ||
|
||
def test_negative_periodicity(self, betacristobalite): | ||
nx = -2 | ||
ny = 3 | ||
nz = 2 | ||
with pytest.raises(ValueError): | ||
mb.TiledCompound(betacristobalite, [nx, ny, nz]) | ||
|
||
|
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
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