-
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
InputFile and OutputFile placeholders for Operations #203
Comments
Values of the input and output dictionaries are inspected to see if they are objects representing files managed by gmxapi. GROMACS tools have been observed to do weird and inconsistent things when conventional output_placeholder = gmx.OutputFile('bynum.xvg')
hbond = gmx.commandline_operation('gmx',
arguments=['hbond'],
input={
'-f': 'somefile.trr',
'-s': 'input.tpr',
'-n': 'index.ndx'
},
output={
'-num': output_placeholder,
'-ang': 'hbang.xvg'
}) Note also that, in general, we can't intuit conventions for command line flag syntax (when to use one or two hyphens ('-')) so it's safest not to try. This makes the flags unsuitable for attribute names, so we will continue to use them in dictionary form after the object is created. I'm not sure if it is a good idea to have the >>> hbond.output.file_arg['-num']
gmx.OutputFile('bynum.xvg')
>>> str(hbond.output.file_arg['-num'])
'bynum.xvg' We might not want to make it that easy to access the file name, though, to allow future abstraction (don't give For example, consider a simulation that has just run. Get a numpy array-like view into local data xyz = md.output.conformation.extract().position[...] Get the name of a file that is locally accessible md.output.conformation.extract(savefile='output.gro') In the long run, it is a robustness problem to encourage users to share file management responsibility with gmxapi. We can allow filename specification, but it |
Do not specify static names. Default: manage file name. Allow helper to specify suffix when that doesn't work. |
A couple suggestions:
and there could maybe also be default outputs? |
Resolve ambiguity: When a file list is given to, say, an input file argument, assume it is implicitly a |
Suggest example for trjcat:
|
So for mapped inputs:
|
Note that when we have a list of ensemble data, we could allow |
subtask of #190
depends #198
Manage input and output for operations with file-based I/O. Solve the problem for operations that wrap CLI tools in a manner that anticipates interoperation with more generic work graph nodes. (e.g. simulation input/output)
If a value is of type
gmx.InputFile
orgmx.OutputFile
, filename is extracted from the object. (If the value is the type objectgmx.InputFile
orgmx.OutputFile
, a placeholder is created, for convenience.) If agmx.OutputFile
object has already been associated with the output of an operation when it is used again, it is transformed to agmx.InputFile
dependent on the previous operation. The object returned hasinput
andoutput
attributes that can be used to set or get references to the files.The text was updated successfully, but these errors were encountered: