Becksteinlab / GromacsWrapper

GromacsWrapper wraps system calls to GROMACS tools into thin Python classes (GROMACS 4.6.5 - 2024 supported).

Home Page:https://gromacswrapper.readthedocs.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

tools not loaded for Gromacs 2016/2018 in Python 3 on macOS

orbeckst opened this issue · comments

When using Gromacs 2016/2018 (the gmx command) and Python 3 (and apparently only on macOS) then the tools are not correctly loaded; only tools.Gmx appears.

Reason: byte string snafu

            out = subprocess.check_output([driver, '-quiet', 'help',
                                           'commands'])
            for line in str(out).encode('ascii').splitlines()[5:-1]:

The subprocess.check_output() returns a b string,

>>> type(out)
bytes

which, when converted with str(), does not maintain the newlines but rather includes them quoted
and then splitlines() does not work anymore.

This was introduced in PR #127 but not caught because we are only testing on Linux.