From c864520c582ab843ea0d6882272a69f3063e2cd4 Mon Sep 17 00:00:00 2001 From: HeetVekariya Date: Sat, 9 Dec 2023 22:05:20 +0530 Subject: [PATCH 1/7] document the usage of NoDataError in docstring --- package/MDAnalysis/exceptions.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/package/MDAnalysis/exceptions.py b/package/MDAnalysis/exceptions.py index 2cf46636e3e..7938f974a34 100644 --- a/package/MDAnalysis/exceptions.py +++ b/package/MDAnalysis/exceptions.py @@ -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: + - Raised when a Topology Attribute (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. Examples include polymer analysis, PSA + (Potential Surface 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. + + Additionally, this exception may be raised in cases where: + + - Arrays have zero width. + - AtomGroups are empty. + .. versionchanged:: 1.0.0 Now a subclass of AttributeError as well as ValueError """ From 513a9012c77ca6f282c3c376592e9a9a4188a8b6 Mon Sep 17 00:00:00 2001 From: HeetVekariya Date: Sat, 9 Dec 2023 22:17:15 +0530 Subject: [PATCH 2/7] changelog --- package/CHANGELOG | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package/CHANGELOG b/package/CHANGELOG index 4551124635c..a66ebf8b46b 100644 --- a/package/CHANGELOG +++ b/package/CHANGELOG @@ -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 @@ -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) * 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 From 77f1bb73e45f072c2316b6a87416bb595d897944 Mon Sep 17 00:00:00 2001 From: HeetVekariya Date: Sun, 10 Dec 2023 15:42:23 +0530 Subject: [PATCH 3/7] implement changes --- package/MDAnalysis/exceptions.py | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/package/MDAnalysis/exceptions.py b/package/MDAnalysis/exceptions.py index 7938f974a34..ecc49bc163c 100644 --- a/package/MDAnalysis/exceptions.py +++ b/package/MDAnalysis/exceptions.py @@ -35,25 +35,23 @@ 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: - - Raised when a Topology Attribute (e.g., bonds, charges) is not - present in the data. + 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. Examples include polymer analysis, PSA - (Potential Surface Analysis), dielectric analysis, and hydrogen bond - analysis. + * 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 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. + * Raised in the `nojump` transformation if there is no box information + in the universe. - Additionally, this exception may be raised in cases where: - - - Arrays have zero width. - - AtomGroups are empty. + 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 From b425928771466ed798cac0d8abeb22b1561fcb98 Mon Sep 17 00:00:00 2001 From: HeetVekariya Date: Sun, 10 Dec 2023 15:43:44 +0530 Subject: [PATCH 4/7] correction in changelog --- package/CHANGELOG | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/CHANGELOG b/package/CHANGELOG index a66ebf8b46b..3f7bec1ebc5 100644 --- a/package/CHANGELOG +++ b/package/CHANGELOG @@ -30,7 +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) + * 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 From c36df596f0882663d49f603abad9c5133f3560f4 Mon Sep 17 00:00:00 2001 From: HeetVekariya Date: Sun, 10 Dec 2023 16:16:25 +0530 Subject: [PATCH 5/7] correction in syntax --- package/MDAnalysis/exceptions.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/package/MDAnalysis/exceptions.py b/package/MDAnalysis/exceptions.py index ecc49bc163c..04b2b081606 100644 --- a/package/MDAnalysis/exceptions.py +++ b/package/MDAnalysis/exceptions.py @@ -36,19 +36,20 @@ 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. + (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. Examples include polymer analysis, PSA - (Path Similarity Analysis), dielectric analysis, and hydrogen bond - analysis. + 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. + or forces. * Raised in the `nojump` transformation if there is no box information - in the universe. + in the universe. This exception should not be raised in cases where arrays have zero width, or AtomGroups are empty. From f7b0bb05a70694463fc555cd1dcda8fb9cbfeb45 Mon Sep 17 00:00:00 2001 From: HeetVekariya Date: Mon, 11 Dec 2023 22:40:06 +0530 Subject: [PATCH 6/7] Add name to AUTHORS --- package/AUTHORS | 1 + 1 file changed, 1 insertion(+) diff --git a/package/AUTHORS b/package/AUTHORS index c413c90462d..f9384f9c74e 100644 --- a/package/AUTHORS +++ b/package/AUTHORS @@ -222,6 +222,7 @@ Chronological list of authors - Shubham Kumar - Zaheer Timol - Geongi Moon + - Heet Vekariya External code ------------- From 55693253cd11d0fc182df35bad0bf1010ca005b9 Mon Sep 17 00:00:00 2001 From: HeetVekariya Date: Mon, 11 Dec 2023 22:45:15 +0530 Subject: [PATCH 7/7] implement changes --- package/MDAnalysis/exceptions.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/package/MDAnalysis/exceptions.py b/package/MDAnalysis/exceptions.py index 04b2b081606..3c42c617207 100644 --- a/package/MDAnalysis/exceptions.py +++ b/package/MDAnalysis/exceptions.py @@ -41,9 +41,8 @@ class NoDataError(ValueError, AttributeError): (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. Examples include polymer analysis, PSA - (Path Similarity Analysis), dielectric analysis, and hydrogen bond - analysis. + method has not been called, e.g. + :class:`~MDAnalysis.analysis.polymer.PersistenceLength`. * Raised when timestep data is missing, such as positions, velocities, or forces.