Skip to content

Commit

Permalink
Propagate kwargs in mb.load when backend is gmso. Fix mosdef-hub#1034
Browse files Browse the repository at this point in the history
  • Loading branch information
umesh-timalsina committed Apr 26, 2022
1 parent a1611f1 commit cb7fa65
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
2 changes: 1 addition & 1 deletion mbuild/conversion.py
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ def load_file(
if backend == "gmso":
gmso = import_("gmso")

top = gmso.Topology.load(filename=filename)
top = gmso.Topology.load(filename=filename, **kwargs)
compound = from_gmso(
topology=top,
compound=compound,
Expand Down
18 changes: 18 additions & 0 deletions mbuild/tests/test_mol2file.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,21 @@ def test_gmso_backend(self):
for particle in gmso_silica_surface:
element_set.add(particle.element)
assert len(element_set) == 2

def test_gmso_backend_lj_site_type(self):
pmd_silica_surface = mb.load(
filename_or_object=get_fn("beta-cristobalite-expanded.mol2"),
backend="parmed",
site_type="lj",
)
gmso_silica_surface = mb.load(
filename_or_object=get_fn("beta-cristobalite-expanded.mol2"),
backend="gmso",
site_type="lj",
)

assert pmd_silica_surface.n_particles == gmso_silica_surface.n_particles
assert pmd_silica_surface.n_bonds == gmso_silica_surface.n_bonds

for particle in gmso_silica_surface:
assert particle.element is None

0 comments on commit cb7fa65

Please sign in to comment.