Skip to content
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

Document the usage of NoDataError in it's docstring #4359

Merged
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -30,6 +30,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.
HeetVekariya marked this conversation as resolved.
Show resolved Hide resolved

* Raised when data is missing in an analysis class because the `run()`
method has not been called. Examples include polymer analysis, PSA
(Path Similarity Analysis), dielectric analysis, and hydrogen bond
analysis.

* 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
Loading