-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Improve logging and handling of PDB writing errors. #4753
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Could this ever be used with a non-seekable output handle (e.g. stdout), and in that case is it handled gracefully? |
I don't think so. We already assume we're dealing with a file handle (with
write and close methods) and IOBase, which all types of file and in-memory
file buffers inherit from, has both tell and truncate defined.
Unless someone is doing something very weird, they shouldn't hit this.
A segunda, 24/06/2024, 01:35, Peter Cock ***@***.***>
escreveu:
… Could this ever be used with a non-seekable output handle (e.g. stdout),
and in that case is it handled gracefully?
—
Reply to this email directly, view it on GitHub
<#4753 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABZ6EGTIJBBVFAZ7MUALGLZI6V2LAVCNFSM6AAAAABJWJTL6WVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCOBVGY2DMOBQGQ>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
…size (8, expected 4) biopython#4751 (biopython#4752) * update * fix long dtype * fix long dtype * update * update * update * update * test numpy array repr * test dtype * try printing * update * update * fix chapter_blast * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update --------- Co-authored-by: Michiel de Hoon <mdehoon@tkx249.genome.gsc.riken.jp> Co-authored-by: Michiel de Hoon <mdehoon@madpc2s-MacBook-Pro.local>
Tests passed! @peterjc, if you are ok with this, go ahead and merge 💪 |
Thank you - rebased-and-merged. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I hereby agree to dual licence this and any previous contributions under both
the Biopython License Agreement AND the BSD 3-Clause License.
I have read the
CONTRIBUTING.rst
file, have runpre-commit
locally, and understand that continuous integration checks will be used to
confirm the Biopython unit tests and style checks pass with these changes.
Closes #4729.
This PR improves our handling of failures in PDBIO. As is, if there is a failure, we print the full traceback, which can be hard to parse. More importantly, we write an incomplete/partial PDB file up to the point of failure. This PR adds the main error message on the last (bottom) traceback error message for easier debugging. In addition, we now delete or truncate the file if there is an exception, depending on if the user provided a string or an open file handle, respectively.