File tree Expand file tree Collapse file tree 2 files changed +760
-3
lines changed
Expand file tree Collapse file tree 2 files changed +760
-3
lines changed Original file line number Diff line number Diff line change @@ -441,14 +441,17 @@ def get_sphCoord_axes(self, arg_r):
441441 if x2y2 == 0.0 :
442442 raise ValueError ("x2y2 is zero, cannot compute sin_phi and cos_phi." )
443443
444+ # These conditions are mathematically unreachable for real-valued vectors.
445+ # Marked as no cover to avoid false negatives in coverage reports.
446+
444447 # Check for non-negative values inside the square root
445- if x2y2 / r2 < 0 :
448+ if x2y2 / r2 < 0 : # pragma: no cover
446449 raise ValueError (
447450 f"Negative value encountered for sin_theta calculation: { x2y2 / r2 } . "
448451 f"Cannot take square root."
449452 )
450453
451- if x2y2 < 0 :
454+ if x2y2 < 0 : # pragma: no cover
452455 raise ValueError (
453456 f"Negative value encountered for sin_phi and cos_phi "
454457 f"calculation: { x2y2 } . "
@@ -462,7 +465,7 @@ def get_sphCoord_axes(self, arg_r):
462465 sin_phi = arg_r [1 ] / np .sqrt (x2y2 )
463466 cos_phi = arg_r [0 ] / np .sqrt (x2y2 )
464467
465- else :
468+ else : # pragma: no cover
466469 sin_theta = 0.0
467470 cos_theta = 1
468471
You can’t perform that action at this time.
0 commit comments