Skip to content

Commit

Permalink
Fix various broken doctests.
Browse files Browse the repository at this point in the history
  • Loading branch information
KelSolaar committed Jun 28, 2022
1 parent 65226e1 commit e6eb666
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions colour/algebra/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,8 +283,8 @@ def sdiv(a: FloatingOrArrayLike, b: FloatingOrArrayLike) -> FloatingOrNDArray:
... with sdiv_mode("Raise"):
... sdiv(a, b)
... except Exception as error:
... error
FloatingPointError('divide by zero encountered in true_divide')
... error # doctest: +ELLIPSIS
FloatingPointError('divide by zero encountered in...divide')
>>> with sdiv_mode("Ignore Zero Conversion"):
... sdiv(a, b)
array([ 0., 1., 0.])
Expand Down
16 changes: 8 additions & 8 deletions colour/colorimetry/generation.py
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ def sd_gaussian_normal(
>>> sd.shape
SpectralShape(360.0, 780.0, 1.0)
>>> sd[555] # doctest: +ELLIPSIS
1.0000000...
1...
>>> sd[530] # doctest: +ELLIPSIS
0.6065306...
"""
Expand Down Expand Up @@ -464,8 +464,8 @@ def sd_gaussian_fwhm(
>>> sd = sd_gaussian_fwhm(555, 25)
>>> sd.shape
SpectralShape(360.0, 780.0, 1.0)
>>> sd[555]
1.0
>>> sd[555] # doctest: +ELLIPSIS
1...
>>> sd[530] # doctest: +ELLIPSIS
0.3678794...
"""
Expand Down Expand Up @@ -537,14 +537,14 @@ def sd_gaussian(
>>> sd.shape
SpectralShape(360.0, 780.0, 1.0)
>>> sd[555] # doctest: +ELLIPSIS
1.0000000...
1...
>>> sd[530] # doctest: +ELLIPSIS
0.6065306...
>>> sd = sd_gaussian(555, 25, method='FWHM')
>>> sd.shape
SpectralShape(360.0, 780.0, 1.0)
>>> sd[555]
1.0
>>> sd[555] # doctest: +ELLIPSIS
1...
>>> sd[530] # doctest: +ELLIPSIS
0.3678794...
"""
Expand Down Expand Up @@ -604,7 +604,7 @@ def sd_single_led_Ohno2005(
>>> sd.shape
SpectralShape(360.0, 780.0, 1.0)
>>> sd[555] # doctest: +ELLIPSIS
1.0000000...
1...
"""

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

method = validate_method(method, SD_SINGLE_LED_METHODS)
Expand Down

0 comments on commit e6eb666

Please sign in to comment.