Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove all references to mbuild loaders so tests begin to work #862

Merged
merged 2 commits into from
Dec 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion environment-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ dependencies:
- pydantic>=2
- networkx
- pytest
- mbuild>=0.17.0
- mbuild>=1.1
- openbabel>=3.0.0
- foyer>=0.11.3
- forcefield-utilities>=0.2.1
Expand Down
6 changes: 4 additions & 2 deletions gmso/tests/base_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,15 +76,17 @@ def typed_benzene_ua_system(self, benzene_ua_box):
@pytest.fixture
def benzene_aa(self):
compound = mb.load(get_fn("benzene.mol2"))
compound.children[0].name = "BenzeneAA"
compound.flatten()
compound.name = "BenzeneAA"
top = from_mbuild(compound)
top.identify_connections()
return top

@pytest.fixture
def benzene_aa_box(self):
compound = mb.load(get_fn("benzene.mol2"))
compound.children[0].name = "BenzeneAA"
compound.flatten()
compound.name = "BenzeneAA"
compound_box = mb.packing.fill_box(compound=compound, n_compounds=5, density=1)
top = from_mbuild(compound_box)
top.identify_connections()
Expand Down
177 changes: 58 additions & 119 deletions gmso/tests/files/charmm.lammps
Original file line number Diff line number Diff line change
@@ -1,130 +1,69 @@
calcraven written by Topology at 2023-12-07 19:10:26.697824 using the GMSO LAMMPS Writer
Using Forcefield Topology_ForceField

9 atoms
8 bonds
12 angles
12 dihedrals
5 impropers

6 atom types
5 bond types
7 angle types
5 dihedral types
3 improper types

0.000000 20.000000 xlo xhi
0.000000 20.000000 ylo yhi
0.000000 20.000000 zlo zhi
0.000000 0.000000 0.000000 xy xz yz
charmm.lammps - created by mBuild; units = real

4 atoms
3 bonds
3 angles
0 dihedrals
1 impropers

4 atom types
3 bond types
3 angle types
1 improper types

0.000000 25.000000 xlo xhi
0.000000 15.000000 ylo yhi
0.000000 6.000000 zlo zhi

Masses
# mass (amu)
1 12.010 # c
2 12.010 # c3
3 19.000 # f
4 1.008 # hn
5 14.010 # n
6 16.000 # o

Pair Coeffs # 4*epsilon*(-sigma**6/r**6 + sigma**12/r**12)
# epsilon (kcal/mol) sigma (Å)
1 0.08600 3.39967 # c
2 0.10940 3.39967 # c3
3 0.06100 3.11815 # f
4 0.01570 1.06908 # hn
5 0.17000 3.25000 # n
6 0.21000 2.95992 # o

Bond Coeffs #LAMMPSHarmonicBondPotential
# k (kcal/(mol*Å**2)) r_eq (Å)
1 313.000000 1.524100 # c c3
2 427.600000 1.378900 # c n
3 637.700000 1.218300 # c o
4 356.900000 1.349700 # c3 f
5 403.200000 1.012900 # hn n

Angle Coeffs #LAMMPSHarmonicAnglePotential
# k (kcal/(mol*rad**2)) theta_eq (degrees)
1 66.800000 115.180000 #c3 c n
2 67.400000 123.200000 #c3 c o
3 74.200000 123.050000 #n c o
4 66.300000 110.000000 #c c3 f
5 70.900000 107.360000 #f c3 f
6 48.300000 117.550000 #c n hn
7 39.600000 117.950000 #hn n hn

Dihedral Coeffs #PeriodicTorsionPotential
# k (kcal/mol) n (dimensionless) phi_eq (degrees) weights (dimensionless)
1 2.500000 2 180 0.0 # n c c3 f
2 1.200000 2 180 0.0 # o c c3 f
3 10.000000 2 180 0.0 # c3 c n hn
4 2.500000 2 180 0.0 # o c n hn
5 2.000000 1 0 0.0 # o c n hn

Improper Coeffs #PeriodicTorsionPotential
# k (kcal/mol) d (dimensionless) phi_eq (degrees)
1 1.100000 2 180
2 1.100000 2 180
3 1.100000 2 180

Atoms #full

1 1 1 0.489360 0.110700 -0.58950 0.021100
2 1 6 -0.40437 -0.03070 -1.83510 -0.10770
3 1 2 0.523890 -0.97100 0.342700 -0.43070
4 1 3 -0.18349 -1.41570 1.088800 0.644700
5 1 3 -0.18349 -2.03550 -0.36720 -0.95820
6 1 3 -0.18349 -0.47200 1.192900 -1.39980
7 1 5 -0.74567 1.308100 -0.07150 0.600200
8 1 4 0.343630 1.442000 0.957800 0.714400
9 1 4 0.343630 2.064000 -0.71890 0.916100

1 12.011000 # CL
2 12.011000 # CTL2
3 15.994000 # OBL
4 15.994000 # OHL

Pair Coeffs # lj
# epsilon (kcal/mol) sigma (Angstrom)
1 0.07000 3.56359 # CL
2 0.05600 3.58141 # CTL2
3 0.12000 3.02906 # OBL
4 0.15210 3.15378 # OHL

Bond Coeffs # harmonic
# k(kcal/mol/angstrom^2) req(angstrom)
1 200.0 1.522 # CL CTL2
2 750.0 1.22 # CL OBL
3 230.0 1.4 # CL OHL

Angle Coeffs # charmm
# k(kcal/mol/rad^2) theteq(deg) k(kcal/mol/angstrom^2) req(angstrom)
1 70.0 125.00000 20.00000 2.44200
2 55.0 110.50000 0.00000 0.00000
3 50.0 123.00000 210.00000 2.26200

Improper Coeffs # harmonic
#k, phi
1 100.00000 0.00000 # CL CTL2 OBL OHL

Atoms # full

1 1 2 0.000000 -10.000000 0.000000 0.000000
2 1 1 0.000000 0.000000 0.000000 0.000000
3 1 3 0.000000 10.000000 0.000000 0.000000
4 1 4 0.000000 0.000000 10.000000 0.000000

Bonds

1 3 1 2
2 1 1 3
3 2 1 7
4 4 3 4
5 4 3 5
6 4 3 6
7 5 7 8
8 5 7 9
1 1 1 2
2 2 2 3
3 3 2 4

Angles

1 2 2 1 3
2 3 2 1 7
3 1 3 1 7
4 4 1 3 4
5 4 1 3 5
6 4 1 3 6
7 5 4 3 5
8 5 4 3 6
9 5 5 3 6
10 6 1 7 8
11 6 1 7 9
12 7 8 7 9

Dihedrals

1 2 2 1 3 4
2 2 2 1 3 5
3 2 2 1 3 6
4 4 2 1 7 8
5 5 2 1 7 8
6 4 2 1 7 9
7 5 2 1 7 9
8 3 3 1 7 8
9 3 3 1 7 9
10 1 7 1 3 4
11 1 7 1 3 5
12 1 7 1 3 6
1 1 1 2 3
2 2 1 2 4
3 3 3 2 4

Impropers

1 1 1 2 3 7
2 2 3 1 4 5
3 2 3 1 4 6
4 2 3 1 5 6
5 3 7 1 8 9
1 1 2 1 3 4
104 changes: 104 additions & 0 deletions gmso/tests/files/parmed-ethane.mcf
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
!*******************************************************************************
!Molecular connectivity file
!*******************************************************************************
!parmed-ethane.mcf - created by mBuild

!Atom Format
!index type element mass charge vdw_type parameters
!vdw_type="LJ", parms=epsilon sigma
!vdw_type="Mie", parms=epsilon sigma repulsion_exponent dispersion_exponent

# Atom_Info
8
1 opls_135 C 12.011 -0.18000000 LJ 33.21249 3.50000
2 opls_140 H 1.008 0.06000000 LJ 15.09659 2.50000
3 opls_140 H 1.008 0.06000000 LJ 15.09659 2.50000
4 opls_140 H 1.008 0.06000000 LJ 15.09659 2.50000
5 opls_135 C 12.011 -0.18000000 LJ 33.21249 3.50000
6 opls_140 H 1.008 0.06000000 LJ 15.09659 2.50000
7 opls_140 H 1.008 0.06000000 LJ 15.09659 2.50000
8 opls_140 H 1.008 0.06000000 LJ 15.09659 2.50000

!Bond Format
!index i j type parameters
!type="fixed", parms=bondLength

# Bond_Info
7
1 1 2 fixed 1.090
2 1 3 fixed 1.090
3 1 4 fixed 1.090
4 1 5 fixed 1.529
5 5 6 fixed 1.090
6 5 7 fixed 1.090
7 5 8 fixed 1.090

!Angle Format
!index i j k type parameters
!type="fixed", parms=equilibrium_angle
!type="harmonic", parms=force_constant equilibrium_angle

# Angle_Info
12
1 1 5 6 harmonic 18870.7 110.70
2 1 5 7 harmonic 18870.7 110.70
3 1 5 8 harmonic 18870.7 110.70
4 2 1 3 harmonic 16606.2 107.80
5 2 1 4 harmonic 16606.2 107.80
6 2 1 5 harmonic 18870.7 110.70
7 3 1 4 harmonic 16606.2 107.80
8 3 1 5 harmonic 18870.7 110.70
9 4 1 5 harmonic 18870.7 110.70
10 6 5 7 harmonic 16606.2 107.80
11 6 5 8 harmonic 16606.2 107.80
12 7 5 8 harmonic 16606.2 107.80

!Dihedral Format
!index i j k l type parameters
!type="none"
!type="CHARMM", parms=a0 a1 delta
!type="OPLS", parms=c0 c1 c2 c3
!type="harmonic", parms=force_constant equilibrium_dihedral

# Dihedral_Info
9
1 2 1 5 6 OPLS 0.000 0.000 -0.000 0.628
2 2 1 5 7 OPLS 0.000 0.000 -0.000 0.628
3 2 1 5 8 OPLS 0.000 0.000 -0.000 0.628
4 3 1 5 6 OPLS 0.000 0.000 -0.000 0.628
5 3 1 5 7 OPLS 0.000 0.000 -0.000 0.628
6 3 1 5 8 OPLS 0.000 0.000 -0.000 0.628
7 4 1 5 6 OPLS 0.000 0.000 -0.000 0.628
8 4 1 5 7 OPLS 0.000 0.000 -0.000 0.628
9 4 1 5 8 OPLS 0.000 0.000 -0.000 0.628

!Improper Format
!index i j k l type parameters
!type="harmonic", parms=force_constant equilibrium_improper

# Improper_Info
0

!Fragment Format
!index number_of_atoms_in_fragment branch_point other_atoms

# Fragment_Info
2
1 5 1 2 3 4 5
2 5 5 1 6 7 8


# Fragment_Connectivity
1
1 1 2

!Intra Scaling
!vdw_scaling 1-2 1-3 1-4 1-N
!charge_scaling 1-2 1-3 1-4 1-N

# Intra_Scaling
0. 0. 0.5000 1.
0. 0. 0.5000 1.


END
60 changes: 30 additions & 30 deletions gmso/tests/files/restrained_benzene_ua.gro
Original file line number Diff line number Diff line change
@@ -1,33 +1,33 @@
Topology written by GMSO 0.9.1 at 2022-11-07 11:51:34.770776
30
1Compo _CH 1 5.127 3.773 4.686
1Compo _CH 2 5.204 3.757 4.802
1Compo _CH 3 5.343 3.766 4.796
1Compo _CH 4 5.407 3.793 4.674
1Compo _CH 5 5.330 3.809 4.558
1Compo _CH 6 5.191 3.800 4.564
2Compo _CH 7 3.490 3.266 4.318
2Compo _CH 8 3.547 3.139 4.298
2Compo _CH 9 3.552 3.048 4.404
2Compo _CH 10 3.500 3.084 4.530
2Compo _CH 11 3.444 3.210 4.549
2Compo _CH 12 3.439 3.302 4.443
3Compo _CH 13 6.609 1.796 0.837
3Compo _CH 14 6.516 1.728 0.758
3Compo _CH 15 6.535 1.593 0.727
3Compo _CH 16 6.648 1.526 0.776
3Compo _CH 17 6.741 1.594 0.855
3Compo _CH 18 6.721 1.729 0.886
4Compo _CH 19 6.543 2.442 2.196
4Compo _CH 20 6.657 2.484 2.126
4Compo _CH 21 6.644 2.558 2.008
4Compo _CH 22 6.517 2.591 1.960
4Compo _CH 23 6.403 2.549 2.029
4Compo _CH 24 6.416 2.474 2.147
5Compo _CH 25 6.699 5.604 7.130
5Compo _CH 26 6.652 5.661 7.011
5Compo _CH 27 6.611 5.795 7.010
5Compo _CH 28 6.618 5.872 7.127
5Compo _CH 29 6.666 5.814 7.245
5Compo _CH 30 6.706 5.680 7.247
1Benze _CH 1 5.127 3.773 4.686
1Benze _CH 2 5.204 3.757 4.802
1Benze _CH 3 5.343 3.766 4.796
1Benze _CH 4 5.407 3.793 4.674
1Benze _CH 5 5.330 3.809 4.558
1Benze _CH 6 5.191 3.800 4.564
2Benze _CH 7 3.490 3.266 4.318
2Benze _CH 8 3.547 3.139 4.298
2Benze _CH 9 3.552 3.048 4.404
2Benze _CH 10 3.500 3.084 4.530
2Benze _CH 11 3.444 3.210 4.549
2Benze _CH 12 3.439 3.302 4.443
3Benze _CH 13 6.609 1.796 0.837
3Benze _CH 14 6.516 1.728 0.758
3Benze _CH 15 6.535 1.593 0.727
3Benze _CH 16 6.648 1.526 0.776
3Benze _CH 17 6.741 1.594 0.855
3Benze _CH 18 6.721 1.729 0.886
4Benze _CH 19 6.543 2.442 2.196
4Benze _CH 20 6.657 2.484 2.126
4Benze _CH 21 6.644 2.558 2.008
4Benze _CH 22 6.517 2.591 1.960
4Benze _CH 23 6.403 2.549 2.029
4Benze _CH 24 6.416 2.474 2.147
5Benze _CH 25 6.699 5.604 7.130
5Benze _CH 26 6.652 5.661 7.011
5Benze _CH 27 6.611 5.795 7.010
5Benze _CH 28 6.618 5.872 7.127
5Benze _CH 29 6.666 5.814 7.245
5Benze _CH 30 6.706 5.680 7.247
8.42655 8.42655 8.42655
Loading
Loading