Skip to content

Commit

Permalink
Fixups for #431 following review
Browse files Browse the repository at this point in the history
  • Loading branch information
richardjgowers committed Jan 14, 2016
1 parent d94d897 commit 18a8813
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 5 deletions.
1 change: 0 additions & 1 deletion package/MDAnalysis/coordinates/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -1617,7 +1617,6 @@ def __init__(cls, name, bases, classdict):
except KeyError:
pass
else:
# All multiframe writers work as a singleframe?
for f in fmt:
_SINGLEFRAME_WRITERS[f] = cls
try:
Expand Down
26 changes: 22 additions & 4 deletions package/MDAnalysis/coordinates/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,14 @@ def get_reader_for(filename, permissive=False, format=None):
kwargs
Keyword arguments for the selected Reader class.
Automatic detection is disabled when an explicit *format* is
provided.
Returns
-------
A Reader object
Notes

This comment has been minimized.

Copy link
@dotsdl

This comment has been minimized.

Copy link
@richardjgowers

This comment has been minimized.

Copy link
@dotsdl

dotsdl Jan 15, 2016

Member

Ah, well since it's napoleon that does the actual parsing, I think it should be fine then. Wasn't aware that was an alternative.

-----
Automatic detection is disabled when an explicit *format* is
provided.
"""
if format is None:
format = util.guess_format(filename)
Expand Down Expand Up @@ -90,14 +96,18 @@ def reader(filename, **kwargs):
Parameters
----------
filename : str
filename of the input trajectory or coordinate file
filename : str or tuple
filename (or tuple of filenames) of the input coordinate file
permissive : bool
If set to ``True``, a reader is selected that is more tolerant of the
input (currently only implemented for PDB). [``False``]
kwargs
Keyword arguments for the selected Reader class.
Returns
-------
A Reader object
.. SeeAlso:: For trajectory formats: :class:`~DCD.DCDReader`,
:class:`~XTC.XTCReader`, :class:`~TRR.TRRReader`,
:class:`~XYZ.XYZReader`. For single frame formats:
Expand Down Expand Up @@ -136,6 +146,10 @@ def get_writer_for(filename=None, format='DCD', multiframe=None):
write a single coordinate frame; ``None``: first try trajectory (multi
frame writers), then the single frame ones. Default is ``None``.
Returns
-------
A Writer object
.. versionchanged:: 0.7.6
Added *multiframe* keyword; the default ``None`` reflects the previous
behaviour.
Expand Down Expand Up @@ -199,6 +213,10 @@ def writer(filename, n_atoms=None, **kwargs):
Some readers accept additional arguments, which need to be looked
up in the documentation of the reader.
Returns
-------
A Writer object
.. SeeAlso:: :class:`~MDAnalysis.coordinates.DCD.DCDWriter` for DCD
trajectories or :class:`~MDAnalysis.coordinates.XTC.XTCWriter`
and :class:`~MDAnalysis.coordinates.TRR.TRRWriter` for Gromacs.
Expand Down

0 comments on commit 18a8813

Please sign in to comment.