Open KelSolaar opened 4 years ago
For the lines between the class docstring and the first method, set BLANK_LINE_BEFORE_NESTED_CLASS_OR_DEF = True
. It's off by default for PEP8.
The array subscript thing is concerning.
Hello,
I tried to update to 0.31.0, ran it on all our codebase and it still generates incompatible formatting:
colour/colorimetry/datasets/lefs.py:2361:80: E501 line too long (80 > 79 characters)
colour/colorimetry/datasets/cmfs.py:3213:80: E501 line too long (80 > 79 characters)
colour/colorimetry/datasets/cmfs.py:3225:80: E501 line too long (80 > 79 characters)
colour/models/din99.py:231:5: E131 continuation line unaligned for hanging indent
colour/models/din99.py:304:5: E131 continuation line unaligned for hanging indent
colour/models/hdr_cie_lab.py:125:5: E131 continuation line unaligned for hanging indent
colour/models/hdr_cie_lab.py:223:5: E131 continuation line unaligned for hanging indent
colour/models/cie_xyy.py:47:5: E131 continuation line unaligned for hanging indent
colour/models/cie_xyy.py:47:5: E125 continuation line with same indent as next logical line
colour/models/cie_lab.py:40:5: E131 continuation line unaligned for hanging indent
colour/models/cie_lab.py:40:5: E125 continuation line with same indent as next logical line
colour/models/cie_lab.py:111:5: E131 continuation line unaligned for hanging indent
colour/models/cie_lab.py:111:5: E125 continuation line with same indent as next logical line
colour/models/hunter_lab.py:82:5: E129 visually indented line with same indent as next logical line
colour/models/hunter_lab.py:158:5: E129 visually indented line with same indent as next logical line
colour/models/cie_uvw.py:37:5: E131 continuation line unaligned for hanging indent
colour/models/cie_uvw.py:37:5: E125 continuation line with same indent as next logical line
colour/models/cie_uvw.py:109:5: E131 continuation line unaligned for hanging indent
colour/models/cie_uvw.py:109:5: E125 continuation line with same indent as next logical line
colour/models/hunter_rdab.py:38:5: E129 visually indented line with same indent as next logical line
colour/models/hunter_rdab.py:116:5: E129 visually indented line with same indent as next logical line
colour/models/cie_luv.py:54:5: E131 continuation line unaligned for hanging indent
colour/models/cie_luv.py:54:5: E125 continuation line with same indent as next logical line
colour/models/cie_luv.py:126:5: E131 continuation line unaligned for hanging indent
colour/models/cie_luv.py:126:5: E125 continuation line with same indent as next logical line
colour/models/rgb/ictcp.py:346:5: E131 continuation line unaligned for hanging indent
colour/models/rgb/ictcp.py:465:5: E131 continuation line unaligned for hanging indent
colour/models/rgb/common.py:25:5: E131 continuation line unaligned for hanging indent
colour/models/rgb/common.py:89:5: E131 continuation line unaligned for hanging indent
colour/volume/rgb.py:67:5: E131 continuation line unaligned for hanging indent
colour/volume/rgb.py:193:5: E131 continuation line unaligned for hanging indent
Something I did not noticed before is that we get lines that are too long now:
diff --git a/colour/colorimetry/datasets/lefs.py b/colour/colorimetry/datasets/lefs.py
index 13b184596..4067d7441 100644
--- a/colour/colorimetry/datasets/lefs.py
+++ b/colour/colorimetry/datasets/lefs.py
@@ -2342,27 +2342,23 @@ DATA_LEFS_PHOTOPIC = {
SDS_LEFS_PHOTOPIC = LazyCaseInsensitiveMapping({
'CIE 1924 Photopic Standard Observer':
- partial(
- SpectralDistribution,
- DATA_LEFS_PHOTOPIC['CIE 1924 Photopic Standard Observer'],
- name='CIE 1924 Photopic Standard Observer'),
+ partial(SpectralDistribution,
+ DATA_LEFS_PHOTOPIC['CIE 1924 Photopic Standard Observer'],
+ name='CIE 1924 Photopic Standard Observer'),
'Judd Modified CIE 1951 Photopic Standard Observer':
- partial(
- SpectralDistribution,
- DATA_LEFS_PHOTOPIC[
- 'Judd Modified CIE 1951 Photopic Standard Observer'],
- name='Judd Modified CIE 1951 Photopic Standard Observer'),
+ partial(SpectralDistribution,
+ DATA_LEFS_PHOTOPIC[
+ 'Judd Modified CIE 1951 Photopic Standard Observer'],
+ name='Judd Modified CIE 1951 Photopic Standard Observer'),
'Judd-Vos Modified CIE 1978 Photopic Standard Observer':
- partial(
- SpectralDistribution,
- DATA_LEFS_PHOTOPIC[
- 'Judd-Vos Modified CIE 1978 Photopic Standard Observer'],
- name='Judd-Vos Modified CIE 1978 Photopic Standard Observer'),
+ partial(SpectralDistribution,
+ DATA_LEFS_PHOTOPIC[
+ 'Judd-Vos Modified CIE 1978 Photopic Standard Observer'],
+ name='Judd-Vos Modified CIE 1978 Photopic Standard Observer'),
'CIE 1964 Photopic 10 Degree Standard Observer':
partial(
SpectralDistribution,
- DATA_LEFS_PHOTOPIC[
- 'CIE 1964 Photopic 10 Degree Standard Observer'],
+ DATA_LEFS_PHOTOPIC['CIE 1964 Photopic 10 Degree Standard Observer'],
name='CIE 1964 Photopic 10 Degree Standard Observer',
strict_name='CIE 1964 Photopic 10$^\\circ$ Standard Observer'),
'CIE 2008 2 Degree Physiologically Relevant LEF':
@@ -2813,10 +2809,9 @@ DATA_LEFS_SCOTOPIC = {
SDS_LEFS_SCOTOPIC = LazyCaseInsensitiveMapping({
'CIE 1951 Scotopic Standard Observer':
- partial(
- SpectralDistribution,
- DATA_LEFS_SCOTOPIC['CIE 1951 Scotopic Standard Observer'],
- name='CIE 1951 Scotopic Standard Observer')
+ partial(SpectralDistribution,
+ DATA_LEFS_SCOTOPIC['CIE 1951 Scotopic Standard Observer'],
+ name='CIE 1951 Scotopic Standard Observer')
})
SDS_LEFS_SCOTOPIC.__doc__ = """
Spectral distributions of the scotopic luminous efficiency functions.
and the array subscripts are still sometimes pushed next line:
diff --git a/colour/models/din99.py b/colour/models/din99.py
index 06b77e4e0..7d0a16a1e 100644
--- a/colour/models/din99.py
+++ b/colour/models/din99.py
@@ -225,12 +225,13 @@ def DIN99_to_Lab(Lab_99, k_E=1, k_CH=1, method='DIN99'):
return from_range_100(Lab)
-def XYZ_to_DIN99(XYZ,
- illuminant=CCS_ILLUMINANTS[
- 'CIE 1931 2 Degree Standard Observer']['D65'],
- k_E=1,
- k_CH=1,
- method='DIN99'):
+def XYZ_to_DIN99(
+ XYZ,
+ illuminant=CCS_ILLUMINANTS['CIE 1931 2 Degree Standard Observer']
+ ['D65'],
+ k_E=1,
+ k_CH=1,
+ method='DIN99'):
"""
Converts from *CIE XYZ* tristimulus values to *DIN99* colourspace or
one of the *DIN99b*, *DIN99c*, *DIN99d* refined formulas according
@@ -297,12 +298,13 @@ def XYZ_to_DIN99(XYZ,
return Lab_to_DIN99(Lab, k_E, k_CH, method)
-def DIN99_to_XYZ(Lab_99,
- illuminant=CCS_ILLUMINANTS[
- 'CIE 1931 2 Degree Standard Observer']['D65'],
- k_E=1,
- k_CH=1,
- method='DIN99'):
+def DIN99_to_XYZ(
+ Lab_99,
+ illuminant=CCS_ILLUMINANTS['CIE 1931 2 Degree Standard Observer']
+ ['D65'],
+ k_E=1,
+ k_CH=1,
+ method='DIN99'):
"""
Converts from *DIN99* colourspace or one of the *DIN99b*, *DIN99c*,
*DIN99d* refined formulas according to *Cui et al. (2002)* to *CIE XYZ*
For the context, this regression was introduced sometimes between 0.23.0 and 0.24.0 as highlighted in #694.
Hi,
This directly relates to #694 which has been closed but is not fixed thus I open a new issue. I tried with 0.28.0 and I still have similar issues. Running
yapf -ri
on https://github.com/colour-science/colour/tree/46917f2b3ffefd7dd140384141302e3f87a69e99/colour/volume:And here is the diff:
Another thing I notice is that some line returns are being removed which produces rather unelegant formatting, ~I will open a new issue for that~, see #744.
Cheers,
Thomas