Skip to content

Commit

Permalink
Fix typo in _get_untyped_sites (#575)
Browse files Browse the repository at this point in the history
* fix typo

* rename test_get_untyped

* fix minor typo
  • Loading branch information
daico007 committed Jul 21, 2021
1 parent 69e8d0d commit 00f329c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions gmso/core/topology.py
Original file line number Diff line number Diff line change
Expand Up @@ -790,12 +790,12 @@ def get_untyped(self, group):
}
if group == "topology":
for subgroup in untyped_extractors:
untyped.update(untyped_extractors[subgroup])
elif group in untyped_extractors:
untyped = untyped_extractors[group]()
untyped.update(untyped_extractors[subgroup]())
elif isinstance(group, (list, tuple, set)):
for subgroup in group:
untyped.update(untyped_extractors[subgroup]())
elif isinstance(group, str) and group in untyped_extractors:
untyped = untyped_extractors[group]()
else:
raise ValueError(
f"Cannot get untyped {group}. "
Expand All @@ -808,7 +808,7 @@ def _get_untyped_sites(self):
untyped = {"sites": list()}
for site in self._sites:
if not site.atom_type:
untyped[sites].append(site)
untyped["sites"].append(site)
return untyped

def _get_untyped_bonds(self):
Expand Down
6 changes: 3 additions & 3 deletions gmso/tests/test_topology.py
Original file line number Diff line number Diff line change
Expand Up @@ -736,7 +736,7 @@ def test_is_typed_check(self, typed_chloroethanol):
with pytest.raises(ValueError):
typed_chloroethanol.is_fully_typed(group="foo")

def get_untyped(self, typed_chloroethanol):
def test_cget_untyped(self, typed_chloroethanol):
# Note impropers list is empty, and hence is not tested here
groups = ["sites", "bonds", "angles", "dihedrals"]
clone = deepcopy(typed_chloroethanol)
Expand All @@ -748,8 +748,8 @@ def get_untyped(self, typed_chloroethanol):
full_opt = clone.get_untyped(group="topology")
for group in groups:
assert not clone.is_fully_typed(group=group)
assert len(clone.get_untyped(group=group)) == 1
assert len(full_opt[group] == 1)
assert len(clone.get_untyped(group=group)[group]) == 1
assert len(full_opt[group]) == 1

# Get multiple untyped
untyped_sites_angles = clone.get_untyped(group=["sites", "angles"])
Expand Down

0 comments on commit 00f329c

Please sign in to comment.