Skip to content

Commit ad40922

Browse files
Document the usage of NoDataError in it's docstring (#4359)
* document the usage of NoDataError in docstring --------- Co-authored-by: Lily Wang <31115101+lilyminium@users.noreply.github.com>
1 parent 6179b2b commit ad40922

File tree

3 files changed

+21
-1
lines changed

3 files changed

+21
-1
lines changed

package/AUTHORS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,7 @@ Chronological list of authors
223223
- Zaheer Timol
224224
- Geongi Moon
225225
- Sumit Gupta
226+
- Heet Vekariya
226227

227228
External code
228229
-------------

package/CHANGELOG

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ The rules for this file:
1515

1616
-------------------------------------------------------------------------------
1717
??/??/?? IAlibay, ianmkenney, PicoCentauri, pgbarletta, p-j-smith,
18-
richardjgowers, lilyminium, ALescoulie, hmacdope
18+
richardjgowers, lilyminium, ALescoulie, hmacdope, HeetVekariya
1919

2020
* 2.7.0
2121

@@ -31,6 +31,7 @@ Fixes
3131
* Fix atom charge reading in PDBQT parser (Issue #4282, PR #4283)
3232

3333
Enhancements
34+
* Document the usage of NoDataError in its docstring (Issue #3901, PR #4359)
3435
* Refactor c_distances backend to have a cython .pxd header and expose in
3536
libmdanalysis (Issue #4315, PR #4324)
3637
* Add faster nucleic acid Major and Minor pair distance calculators using

package/MDAnalysis/exceptions.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,24 @@ class SelectionError(Exception):
3535
class NoDataError(ValueError, AttributeError):
3636
"""Raised when empty input is not allowed or required data are missing.
3737
38+
This exception is raised in the following scenarios:
39+
40+
* Raised when a :class:`~MDAnalysis.core.topologyattrs.TopologyAttr`
41+
(e.g., bonds, charges) is not present in the data.
42+
43+
* Raised when data is missing in an analysis class because the `run()`
44+
method has not been called, e.g.
45+
:class:`~MDAnalysis.analysis.polymer.PersistenceLength`.
46+
47+
* Raised when timestep data is missing, such as positions, velocities,
48+
or forces.
49+
50+
* Raised in the `nojump` transformation if there is no box information
51+
in the universe.
52+
53+
This exception should not be raised in cases where arrays have zero width,
54+
or AtomGroups are empty.
55+
3856
.. versionchanged:: 1.0.0
3957
Now a subclass of AttributeError as well as ValueError
4058
"""

0 commit comments

Comments
 (0)