-
Notifications
You must be signed in to change notification settings - Fork 13
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
Python wrapper for CLI programs #200
Conversation
ce4cffe
to
d670a18
Compare
src/gmx/__init__.py
Outdated
@@ -103,6 +103,194 @@ def run(work=None): | |||
return status | |||
|
|||
|
|||
def commandline_operation(executable=None, shell=False, arguments=None, input=None, output=None): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
arguments
keyword needs to come second for the syntax we've been talking about. Move shell
to the end.
def commandline_operation(executable=None, shell=False, arguments=None, input=None, output=None): | |
def commandline_operation(executable=None, arguments=None, input=None, output=None, shell=False): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
Trivial initial implementation creates a callable object for command lines: gmx.commandline_operation. Work in progress: * Manage input and output file descriptors and data. * Use in gmxapi workflow.
Trivial initial implementation creates a callable object for command lines. If command is not an absolute path, try to find the executable using shell PATH semantics. Work in progress: * Manage input and output file descriptors and data. * Use in gmxapi workflow.
Trivial initial implementation creates a callable object for command lines. If command is not an absolute path, try to find the executable using shell PATH semantics. Input and output filehandles are set to `/dev/null` (or the null device detected by Python 3). Work in progress: * Manage input and output file descriptors and data. * Use in gmxapi workflow.
* Remove keyword_arguments. * Add `input` and `output` arguments.
Removing the empty list for `__all__` allows pydoc and `help()` to generate help text for module functions that do not begin with an underscore (`_`).
We want `arguments` to be the first keyword argument after `executable` to allow syntax like `gmx.commandline_operation('gmx', 'trjcat', ...)`. Move `shell` kwarg to end of signature.
helper creates a work element. to do: * introduce gmx.Operation placeholder for WorkElement replacement * collect discrete parts - high-level interface helper - utility / implementation - graph handling - Director for session launcher with subscription, dependency, and topology * more examples
Moved to gmxapi 0.1 development at GROMACS master |
work in progress
fixes #198
supports issue #190
Note that this change will not manage data dependencies (issue #203), but execution order can be managed through the normal WorkElement
depends
mechanism.To do: