Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
000f1e7
fixed issue with rotation from non-origin point calculation
davidercruz Jul 21, 2018
4f23420
rotaateby now behaves as rotate, updated tests to use transform(matrix)
davidercruz Jul 21, 2018
6cffae9
rotateby now accepts weights
davidercruz Jul 22, 2018
9ba25f1
fixed typos
davidercruz Jul 22, 2018
9e5db30
code cleanup
davidercruz Jul 22, 2018
f8d49fb
added checks for direction ; added tests for direction
davidercruz Jul 22, 2018
e60b268
Improved docs; test point and vector in 2 shapes
davidercruz Jul 28, 2018
31fa88e
added wrap and unwrap
davidercruz Aug 1, 2018
9c7b61e
added tests ; updated docs
davidercruz Aug 3, 2018
917b60d
updated CHANGELOG
davidercruz Aug 3, 2018
c00a04a
removed use of pytest.approx (#2019)
richardjgowers Aug 4, 2018
2c9d6c5
Use stricter type for pkdtree indices (#2025)
jbarnoud Aug 5, 2018
fe792a1
BUG: Force 64-bit storage for xdr file offsets
tylerjereddy Aug 5, 2018
bf424a5
Merge pull request #2000 from davidercruz/rotation-transform
jbarnoud Aug 5, 2018
6b74bac
Using Self Capped distance function in guess_bonds (#2006)
ayushsuhane Aug 5, 2018
f92ec5d
Around keyword can use KDTree for periodic boundary conditions (#2022)
ayushsuhane Aug 5, 2018
bf03cd4
fixed Issue #2001 - support for Tinker periodic boundary box (#2011)
micaela-matta Aug 6, 2018
10e16c0
Merge pull request #2024 from MDAnalysis/issue_2021_filesize_bytes
jbarnoud Aug 6, 2018
7c6a527
added wrap and unwrap
davidercruz Aug 1, 2018
c9627b4
added tests ; updated docs
davidercruz Aug 3, 2018
5af4274
updated CHANGELOG
davidercruz Aug 3, 2018
30907f8
updated doc files
davidercruz Aug 6, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion package/.pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,6 @@ enable=abstract-class-instantiated,
xrange-builtin,
zip-builtin-not-iterating,
map-builtin-not-iterating,
range-builtin-not-iterating,

# Things we'd like to try.
# Procedure:
Expand Down
11 changes: 10 additions & 1 deletion package/CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,20 @@ The rules for this file:

------------------------------------------------------------------------------
??/??/18 tylerjereddy, richardjgowers, palnabarun, orbeckst, kain88-de, zemanj,
VOD555, davidercruz, jbarnoud, ayushsuhane, hfmull
VOD555, davidercruz, jbarnoud, ayushsuhane, hfmull, micaela-matta

* 0.18.1

Enhancements

* Added wrap/unwrap transformations
* Modified around selections to work with KDTree and periodic boundary
conditions. Should reduce memory usage (#974 PR #2022)
* Modified topology.guessers.guess_bonds to automatically select the
fastest method for guessing bonds using
lib.distance.self_capped_distance (PR # 2006)
* Added lib.distances.self_capped_distance to internally select the
optimized method for distance evaluations of coordinates with itself. (PR # 2006)
* Added augment functionality to create relevant images of particles
in the vicinity of central cell to handle periodic boundary
conditions (PR #1977)
Expand Down Expand Up @@ -68,6 +76,7 @@ Fixes
* PDBWriter now properly sets start value
* Zero length TopologyGroup now return proper shape array via to_indices
(Issue #1974)
* Added periodic boundary box support to the Tinker file reader (Issue #2001)

Changes
* TopologyAttrs are now statically typed (Issue #1876)
Expand Down
21 changes: 16 additions & 5 deletions package/MDAnalysis/coordinates/TXYZ.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,19 @@ def __init__(self, filename, **kwargs):
root, ext = os.path.splitext(self.filename)
self.xyzfile = util.anyopen(self.filename)
self._cache = dict()

# Check if file has box information saved
with util.openany(self.filename) as inp:
inp.readline()
line = inp.readline()
# If second line has float at second position, we have box info
try:
float(line.split()[1])
except ValueError:
self.periodic = False
else:
self.periodic = True
self.ts = self._Timestep(self.n_atoms, **self._ts_kwargs)
# Haven't quite figured out where to start with all the self._reopen()
# etc.
# (Also cannot just use seek() or reset() because that would break
# with urllib2.urlopen() streams)

self._read_next_timestep()

@property
Expand All @@ -103,6 +110,8 @@ def _read_xyz_n_frames(self):
# the number of lines in the XYZ file will be 1 greater than the
# number of atoms
linesPerFrame = self.n_atoms + 1
if self.periodic:
linesPerFrame += 1
counter = 0
offsets = []

Expand Down Expand Up @@ -134,6 +143,8 @@ def _read_next_timestep(self, ts=None):
try:
# we assume that there is only one header line per frame
f.readline()
if self.periodic:
ts.dimensions = f.readline().split()
# convert all entries at the end once for optimal speed
tmp_buf = []
for i in range(self.n_atoms):
Expand Down
16 changes: 9 additions & 7 deletions package/MDAnalysis/core/selection.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,9 +243,6 @@ def __init__(self):
self.apply = self._apply_distmat

self.periodic = flags['use_periodic_selections']
# KDTree doesn't support periodic
if self.periodic:
self.apply = self._apply_distmat

def validate_dimensions(self, dimensions):
r"""Check if the system is periodic in all three-dimensions.
Expand Down Expand Up @@ -282,6 +279,9 @@ def _apply_KDTree(self, group):
# All atoms in group that aren't in sel
sys = group[~np.in1d(group.indices, sel.indices)]

if not sys:
return sys[[]]

box = self.validate_dimensions(group.dimensions)

cut = self.cutoff if box is not None else None
Expand Down Expand Up @@ -321,7 +321,8 @@ def _apply_KDTree(self, group):
"""
sel = self.sel.apply(group)
box = self.validate_dimensions(group.dimensions)
ref = sel.center_of_geometry(pbc=self.periodic)
periodic = box is not None
ref = sel.center_of_geometry(pbc=periodic)
kdtree = PeriodicKDTree(box=box)

cutoff = self.exRadius if box is not None else None
Expand Down Expand Up @@ -363,7 +364,8 @@ def _apply_KDTree(self, group):
"""
sel = self.sel.apply(group)
box = self.validate_dimensions(group.dimensions)
ref = sel.center_of_geometry(pbc=self.periodic)
periodic = box is not None
ref = sel.center_of_geometry(pbc=periodic)

cut = self.cutoff if box is not None else None
kdtree = PeriodicKDTree(box=box)
Expand Down Expand Up @@ -483,7 +485,7 @@ def __init__(self, parser, tokens):
self.cutoff = float(tokens.popleft())

def _apply_KDTree(self, group):
box = group.dimensions if self.periodic else None
box = self.validate_dimensions(group.dimensions)
kdtree = PeriodicKDTree(box=box)
cut = self.cutoff if box is not None else None
kdtree.set_coords(group.positions, cutoff=cut)
Expand All @@ -496,7 +498,7 @@ def _apply_distmat(self, group):
ref_coor = self.ref[np.newaxis, ...]

ref_coor = np.asarray(ref_coor, dtype=np.float32)
box = group.dimensions if self.periodic else None
box = self.validate_dimensions(group.dimensions)

dist = distances.distance_array(group.positions, ref_coor, box)
mask = (dist <= self.cutoff).any(axis=1)
Expand Down
Loading