Skip to content

Commit

Permalink
Document the usage of NoDataError in it's docstring (#4359)
Browse files Browse the repository at this point in the history
* document the usage of NoDataError in docstring

---------

Co-authored-by: Lily Wang <[email protected]>
  • Loading branch information
HeetVekariya and lilyminium authored Dec 12, 2023
1 parent 6179b2b commit ad40922
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
1 change: 1 addition & 0 deletions package/AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@ Chronological list of authors
- Zaheer Timol
- Geongi Moon
- Sumit Gupta
- Heet Vekariya

External code
-------------
Expand Down
3 changes: 2 additions & 1 deletion package/CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ The rules for this file:

-------------------------------------------------------------------------------
??/??/?? IAlibay, ianmkenney, PicoCentauri, pgbarletta, p-j-smith,
richardjgowers, lilyminium, ALescoulie, hmacdope
richardjgowers, lilyminium, ALescoulie, hmacdope, HeetVekariya

* 2.7.0

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

Enhancements
* Document the usage of NoDataError in its docstring (Issue #3901, PR #4359)
* Refactor c_distances backend to have a cython .pxd header and expose in
libmdanalysis (Issue #4315, PR #4324)
* Add faster nucleic acid Major and Minor pair distance calculators using
Expand Down
18 changes: 18 additions & 0 deletions package/MDAnalysis/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,24 @@ class SelectionError(Exception):
class NoDataError(ValueError, AttributeError):
"""Raised when empty input is not allowed or required data are missing.
This exception is raised in the following scenarios:
* Raised when a :class:`~MDAnalysis.core.topologyattrs.TopologyAttr`
(e.g., bonds, charges) is not present in the data.
* Raised when data is missing in an analysis class because the `run()`
method has not been called, e.g.
:class:`~MDAnalysis.analysis.polymer.PersistenceLength`.
* Raised when timestep data is missing, such as positions, velocities,
or forces.
* Raised in the `nojump` transformation if there is no box information
in the universe.
This exception should not be raised in cases where arrays have zero width,
or AtomGroups are empty.
.. versionchanged:: 1.0.0
Now a subclass of AttributeError as well as ValueError
"""
Expand Down

0 comments on commit ad40922

Please sign in to comment.