Skip to content

Commit e6eb666

Browse files
committed
Fix various broken doctests.
1 parent 65226e1 commit e6eb666

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

colour/algebra/common.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -283,8 +283,8 @@ def sdiv(a: FloatingOrArrayLike, b: FloatingOrArrayLike) -> FloatingOrNDArray:
283283
... with sdiv_mode("Raise"):
284284
... sdiv(a, b)
285285
... except Exception as error:
286-
... error
287-
FloatingPointError('divide by zero encountered in true_divide')
286+
... error # doctest: +ELLIPSIS
287+
FloatingPointError('divide by zero encountered in...divide')
288288
>>> with sdiv_mode("Ignore Zero Conversion"):
289289
... sdiv(a, b)
290290
array([ 0., 1., 0.])

colour/colorimetry/generation.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,7 @@ def sd_gaussian_normal(
407407
>>> sd.shape
408408
SpectralShape(360.0, 780.0, 1.0)
409409
>>> sd[555] # doctest: +ELLIPSIS
410-
1.0000000...
410+
1...
411411
>>> sd[530] # doctest: +ELLIPSIS
412412
0.6065306...
413413
"""
@@ -464,8 +464,8 @@ def sd_gaussian_fwhm(
464464
>>> sd = sd_gaussian_fwhm(555, 25)
465465
>>> sd.shape
466466
SpectralShape(360.0, 780.0, 1.0)
467-
>>> sd[555]
468-
1.0
467+
>>> sd[555] # doctest: +ELLIPSIS
468+
1...
469469
>>> sd[530] # doctest: +ELLIPSIS
470470
0.3678794...
471471
"""
@@ -537,14 +537,14 @@ def sd_gaussian(
537537
>>> sd.shape
538538
SpectralShape(360.0, 780.0, 1.0)
539539
>>> sd[555] # doctest: +ELLIPSIS
540-
1.0000000...
540+
1...
541541
>>> sd[530] # doctest: +ELLIPSIS
542542
0.6065306...
543543
>>> sd = sd_gaussian(555, 25, method='FWHM')
544544
>>> sd.shape
545545
SpectralShape(360.0, 780.0, 1.0)
546-
>>> sd[555]
547-
1.0
546+
>>> sd[555] # doctest: +ELLIPSIS
547+
1...
548548
>>> sd[530] # doctest: +ELLIPSIS
549549
0.3678794...
550550
"""
@@ -604,7 +604,7 @@ def sd_single_led_Ohno2005(
604604
>>> sd.shape
605605
SpectralShape(360.0, 780.0, 1.0)
606606
>>> sd[555] # doctest: +ELLIPSIS
607-
1.0000000...
607+
1...
608608
"""
609609

610610
settings = {"name": f"{peak_wavelength}nm - {fwhm} FWHM LED - Ohno (2005)"}
@@ -678,7 +678,7 @@ def sd_single_led(
678678
>>> sd.shape
679679
SpectralShape(360.0, 780.0, 1.0)
680680
>>> sd[555] # doctest: +ELLIPSIS
681-
1.0000000...
681+
1...
682682
"""
683683

684684
method = validate_method(method, SD_SINGLE_LED_METHODS)

0 commit comments

Comments
 (0)