Bug in the python code?

GROMACS version:2020
GROMACS modification: No
Here post your question

Hi all,

I have written a python code which work previously:

pdb2gmx = gmx.commandline_operation(‘gmx_mpi’, arguments =[‘pdb2gmx’], input_files={’-f’:“XXX_fix.pdb”, ‘-water’:“tip3p”, ‘-ignh’:“yes”}, output_files={’-o’:“conf.gro”},stdin=‘1’)

Now it doesn’t work since I updated it and it is showing this error:

File “”, line 1, in
File “/home/yb87625/myvenv/lib64/python3.6/site-packages/gmxapi/commandline.py”, line 302, in commandline_operation
cli_result = cli(**cli_args)
File “/home/yb87625/myvenv/lib64/python3.6/site-packages/gmxapi/operation.py”, line 2838, in helper
handle = OperationDetails.operation_director(*args, context=context, label=None, **kwargs)
File “/home/yb87625/myvenv/lib64/python3.6/site-packages/gmxapi/operation.py”, line 1295, in operation_director
return construct()
File “/home/yb87625/myvenv/lib64/python3.6/site-packages/gmxapi/operation.py”, line 2568, in call
data_source_collection = node_input_factory(*self.args, **self.kwargs)
File “/home/yb87625/myvenv/lib64/python3.6/site-packages/gmxapi/operation.py”, line 457, in bind
raise exceptions.UsageError(‘Could not bind operation parameters to function signature.’) from e
gmxapi.exceptions.UsageError: Could not bind operation parameters to function signature.

I notice it will work if I delete " stdin=‘1’ ", but that is required for choosing forcefield for pdb2gmx command. Thus, is this a bug or something I did wrong?



@ericirrgang should know about this

You mention an update. Can you clarify what was updated?

Note that the Python package that shipped with Gromacs 2020 is version 0.1, which did not provide the stdin key word argument for commandline_operation.

Can you clarify how you installed the Python package and which version you have installed? E.g. python -c 'import gmxapi; print(gmxapi.__version__)'

The beta version of gmxapi 0.2 currently requires the beta version of GROMACS 2021. I think you must have been using a pre-release version of the package. For the moment, I think https://pypi.org/project/gmxapi/0.2.0a1/ is your best bet.

Hi Eric,

Thanks, you are right. The problem account is using gmxapi 0.1.0. Seems like my other account is using gmxapi 0.2.0al. Okay, I will download GROMACS 2021.