-
Notifications
You must be signed in to change notification settings - Fork 664
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
Minor fixes #1247
Minor fixes #1247
Conversation
package/MDAnalysis/lib/util.py
Outdated
dict | ||
dict with totallength (in chars), repeat, length, format, decimals | ||
|
||
Raises |
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.
I think there is a line of dashes missing
package/MDAnalysis/auxiliary/XVG.py
Outdated
Parameters | ||
---------- | ||
i : int | ||
Step number (0-indexed) to move to |
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.
return value doc is missing
package/MDAnalysis/auxiliary/XVG.py
Outdated
@@ -19,343 +19,348 @@ | |||
# MDAnalysis: A Toolkit for the Analysis of Molecular Dynamics Simulations. | |||
# J. Comput. Chem. 32 (2011), 2319--2327, doi:10.1002/jcc.21787 | |||
# | |||
|
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.
@jbarnoud is this just rewritten with unix \n instead of whatever MS encoding is?
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.
I just removed the \r
at the end of the lines. The file seems to be ASCII as it should be.
When I build I get a whole bunch of SEVERE errors with messed up docs:
Typically, this seems to be something like See Also
--------
* item 1
* item 2
Classes
-------
.. autoclass:: Foo
At least my version of sphinx (v1.5.1)/napoleon seems to be unhappy about the numpy-style "See Also" because when I change it back to .. SeeAlso::
* item 1
* item 2
Classes
-------
.. autoclass:: Foo
then everything is fine again. Is this just me? (Generally speaking, the numpy docs format does some hackish things such as any heading "Examples" is turned into a non-section heading and the "See Also" probably also only works nicely inside class/method/function docs.) |
The easiest is probably to revert back to the old |
It seems that I actually broke quite a bit of the doc, and that fixing it is not trivial. I'll try to solve that this weekend. |
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.
Some of the formatting got broken.
See, for instance, problems with See Also.
I am blocking the merge until fixed.
This will need to be rebased after PR #1314 will have been merged. |
@jbarnoud do you want to try and rebase and hopefully get it in soon? |
I plan on going back to it next week. |
@jbarnoud I rebased against develop and fixed the conflicts. Please have a look. (Note: this needs to be merged.) |
Testing that arguments where integer by using `isinstance(arg, int)` has proven itself detrimental on several occasions. Indeed, the test refuses other types that would be legitimate such as numpy integers. This commit replaces the remaining occurences of the too narrow test by the solution that has already been used on multiple places of the code: testing against `numbers.Integral`. This new way matches everything that looks enough like an integer, and behave the same on python 2 and python 3 on the contrary to testing against `int`.
Update the docstrings everywhere in the package but in the anlysis.
…efile) Normally we build the docs with python setup.py build_sphinx but for more fine-grained control one can also locally build with cd doc/sphinx make html This is useful for debugging reST issues.
- I fixed everything until local cd doc/sphinx make html passed without errors.... but I am sure that more errors will come up. - reformatted and rewrote various portions of the docs while fixing the errors - completed the ENCORE citations in encore/similarity.py
If this passes Travis then I need another review, please.
|
Note: Merge please see #1247 (comment) (do not squash) |
I fixed the last new rendering error I could find. It is good to go on my side. |
package/MDAnalysis/auxiliary/base.py
Outdated
import math | ||
import warnings | ||
|
||
from ..lib.util import asiterable, anyopen | ||
import numpy as np |
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.
the numpy import should still be independent from the mdanalysis internal imports
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.
done
|
||
"""Write to a CHARMM/NAMD DCD trajectory file. | ||
|
||
Parameters |
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.
I thought we decided to put those into the init function
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.
Honestly, I don't remember a discussion, I might have missed that. I don't see anything in the Style Guide: Docs.
My reasoning was that with the extended numpy sections it looks better to have everything in the class docs instead of __init__
, especially as sometimes we might not even have __init__
for derived classes.
I certainly followed this reasoning in some of the analysis module doc rewrites where class docs contained background and examples and __init__
contained parameter lists.
Can you point me to where we decided using __init__
for the class docs? For right now I'd like to leave it as it is.
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.
Not sure which PR anymore. But we currently have both styles in the library.
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.
I'd say: open an issue to change it to one or the other and update the style guide according to the consensus.
@@ -391,15 +401,15 @@ class DCDReader(base.ReaderBase): | |||
``data = dcd.correl(...)`` | |||
populate a :class:`MDAnalysis.core.Timeseries.Collection` object with computed timeseries | |||
|
|||
.. Note:: | |||
Note | |||
---- | |||
|
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.
I think the empty line here should be removed.
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.
Done (empty line not harmful and positively helps when reformatting the block in emacs but I agree that this should be consistent everywhere)
Skip has been deprecated in favor of the standard keyword step. | ||
Parameters | ||
---------- | ||
asel: :class:`~MDAnalysis.core.groups.AtomGroup` |
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.
missing space after asel
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.
done (not harmful, but yes, let's keep the style uniform)
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.
... and all the other occurences in DCD.py
|
||
Returns | ||
------- | ||
:class:`DCDWriter` | ||
|
||
.. Note:: |
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.
please change the Note
section here as well.
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.
done
package/MDAnalysis/lib/util.py
Outdated
:attr:`NamedStream.name` will be changed accordingly) | ||
ext: None or str | ||
extension to use in the new filename | ||
keep: bool |
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.
missing space
package/MDAnalysis/lib/util.py
Outdated
mode: str | ||
'r' or 'w' or 'a', more complicated modes ('r+', 'w+' are not supported | ||
because only the first letter is looked at) | ||
reset: bool |
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.
missing space
package/MDAnalysis/lib/util.py
Outdated
Returns | ||
------- | ||
root: str | ||
ext: str |
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.
missing space
package/MDAnalysis/lib/util.py
Outdated
last column + 1 | ||
*typespecifier* | ||
typespecifier: str |
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.
missing space
package/MDAnalysis/lib/util.py
Outdated
allowed in between. | ||
Parameters | ||
---------- | ||
residue: str |
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.
missing space
I think I addressed @kain88-de 's comments (and more...). Fixing docs is a bottomless pit for time and I spent way more time on this than I should have. I will fix anything in my commits that has broken something but for any other wishes, please do them yourself on the PR. |
I found that many coordinate classes were not even shown in the docs so I added explicit I rebased into my last commit to keep the history tidy and immediately mergable. Force-pushed... and hopefully done. |
- @kain88-de suggestions - even more fixes (everywhere in coordinates, elsewhere where I found something to fix). In particular - adde Parameter/Return/Raises sections to many functions in lib.util - made sure that there were two empty lines above .. versionchanged etc sections - made proper Example sections - fixed/clarified text - ensure that *all* classes are shown and can be linked (added autoclass markup where necessary) - PDB: removed any mentioning of the simple/Bio.PDB parser stuff, only left a versionchanged entry
Why does the numpy dev test fail?? https://travis-ci.org/MDAnalysis/mdanalysis/jobs/229565210 – it looks as if it sets up the environment and then just dies silently. I think I don't understand
|
see Discussion at #1334 |
Thanks! |
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.
I assume everything is correct. I haven't checked every line of this massive PR
@@ -3,7 +3,7 @@ | |||
|
|||
# You can set these variables from the command line. | |||
SPHINXOPTS = | |||
SPHINXBUILD = sphinx-build | |||
SPHINXBUILD = sphinx-build -v -W |
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.
what are these options doing?
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.
Verbose (more output) and make warnings failure (the same thing that you (?) enabled in the setup.cfg file).
Running
python setup.py build_sphinx
is apparently not using this Makefile
but if one wants to reproduce locally the build with the Makefile
then I found it useful to have. I didn't know how to change any other build_sphinx
option for testing so it was convenient to use the standard Makefile
.
I merged it as is and ignored the travis failures. |
Thanks everyone for these "minor fixes"... especial thanks to @kain88-de for repeatedly reviewing. |
This PR is the result of some heavy procrastination. It fixes some minor issues in the package:
isinstance(something, int)
by the more generic and safeisinstance(something, numbers.Integral)
Please, do not squash the commits as they are unrelated logical units.