-
Notifications
You must be signed in to change notification settings - Fork 824
fixed Issue #2001 - support for Tinker periodic boundary box #2011
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
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
7af769c
fixed Issue #2001 - support for Tinker periodic boundary box
839507d
Update datafiles.py
richardjgowers cef72ca
Update TXYZParser.py
richardjgowers d73d6ee
Update TXYZ.py
richardjgowers 7992272
Update TXYZParser.py
richardjgowers 5e046e0
Update test_txyz.py
richardjgowers 2112951
Update .pylintrc
richardjgowers File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -43,7 +43,10 @@ | |
| """ | ||
|
|
||
| from __future__ import absolute_import | ||
|
|
||
| import itertools | ||
| import numpy as np | ||
| from six.moves import zip | ||
|
|
||
| from . import guessers | ||
| from ..lib.util import openany | ||
|
|
@@ -88,9 +91,22 @@ def parse(self, **kwargs): | |
| names = np.zeros(natoms, dtype=object) | ||
| types = np.zeros(natoms, dtype=np.int) | ||
| bonds = [] | ||
| # Find first atom line, maybe there's box information | ||
| fline = inf.readline() | ||
| try: | ||
| # If a box second value will be a float | ||
| # If an atom, second value will be a string | ||
| float(fline.split()[1]) | ||
| except ValueError: | ||
| # If float conversion failed, we have first atom line | ||
| pass | ||
| else: | ||
| # If previous try succeeded it was a box | ||
| # so read another line to find the first atom line | ||
| fline = inf.readline() | ||
| # Can't infinitely read as XYZ files can be multiframe | ||
| for i in range(natoms): | ||
| line = inf.readline().split() | ||
| for i, line in zip(range(natoms), itertools.chain([fline], inf)): | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The linter was complaining about this line because it thought we weren't iterating the |
||
| line = line.split() | ||
| atomids[i]= line[0] | ||
| names[i] = line[1] | ||
| types[i] = line[5] | ||
|
|
||
This file contains hidden or 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
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| 6 Hexane (267 OPLS-UA in 38.8 Ang Box; JPC, 100, 14511 '96) | ||
| 38.860761 38.860761 38.860761 90.000000 90.000000 90.000000 | ||
| 1 CH3 -0.533809 8.893843 -17.718901 83 2 | ||
| 2 CH2 -0.492066 8.734009 -16.201869 86 1 3 | ||
| 3 CH2 0.609320 7.723360 -15.894925 86 2 4 | ||
| 4 CH2 0.723163 7.301395 -14.432851 86 3 5 | ||
| 5 CH2 1.923300 6.401842 -14.151512 86 4 6 | ||
| 6 CH3 1.576645 4.928146 -14.343148 83 5 | ||
| 6 Hexane (test file for MDA) | ||
| 39.860761 39.860761 39.860761 90.000000 90.000000 90.000000 | ||
| 1 CH3 0.039519 9.187867 -17.899888 83 2 | ||
| 2 CH2 -0.171280 8.486514 -16.561104 86 1 3 | ||
| 3 CH2 0.988507 7.632303 -16.057222 86 2 4 | ||
| 4 CH2 0.630146 7.086837 -14.677831 86 3 5 | ||
| 5 CH2 1.729866 6.240985 -14.042356 86 4 6 | ||
| 6 CH3 2.065117 4.899261 -14.687383 83 5 | ||
| 6 Hexane | ||
| 40.860761 40.860761 40.860761 90.000000 90.000000 90.000000 | ||
| 1 CH3 -0.533809 8.893843 -17.718901 83 2 | ||
| 2 CH2 -0.492066 8.734009 -16.201869 86 1 3 | ||
| 3 CH2 0.609320 7.723360 -15.894925 86 2 4 | ||
| 4 CH2 0.723163 7.301395 -14.432851 86 3 5 | ||
| 5 CH2 1.923300 6.401842 -14.151512 86 4 6 | ||
| 6 CH3 1.576645 4.928146 -14.343148 83 5 |
This file contains hidden or 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
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.
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.
Since you now use
zipwe also need to import the iterating zip from six. Please add the linefrom six.moves import zipbelow the future import.