-
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
fix sphinx warnings #1312
fix sphinx warnings #1312
Changes from all commits
dfad88c
317dedf
322bbb9
d249fd7
373c1fb
7a76828
c9f76b2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,7 +24,7 @@ | |
#Ben Hall ([email protected]) is to blame | ||
#Copyright 2011; Consider under GPL v2 or later | ||
|
||
""" | ||
r""" | ||
Elastic network analysis of MD trajectories --- :mod:`MDAnalysis.analysis.gnm` | ||
============================================================================== | ||
|
||
|
@@ -37,21 +37,22 @@ | |
|
||
An example is provided in the MDAnalysis Cookbook_, listed as GNMExample_. | ||
|
||
.. GNMExample_: https://github.com/MDAnalysis/MDAnalysisCookbook/blob/master/examples/GNMExample.py | ||
.. Cookbook_: https://github.com/MDAnalysis/MDAnalysisCookbook | ||
.. _GNMExample: https://github.com/MDAnalysis/MDAnalysisCookbook/blob/master/examples/GNMExample.py | ||
.. _Cookbook: https://github.com/MDAnalysis/MDAnalysisCookbook | ||
|
||
The basic approach is to pass a trajectory to :class:`GNMAnalysis` and then run | ||
the analysis:: | ||
|
||
u = MDAnalysis.Universe(PSF, DCD) | ||
C = MDAnalysis.analysis.gnm.GNMAnalysis(u, ReportVector="output.txt") | ||
u = MDAnalysis.Universe(PSF, DCD) | ||
C = MDAnalysis.analysis.gnm.GNMAnalysis(u, ReportVector="output.txt") | ||
|
||
C.run() | ||
output = zip(*C.results) | ||
|
||
C.run() | ||
output = zip(*C.results) | ||
with open("eigenvalues.dat", "w") as outputfile: | ||
for item in output[1]: | ||
outputfile.write(item + "\n") | ||
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. using the 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. How did this break the docs??? (Wouldn't this be considered a bug in sphinx?) 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. No this is normal python behavior. 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. I hadn't realized that this was Python code inside a doc string... 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. I don't think you understand me correct. This is a escape sequence in a string. This is a problem for sphinx in any doc string no matter where it stands. That's why we have the raw string hint in the docs for documentation. |
||
|
||
with open("eigenvalues.dat", "w") as outputfile: | ||
for item in output[1]: | ||
outputfile.write(item + "\n") | ||
|
||
The results are found in :attr:`GNMAnalysis.results`, which can be | ||
used for further processing (see [Hall2007]_). | ||
|
@@ -181,7 +182,10 @@ class GNMAnalysis(object): | |
`Bonus_groups` is contained in `selection` as this could lead to | ||
double counting. No checks are applied. Default is ``None``. | ||
|
||
.. SeeAlso:: :class:`closeContactGNMAnalysis` | ||
See Also | ||
-------- | ||
:class:`closeContactGNMAnalysis` | ||
|
||
|
||
.. versionchanged:: 0.16.0 | ||
Made :meth:`generate_output` a private method :meth:`_generate_output`. | ||
|
@@ -337,13 +341,18 @@ class closeContactGNMAnalysis(GNMAnalysis): | |
the atoms that form a contact. | ||
MassWeight : bool (deprecated, optional) | ||
if set to ``True`` equivalent to `weights` set to "size". | ||
.. Note:: This option does not perform a true mass weighting but | ||
weighting by the number of atoms in each residue; the name | ||
of the parameter exists for historical reasons and will | ||
be removed in 0.17.0. Until then, setting `MassWeight` to | ||
anything but ``None`` will override `weights`. | ||
|
||
.. SeeAlso:: :class:`GNMAnalysis` | ||
Notes | ||
----- | ||
The `MassWeight` option does not perform a true mass weighting but | ||
weighting by the number of atoms in each residue; the name of the parameter | ||
exists for historical reasons and will be removed in 0.17.0. Until then, | ||
setting `MassWeight` to anything but ``None`` will override `weights`. | ||
|
||
See Also | ||
-------- | ||
:class:`GNMAnalysis` | ||
|
||
|
||
.. versionchanged:: 0.16.0 | ||
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. I found by trial and error that the normal 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. @kain88-de I love you! This was ruining my life! 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. I found the explanation for this in an old sphinx issue. But yeah it's a weird bug/feature 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. Add a note to our doc docs.... keeping this kind of knowledge around is really helpful. We should also add (if we haven't already) that
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.
Were do we document our docs? 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. In @jbarnoud 's PR #1247 IIRC. EDIT: see #1247 (comment) Documenting docs: see wiki style guide. 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. If you find that See Also works then remove the section in the style guide where I recommend against using it. 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. I think I've already done that. |
||
Made :meth:`generate_output` a private method :meth:`_generate_output`. | ||
|
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.
having the deprecate at the top of the class made sphinx think this is a function and not a class. Moving it to the
__init__
function fixed that. Bonus we can also use the recent sphinx version now.