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

Accesing commandline output. #262

Open
sperezconesa opened this issue Jun 8, 2020 · 5 comments
Open

Accesing commandline output. #262

sperezconesa opened this issue Jun 8, 2020 · 5 comments
Assignees

Comments

@sperezconesa
Copy link

Hello,

Is it possible to access the contens of:

comand.output.erroroutput.result()

If the command doesn't fail. Sometimes this information is usefull to know.
Thanks a lot and keep up the good work!
Best,
Sergio

@eirrgang
Copy link
Collaborator

eirrgang commented Jun 8, 2020

Good question!

The short answer is probably a qualified "no"... and I should change that.

I believe you should see stdout and stderr mixed in the "debug" logging stream the way you would on the terminal. Using the Python logging module, you can catch logging.DEBUG level messages to the gmxapi.commandline logger. See https://gitlab.com/gromacs/gromacs/-/merge_requests/266/diffs for updated instructions.

But that's a workaround. I have opened an issue at https://gitlab.com/gromacs/gromacs/-/issues/3549 where we can continue the discussion. Feel free to submit a patch (as a merge request to GROMACS) or just to comment. I'll give it a day or two to stew, but then I'll try to get a patch up quickly.

But please let me know if the workaround is adequate (or even preferred).

@eirrgang eirrgang self-assigned this Jun 8, 2020
@sperezconesa
Copy link
Author

Hello,
Thanks for considering this. I don't need this right away so I will wait for this to be solved. I am affraid I don't know enough about this to program a patch myself... But I will follow the discussion in case I can help out.

@eirrgang
Copy link
Collaborator

eirrgang commented Jun 8, 2020

Thanks!

Can you also clarify whether you need STDOUT or STDERR as part of your workflow or just for debugging purposes? I.e. is logging sufficient or are result objects really what you need?

@sperezconesa
Copy link
Author

I am using the analyze module and if calculating the blocking error the fit is not correct it says so in the output (not user if standard error or output). In any case, it easier to parse the commandline output than the xvg file that is generated. I am not really sure if distinguishing between STDOUT and STDERR is usefull or confusing sometimes.

@eirrgang
Copy link
Collaborator

eirrgang commented Jun 8, 2020

Okay, so we are talking about a result that can be expected under normal circumstances and is a valid result. It is reasonable to expect that to be available as a regular output of the operation.

The Gromacs developers acknowledge that the tools don't always make the best use of STDOUT vs. STDERR, but I think that is beyond the scope of the present issue. I think it is fair to separate them (to simplify bookkeeping) and put them on equal footing from the standpoint of gmxapi outputs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants