Skip to content

Commit a7a6ec1

Browse files
committed
remove TimeseriesCollection
1 parent 87dbe0e commit a7a6ec1

File tree

10 files changed

+5
-984
lines changed

10 files changed

+5
-984
lines changed

package/MDAnalysis/__init__.py

Lines changed: 1 addition & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,7 @@
143143
"""
144144
from __future__ import absolute_import
145145

146-
__all__ = ['Universe', 'as_Universe', 'Writer', 'collection',
147-
'fetch_mmtf']
146+
__all__ = ['Universe', 'as_Universe', 'Writer',
148147

149148
import logging
150149
import warnings
@@ -198,41 +197,6 @@
198197
# After Universe import
199198
from .coordinates.MMTF import fetch_mmtf
200199

201-
# REMOVE in 0.17.0
202-
class _MockTimeseriesCollection(object):
203-
"""When accessed the first time, emit warning and raise NotImplementedError.
204-
205-
This breaks existing code that relies on MDAnalysis.collection by
206-
replacing ::
207-
208-
collection = Timeseries.TimeseriesCollection()
209-
210-
with::
211-
212-
collection = _MockTimeseriesCollection()
213-
214-
"""
215-
216-
def __getattr__(self, name):
217-
self._warn_and_die()
218-
219-
def __getitem__(self, index):
220-
self._warn_and_die()
221-
222-
def _warn_and_die(self):
223-
import logging
224-
msg = "collection = Timeseries.TimeseriesCollection() will be removed in 0.17.0\n" \
225-
"and MDAnalysis.collection has been disabled. If you want to use it, \n" \
226-
"instantiate a collection yourself:\n\n" \
227-
" from MDAnalysis.core.Timeseries import TimeseriesCollection\n" \
228-
" collection = TimeseriesCollection()\n\n" \
229-
"Note that release 0.16.2 is the LAST RELEASE with TimeseriesCollection."
230-
logging.getLogger("MDAnalysis").warn(msg)
231-
warnings.warn(msg, DeprecationWarning)
232-
raise NotImplementedError("TimeseriesCollection will be REMOVED IN THE NEXT RELEASE 0.17.0")
233-
collection = _MockTimeseriesCollection()
234-
del _MockTimeseriesCollection
235-
236200
from .migration.ten2eleven import ten2eleven
237201

238202
import six

package/MDAnalysis/coordinates/DCD.py

Lines changed: 0 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,6 @@
9393
from . import core
9494
# Add the c functions to their respective classes so they act as class methods
9595
from . import _dcdmodule
96-
# dcdtimeseries is implemented with Pyrex - hopefully all dcd reading functionality can move to pyrex
97-
from . import dcdtimeseries
98-
9996

10097

10198
class Timestep(base.Timestep):
@@ -400,8 +397,6 @@ class DCDReader(base.ReaderBase):
400397
random access into the trajectory (i corresponds to frame number)
401398
``data = dcd.timeseries(...)``
402399
retrieve a subset of coordinate information for a group of atoms
403-
``data = dcd.correl(...)``
404-
populate a :class:`MDAnalysis.core.Timeseries.Collection` object with computed timeseries
405400
406401
Note
407402
----
@@ -579,57 +574,6 @@ def timeseries(self, asel=None, start=None, stop=None, step=None, skip=None,
579574
# XXX needs to be implemented
580575
return self._read_timeseries(atom_numbers, start, stop, step, format)
581576

582-
@deprecate(message="This method will be removed in 0.17")
583-
def correl(self, timeseries, start=None, stop=None, step=None, skip=None):
584-
"""
585-
Populate a :class:`~MDAnalysis.core.Timeseries.TimeseriesCollection` object
586-
with time series computed from the trajectory.
587-
588-
Calling this method will iterate through the whole trajectory and
589-
perform the calculations prescribed in `timeseries`.
590-
591-
Parameters
592-
----------
593-
timeseries : :class:`MDAnalysis.core.Timeseries.TimeseriesCollection`
594-
The :class:`MDAnalysis.core.Timeseries.TimeseriesCollection` that defines what kind
595-
of computations should be performed on the data in this trajectory.
596-
start : int (optional)
597-
Begin reading the trajectory at frame index `start` (where 0 is the index
598-
of the first frame in the trajectory); the default ``None`` starts
599-
at the beginning.
600-
stop : int (optional)
601-
End reading the trajectory at frame index `stop`-1, i.e, `stop` is excluded.
602-
The trajectory is read to the end with the default ``None``.
603-
step : int (optional)
604-
Step size for reading; the default ``None`` is equivalent to 1 and means to
605-
read every frame.
606-
607-
Note
608-
----
609-
The `correl` functionality is only implemented for DCD trajectories and
610-
the :class:`DCDReader`.
611-
612-
613-
.. deprecated:: 0.16.0
614-
`skip` has been deprecated in favor of the standard keyword `step`.
615-
616-
"""
617-
if skip is not None:
618-
step = skip
619-
warnings.warn("Skip is deprecated and will be removed in"
620-
"in 1.0. Use step instead.",
621-
category=DeprecationWarning)
622-
623-
start, stop, step = self.check_slice_indices(start, stop, step)
624-
atomlist = timeseries._getAtomList()
625-
format = timeseries._getFormat()
626-
lowerb, upperb = timeseries._getBounds()
627-
sizedata = timeseries._getDataSize()
628-
atomcounts = timeseries._getAtomCounts()
629-
auxdata = timeseries._getAuxData()
630-
return self._read_timecorrel(atomlist, atomcounts, format, auxdata,
631-
sizedata, lowerb, upperb, start, stop, step)
632-
633577
def close(self):
634578
if self.dcdfile is not None:
635579
self._finish_dcd_read()
@@ -709,6 +653,3 @@ def dt(self):
709653
DCDWriter._write_dcd_header = types.MethodType(_dcdmodule.__write_dcd_header, None, DCDWriter)
710654
DCDWriter._write_next_frame = types.MethodType(_dcdmodule.__write_next_frame, None, DCDWriter)
711655
DCDWriter._finish_dcd_write = types.MethodType(_dcdmodule.__finish_dcd_write, None, DCDWriter)
712-
713-
#DCDReader._read_timeseries = types.MethodType(dcdtimeseries.__read_timeseries, None, DCDReader)
714-
DCDReader._read_timecorrel = types.MethodType(dcdtimeseries.__read_timecorrel, None, DCDReader)

package/MDAnalysis/coordinates/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -538,7 +538,6 @@ class can choose an appropriate reader automatically.
538538
``timeseries(atomGroup, [start[,stop[,skip[,format]]]])``
539539
returns a subset of coordinate data
540540
541-
542541
Attributes
543542
..........
544543

package/MDAnalysis/coordinates/dcdtimeseries.pyx

Lines changed: 0 additions & 209 deletions
This file was deleted.

0 commit comments

Comments
 (0)