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
Update protein.py #1174
Update protein.py #1174
Conversation
GzipFile reads files as objects ('rb' mode, text not implemented), therefore the .split() contains a "b" character in front. The solution proposed is decoding the byte into strings.
examples/mayavi/mlab/protein.py
Outdated
@@ -73,17 +73,17 @@ | |||
last_chain_label = None | |||
for line in infile: | |||
line = line.split() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This old example fails for me too, but I'd rather suggest converting the line in one go and drop the other changes. E.g.
line = line.decode("utf-8").split()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes I agree, this is much easier and works.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When updating anyway, the download URL should be changed to
https://files.rcsb.org/pub/pdb/data/structures/divided/pdb/q0/pdb%s.ent.gz
according to the documentation on
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, I agree with @JAGulin that the one-line fix is much easier.
examples/mayavi/mlab/protein.py
Outdated
@@ -73,17 +73,17 @@ | |||
last_chain_label = None | |||
for line in infile: | |||
line = line.split() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes I agree, this is much easier and works.
Change the URL and also make the required changes.
I have made the necessary changes myself. Will fire the builds now. |
GzipFile reads files as objects ('rb' mode, text not implemented), therefore the .split() contains a "b" character in front. The solution proposed is decoding the byte into strings.