haddocking / pdb-tools

A dependency-free cross-platform swiss army knife for PDB files.
https://haddocking.github.io/pdb-tools/
Apache License 2.0
378 stars 113 forks source link

pdb_validate.py output might not be to stderr #43

Closed brianjimenez closed 4 years ago

brianjimenez commented 4 years ago

Describe the bug This is not a bug itself, but the output of the validation, when it's not correct at all, writes to stderr the result of the warnings instead of the stdout. As long as the expected output of the tool is always valid, I will expect to output to stdout and not stderr.

To Reproduce

pdb_fetch.py 2oob | pdb_validate.py

Expected behavior Any output should be to stdout.

Desktop (please complete the following information):

joaomcteixeira commented 4 years ago

Hi @brianjimenez ,

Do you refer to all the sys.stderr that are in the validation function, right?

The idea you propose is that an error in the PDB file is NOT an error in the script execution itself, or the input parameters, therefore those messages should be sys.stdout instead of sys.stderr. Is that it?

brianjimenez commented 4 years ago

Correct! Sorry for my poor description :) Indeed, the result of the validation, positive or negative, should be written to sys.stdout.

joaomcteixeira commented 4 years ago

You explained well, I just wanted to double check.

PR in #44

I don't know if this is a bug though, as you said in your first comment. I would rather call it an enhancement. Up to @JoaoRodrigues to decide.

JoaoRodrigues commented 4 years ago

If I recall correctly, the reason why I had the default output stream be stderr was that because if there is an output, it is a problem in the file. But I can see that this might be annoying when you want to redirect output to a file or so. Good!

JoaoRodrigues commented 4 years ago

Addressed by #44 and merged.