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

Error when writing/converting foyer to gmso xml files #753

Open
bc118 opened this issue Aug 2, 2023 · 2 comments
Open

Error when writing/converting foyer to gmso xml files #753

bc118 opened this issue Aug 2, 2023 · 2 comments

Comments

@bc118
Copy link
Contributor

bc118 commented Aug 2, 2023

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:

example.zip

@bc118 bc118 changed the title Error when writing foyer to gmso xml files Error when writing/converting foyer to gmso xml files Aug 2, 2023
@CalCraven
Copy link
Contributor

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

@bc118
Copy link
Contributor Author

bc118 commented Nov 13, 2023

OK. But we should have some converter from foyer to GMSO, I think

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants