gmso
gmso copied to clipboard
Error when writing/converting foyer to gmso xml files
It seems there is an error with a path function in the gmso.external.convert_foyer_xml_write_gmso_xml function
. However, it seems to do the foyer to gmso XML conversion properly. I attached a simple spce water file example.
Output error:
(mosdef_gomc) [brad@localhost example]$ python convert_foyer_to_gmso_xml.py
/home/brad/Programs/anaconda3/envs/mosdef_gomc/lib/python3.10/site-packages/mbuild/recipes/__init__.py:13: DeprecationWarning: SelectableGroups dict interface is deprecated. Use select.
entry_points = metadata.entry_points()["mbuild.plugins"]
Traceback (most recent call last):
File "/run/media/brad/raid1/brad_files/atomfold/simulations/heavy_metals/common/example/convert_foyer_to_gmso_xml.py", line 18, in <module>
_write_gmso_xml(gmso_xml_1)
File "/home/brad/Programs/anaconda3/envs/mosdef_gomc/lib/python3.10/site-packages/gmso/external/convert_foyer_xml.py", line 140, in _write_gmso_xml
forcefield.attrib["name"] = pathlib.Path(gmso_xml).stem
File "/home/brad/Programs/anaconda3/envs/mosdef_gomc/lib/python3.10/pathlib.py", line 960, in __new__
self = cls._from_parts(args)
File "/home/brad/Programs/anaconda3/envs/mosdef_gomc/lib/python3.10/pathlib.py", line 594, in _from_parts
drv, root, parts = self._parse_args(args)
File "/home/brad/Programs/anaconda3/envs/mosdef_gomc/lib/python3.10/pathlib.py", line 578, in _parse_args
a = os.fspath(a)
TypeError: expected str, bytes or os.PathLike object, not NoneType
Example:
I think this also needs to get deprecated, as that whole module has lost it's usefulness. The replacement function is in gmso/core/forcefield.py: ForceField.to_xml(filename)
function
OK. But we should have some converter from foyer to GMSO, I think