Repository: mosdef-hub/gmso

Issue:
GMSO pulling atom class into atom type, which should be in atom type
GMSO is pulling the atom class into atom type, which should be in atom class.  An example of this is found when running the attached file with my mBuild GOMC-MoSDeF-GMSO branch (https://github.com/bc118/mbuild/tree/gmso_gomc).  This is at least when running the standard foyer oplsaa FF file.  

Since this seems to work when running from a gmso formatted XML, I suspect the issue is with the foyer XML to gmso XML converter.

**_File to run:_**
[test_test_charmm.zip](https://github.com/mosdef-hub/gmso/files/7741668/test_test_charmm.zip)


_**File printout when run:**_
writing the GOMC force field file 
res_x = ETH

bond_type_x = <BondType BondType-Harmonic-187, expression: k*(r - r_eq)**2, id: 140474783263632>
bond_type_x.member_classes = None
bond_type_x.member_types = ('CT', 'CT')
bond_type_x.parameters = {'k': unyt_quantity(224262.4, '1660538921*J/(1000000000000*m**2)'), 'r_eq': unyt_quantity(0.1529, 'm/1000000000')}

TypeError: ERROR: The ETH residue has a least one bond member_types that is not None. Currently, the Charmm writer only supports the member_class designations for bonds.



Discussion:
codecov[bot]: # [Codecov](https://codecov.io/gh/mosdef-hub/gmso/pull/622?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=mosdef-hub) Report
> Merging [#622](https://codecov.io/gh/mosdef-hub/gmso/pull/622?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=mosdef-hub) (002e02c) into [master](https://codecov.io/gh/mosdef-hub/gmso/commit/9d324f0988bce893655bd51e4dbeca27cd2fd9d6?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=mosdef-hub) (9d324f0) will **not change** coverage.
> The diff coverage is `100.00%`.

> :exclamation: Current head 002e02c differs from pull request most recent head 2a80112. Consider uploading reports for the commit 2a80112 to get more accurate results
[![Impacted file tree graph](https://codecov.io/gh/mosdef-hub/gmso/pull/622/graphs/tree.svg?width=650&height=150&src=pr&token=rqPGwmXDzu&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=mosdef-hub)](https://codecov.io/gh/mosdef-hub/gmso/pull/622?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=mosdef-hub)

```diff
@@           Coverage Diff           @@
##           master     #622   +/-   ##
=======================================
  Coverage   90.76%   90.76%           
=======================================
  Files          56       56           
  Lines        4625     4625           
=======================================
  Hits         4198     4198           
  Misses        427      427           
```


| [Impacted Files](https://codecov.io/gh/mosdef-hub/gmso/pull/622?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=mosdef-hub) | Coverage Δ | |
|---|---|---|
| [gmso/external/convert\_foyer\_xml.py](https://codecov.io/gh/mosdef-hub/gmso/pull/622/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=mosdef-hub#diff-Z21zby9leHRlcm5hbC9jb252ZXJ0X2ZveWVyX3htbC5weQ==) | `92.55% <100.00%> (ø)` | |

------

[Continue to review full report at Codecov](https://codecov.io/gh/mosdef-hub/gmso/pull/622?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=mosdef-hub).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=mosdef-hub)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/mosdef-hub/gmso/pull/622?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=mosdef-hub). Last update [9d324f0...2a80112](https://codecov.io/gh/mosdef-hub/gmso/pull/622?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=mosdef-hub). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=mosdef-hub).


Patch:
diff --git a/gmso/external/convert_foyer_xml.py b/gmso/external/convert_foyer_xml.py
index f410a5a..8185b77 100644
--- a/gmso/external/convert_foyer_xml.py
+++ b/gmso/external/convert_foyer_xml.py
@@ -235,7 +235,7 @@ def _populate_class_or_type_attrib(root, type_):
                 "type{}".format(j + 1), "c{}".format(j + 1)
             )
         elif "class" in item[0]:
-            root.attrib["type{}".format(j + 1)] = type_.get(
+            root.attrib["class{}".format(j + 1)] = type_.get(
                 "class{}".format(j + 1), "c{}".format(j + 1)
             )
 


Test patch:
diff --git a/gmso/tests/test_convert_foyer_xml.py b/gmso/tests/test_convert_foyer_xml.py
index c08acdc..5865442 100644
--- a/gmso/tests/test_convert_foyer_xml.py
+++ b/gmso/tests/test_convert_foyer_xml.py
@@ -102,7 +102,7 @@ class TestXMLConversion(BaseTest):
         assert foyer_fullerene.bond_types["C~C"].parameters[
             "k"
         ] == u.unyt_quantity(1000, u.kJ / u.mol / u.nm ** 2)
-        assert foyer_fullerene.bond_types["C~C"].member_types == ("C", "C")
+        assert foyer_fullerene.bond_types["C~C"].member_classes == ("C", "C")
 
     def test_foyer_angles(self, foyer_fullerene):
         assert len(foyer_fullerene.angle_types) == 1
@@ -118,7 +118,7 @@ class TestXMLConversion(BaseTest):
         assert foyer_fullerene.angle_types["C~C~C"].parameters[
             "theta_eq"
         ] == u.unyt_quantity(3.141592, u.rad)
-        assert foyer_fullerene.angle_types["C~C~C"].member_types == (
+        assert foyer_fullerene.angle_types["C~C~C"].member_classes == (
             "C",
             "C",
             "C",