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

Python wrapper for CLI programs #200

Closed
wants to merge 9 commits into from
Closed

Conversation

eirrgang
Copy link
Collaborator

@eirrgang eirrgang commented Dec 4, 2018

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:

  • Incorporate into gmxapi session launch: wrap in the basic WorkElement and Context operation stuff
  • Generate correct work graph for data flow: subscription and dependency machinery
  • Documentation / examples of setting up such a work graph, pending actual data flow conditions in InputFile and OutputFile placeholders for Operations #203

@eirrgang eirrgang added this to In progress in 0.0.7.2 via automation Dec 7, 2018
@eirrgang eirrgang force-pushed the gmxapi-198 branch 2 times, most recently from ce4cffe to d670a18 Compare December 11, 2018 16:14
@@ -103,6 +103,194 @@ def run(work=None):
return status


def commandline_operation(executable=None, shell=False, arguments=None, input=None, output=None):
Copy link
Collaborator Author

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.

Suggested change
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):

Copy link
Collaborator Author

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.
* Normalize use of `from gmx import exceptions`.
* Explicitly specify default imported names from gmx.util
* Add some notes.
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
@eirrgang
Copy link
Collaborator Author

Moved to gmxapi 0.1 development at GROMACS master

@eirrgang eirrgang closed this Jun 20, 2019
0.0.7.2 automation moved this from In progress to Closed Jun 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
0.0.7.2
  
Closed
Development

Successfully merging this pull request may close these issues.

None yet

1 participant