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 2 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 it's docstring (Issue #3901, PR #4359)
HeetVekariya marked this conversation as resolved.
Show resolved Hide resolved
* 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
20 changes: 20 additions & 0 deletions package/MDAnalysis/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,26 @@ class SelectionError(Exception):
class NoDataError(ValueError, AttributeError):
"""Raised when empty input is not allowed or required data are missing.

This exception is used in various scenarios:
HeetVekariya marked this conversation as resolved.
Show resolved Hide resolved
- Raised when a Topology Attribute (e.g., bonds, charges) is not
HeetVekariya marked this conversation as resolved.
Show resolved Hide resolved
present in the data.

- Raised when data is missing in an analysis class because the `run()`
method has not been called. Examples include polymer analysis, PSA
(Potential Surface Analysis), dielectric analysis, and hydrogen bond
analysis.
HeetVekariya marked this conversation as resolved.
Show resolved Hide resolved

- 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.

Additionally, this exception may be raised in cases where:
HeetVekariya marked this conversation as resolved.
Show resolved Hide resolved

- Arrays have zero width.
- AtomGroups are empty.

.. versionchanged:: 1.0.0
Now a subclass of AttributeError as well as ValueError
"""
Expand Down
Loading