Skip to content

Commit 422c561

Browse files
committed
Refactor assertion statements in utility.py for improved readability
- Simplified assertion formatting in the _resolve_chromatogram function to enhance clarity and maintain consistency in error messages when handling multiple chromatograms.
1 parent e70e726 commit 422c561

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

chromhandler/utility.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,14 @@ def _resolve_chromatogram(
1919
return chromatograms[0]
2020

2121
if len(chromatograms) > 1:
22-
assert wavelength is not None, (
23-
"Multiple chromatograms found, but no wavelength is specified."
24-
)
22+
assert (
23+
wavelength is not None
24+
), "Multiple chromatograms found, but no wavelength is specified."
2525

2626
# check that any of the chromatograms has the specified wavelength
27-
assert any([chrom.wavelength == wavelength for chrom in chromatograms]), (
28-
f"No chromatogram found with wavelength {wavelength} nm."
29-
)
27+
assert any(
28+
[chrom.wavelength == wavelength for chrom in chromatograms]
29+
), f"No chromatogram found with wavelength {wavelength} nm."
3030

3131
return next(chrom for chrom in chromatograms if chrom.wavelength == wavelength)
3232

0 commit comments

Comments
 (0)