Skip to content

Update protein.py#1174

Merged
prabhuramachandran merged 2 commits into
enthought:masterfrom
giammi56:patch-1
Oct 17, 2022
Merged

Update protein.py#1174
prabhuramachandran merged 2 commits into
enthought:masterfrom
giammi56:patch-1

Conversation

@giammi56

Copy link
Copy Markdown
Contributor

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.

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.
Comment thread examples/mayavi/mlab/protein.py Outdated
@@ -73,17 +73,17 @@
last_chain_label = None
for line in infile:
line = line.split()

@JAGulin JAGulin Sep 28, 2022

Copy link
Copy Markdown

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()

Copy link
Copy Markdown
Member

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.

@JAGulin JAGulin left a comment

Copy link
Copy Markdown

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

https://www.wwpdb.org/ftp/pdb-ftp-sites

@prabhuramachandran prabhuramachandran left a comment

Copy link
Copy Markdown
Member

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.

Comment thread examples/mayavi/mlab/protein.py Outdated
@@ -73,17 +73,17 @@
last_chain_label = None
for line in infile:
line = line.split()

Copy link
Copy Markdown
Member

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.
@prabhuramachandran

Copy link
Copy Markdown
Member

I have made the necessary changes myself. Will fire the builds now.

@prabhuramachandran prabhuramachandran merged commit c0c8533 into enthought:master Oct 17, 2022
@giammi56 giammi56 deleted the patch-1 branch October 31, 2022 09:06
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

Successfully merging this pull request may close these issues.

3 participants