Skip to content

Commit df58694

Browse files
committed
Update docstrings in colour.appearance package.
1 parent 3add55a commit df58694

File tree

12 files changed

+209
-203
lines changed

12 files changed

+209
-203
lines changed

colour/appearance/atd95.py

Lines changed: 25 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -69,19 +69,19 @@ class CAM_ReferenceSpecification_ATD95(MixinDataclassArithmetic):
6969
"""
7070
Define the *ATD (1995)* colour vision model reference specification.
7171
72-
This specification has field names consistent with *Fairchild (2013)*
72+
This specification has field names consistent with the *Fairchild (2013)*
7373
reference.
7474
7575
Parameters
7676
----------
7777
H
7878
*Hue* angle :math:`H` in degrees.
7979
C
80-
Correlate of *saturation* :math:`C`. *Guth (1995)* incorrectly uses the
81-
terms saturation and chroma interchangeably. However, :math:`C` is here
82-
a measure of saturation rather than chroma since it is measured
83-
relative to the achromatic response for the stimulus rather than that
84-
of a similarly illuminated white.
80+
Correlate of *saturation* :math:`C`. *Guth (1995)* incorrectly uses
81+
the terms saturation and chroma interchangeably. However, :math:`C`
82+
is here a measure of saturation rather than chroma since it is
83+
measured relative to the achromatic response for the stimulus rather
84+
than that of a similarly illuminated white.
8585
Br
8686
Correlate of *brightness* :math:`Br`.
8787
A_1
@@ -119,19 +119,19 @@ class CAM_Specification_ATD95(MixinDataclassArithmetic):
119119
Define the *ATD (1995)* colour vision model specification.
120120
121121
This specification has field names consistent with the remaining colour
122-
appearance models in :mod:`colour.appearance` but diverge from
122+
appearance models in :mod:`colour.appearance` but diverge from the
123123
*Fairchild (2013)* reference.
124124
125125
Parameters
126126
----------
127127
h
128128
*Hue* angle :math:`H` in degrees.
129129
C
130-
Correlate of *saturation* :math:`C`. *Guth (1995)* incorrectly uses the
131-
terms saturation and chroma interchangeably. However, :math:`C` is here
132-
a measure of saturation rather than chroma since it is measured
133-
relative to the achromatic response for the stimulus rather than that
134-
of a similarly illuminated white.
130+
Correlate of *saturation* :math:`C`. *Guth (1995)* incorrectly uses
131+
the terms saturation and chroma interchangeably. However, :math:`C`
132+
is here a measure of saturation rather than chroma since it is
133+
measured relative to the achromatic response for the stimulus rather
134+
than that of a similarly illuminated white.
135135
Q
136136
Correlate of *brightness* :math:`Br`.
137137
A_1
@@ -149,7 +149,8 @@ class CAM_Specification_ATD95(MixinDataclassArithmetic):
149149
150150
Notes
151151
-----
152-
- This specification is the one used in the current model implementation.
152+
- This specification is the one used in the current model
153+
implementation.
153154
154155
References
155156
----------
@@ -214,10 +215,10 @@ def XYZ_to_ATD95(
214215
| ``CAM_Specification_ATD95.h`` | [0, 360] | [0, 1] |
215216
+-------------------------------+-----------------------+---------------+
216217
217-
- For unrelated colors, there is only self-adaptation and :math:`k_1` is
218-
set to 1.0 while :math:`k_2` is set to 0.0. For related colors such as
219-
typical colorimetric applications, :math:`k_1` is set to 0.0 and
220-
:math:`k_2` is set to a value between 15 and 50 *(Guth, 1995)*.
218+
- For unrelated colors, there is only self-adaptation and :math:`k_1`
219+
is set to 1.0 while :math:`k_2` is set to 0.0. For related colors
220+
such as typical colorimetric applications, :math:`k_1` is set to 0.0
221+
and :math:`k_2` is set to a value between 15 and 50 *(Guth, 1995)*.
221222
222223
References
223224
----------
@@ -281,8 +282,7 @@ def XYZ_to_ATD95(
281282

282283
def luminance_to_retinal_illuminance(XYZ: ArrayLike, Y_c: ArrayLike) -> NDArrayFloat:
283284
"""
284-
Convert from luminance in :math:`cd/m^2` to retinal illuminance in
285-
trolands.
285+
Convert luminance in :math:`cd/m^2` to retinal illuminance in trolands.
286286
287287
Parameters
288288
----------
@@ -312,7 +312,7 @@ def luminance_to_retinal_illuminance(XYZ: ArrayLike, Y_c: ArrayLike) -> NDArrayF
312312

313313
def XYZ_to_LMS_ATD95(XYZ: ArrayLike) -> NDArrayFloat:
314314
"""
315-
Convert from *CIE XYZ* tristimulus values to *LMS* cone responses.
315+
Convert *CIE XYZ* tristimulus values to *LMS* cone responses.
316316
317317
Parameters
318318
----------
@@ -349,12 +349,13 @@ def XYZ_to_LMS_ATD95(XYZ: ArrayLike) -> NDArrayFloat:
349349

350350
def opponent_colour_dimensions(LMS_g: ArrayLike) -> NDArrayFloat:
351351
"""
352-
Return opponent colour dimensions from given post adaptation cone signals.
352+
Compute opponent colour dimensions from the specified post-adaptation cone
353+
signals.
353354
354355
Parameters
355356
----------
356357
LMS_g
357-
Post adaptation cone signals.
358+
Post-adaptation cone signals.
358359
359360
Returns
360361
-------
@@ -389,12 +390,12 @@ def opponent_colour_dimensions(LMS_g: ArrayLike) -> NDArrayFloat:
389390

390391
def final_response(value: ArrayLike) -> NDArrayFloat:
391392
"""
392-
Return the final response of given opponent colour dimension.
393+
Compute the final response of the specified opponent colour dimension.
393394
394395
Parameters
395396
----------
396397
value
397-
Opponent colour dimension.
398+
Opponent colour dimension.
398399
399400
Returns
400401
-------

colour/appearance/cam16.py

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,8 @@ class InductionFactors_CAM16(MixinDataclassIterable):
109109
110110
Notes
111111
-----
112-
- The *CAM16* colour appearance model induction factors are the same as
113-
*CIECAM02* colour appearance model.
112+
- The *CAM16* colour appearance model induction factors are the same
113+
as *CIECAM02* colour appearance model.
114114
115115
References
116116
----------
@@ -142,7 +142,7 @@ class CAM_Specification_CAM16(MixinDataclassArithmetic):
142142
Parameters
143143
----------
144144
J
145-
Correlate of *Lightness* :math:`J`.
145+
Correlate of *lightness* :math:`J`.
146146
C
147147
Correlate of *chroma* :math:`C`.
148148
h
@@ -185,7 +185,7 @@ def XYZ_to_CAM16(
185185
compute_H: bool = True,
186186
) -> CAM_Specification_CAM16:
187187
"""
188-
Compute the *CAM16* colour appearance model correlates from given
188+
Compute the *CAM16* colour appearance model correlates from the specified
189189
*CIE XYZ* tristimulus values.
190190
191191
Parameters
@@ -195,22 +195,22 @@ def XYZ_to_CAM16(
195195
XYZ_w
196196
*CIE XYZ* tristimulus values of reference white.
197197
L_A
198-
Adapting field *luminance* :math:`L_A` in :math:`cd/m^2`, (often taken
199-
to be 20% of the luminance of a white object in the scene).
198+
Adapting field *luminance* :math:`L_A` in :math:`cd/m^2`, (often
199+
taken to be 20% of the luminance of a white object in the scene).
200200
Y_b
201201
Luminous factor of background :math:`Y_b` such as
202-
:math:`Y_b = 100 x L_b / L_w` where :math:`L_w` is the luminance of the
203-
light source and :math:`L_b` is the luminance of the background. For
204-
viewing images, :math:`Y_b` can be the average :math:`Y` value for the
205-
pixels in the entire image, or frequently, a :math:`Y` value of 20,
206-
approximate an :math:`L^*` of 50 is used.
202+
:math:`Y_b = 100 x L_b / L_w` where :math:`L_w` is the luminance of
203+
the light source and :math:`L_b` is the luminance of the background.
204+
For viewing images, :math:`Y_b` can be the average :math:`Y` value
205+
for the pixels in the entire image, or frequently, a :math:`Y` value
206+
of 20, approximate an :math:`L^*` of 50 is used.
207207
surround
208208
Surround viewing conditions induction factors.
209209
discount_illuminant
210210
Truth value indicating if the illuminant should be discounted.
211211
compute_H
212-
Whether to compute *Hue* :math:`h` quadrature :math:`H`. :math:`H` is
213-
rarely used, and expensive to compute.
212+
Whether to compute *Hue* :math:`h` quadrature :math:`H`. :math:`H`
213+
is rarely used, and expensive to compute.
214214
215215
Returns
216216
-------
@@ -361,27 +361,27 @@ def CAM16_to_XYZ(
361361
discount_illuminant: bool = False,
362362
) -> NDArrayFloat:
363363
"""
364-
Convert from *CAM16* specification to *CIE XYZ* tristimulus values.
364+
Convert *CAM16* specification to *CIE XYZ* tristimulus values.
365365
366366
Parameters
367367
----------
368368
specification
369369
*CAM16* colour appearance model specification. Correlate of
370-
*Lightness* :math:`J`, correlate of *chroma* :math:`C` or correlate of
371-
*colourfulness* :math:`M` and *hue* angle :math:`h` in degrees must be
372-
specified, e.g., :math:`JCh` or :math:`JMh`.
370+
*lightness* :math:`J`, correlate of *chroma* :math:`C` or correlate
371+
of *colourfulness* :math:`M` and *hue* angle :math:`h` in degrees
372+
must be specified, e.g., :math:`JCh` or :math:`JMh`.
373373
XYZ_w
374374
*CIE XYZ* tristimulus values of reference white.
375375
L_A
376-
Adapting field *luminance* :math:`L_A` in :math:`cd/m^2`, (often taken
377-
to be 20% of the luminance of a white object in the scene).
376+
Adapting field *luminance* :math:`L_A` in :math:`cd/m^2`, (often
377+
taken to be 20% of the luminance of a white object in the scene).
378378
Y_b
379379
Luminous factor of background :math:`Y_b` such as
380-
:math:`Y_b = 100 x L_b / L_w` where :math:`L_w` is the luminance of the
381-
light source and :math:`L_b` is the luminance of the background. For
382-
viewing images, :math:`Y_b` can be the average :math:`Y` value for the
383-
pixels in the entire image, or frequently, a :math:`Y` value of 20,
384-
approximate an :math:`L^*` of 50 is used.
380+
:math:`Y_b = 100 x L_b / L_w` where :math:`L_w` is the luminance of
381+
the light source and :math:`L_b` is the luminance of the background.
382+
For viewing images, :math:`Y_b` can be the average :math:`Y` value
383+
for the pixels in the entire image, or frequently, a :math:`Y` value
384+
of 20, approximate an :math:`L^*` of 50 is used.
385385
surround
386386
Surround viewing conditions.
387387
discount_illuminant
@@ -395,8 +395,8 @@ def CAM16_to_XYZ(
395395
Raises
396396
------
397397
ValueError
398-
If neither :math:`C` or :math:`M` correlates have been defined in the
399-
``specification`` argument.
398+
If neither :math:`C` or :math:`M` correlates have been defined in
399+
the ``specification`` argument.
400400
401401
Notes
402402
-----

0 commit comments

Comments
 (0)