Skip to content
This repository has been archived by the owner on Dec 12, 2023. It is now read-only.

Commit

Permalink
Sweeping style pass for consistency
Browse files Browse the repository at this point in the history
  • Loading branch information
gtaylor committed Dec 27, 2017
1 parent 671e965 commit 426044d
Show file tree
Hide file tree
Showing 7 changed files with 88 additions and 127 deletions.
2 changes: 0 additions & 2 deletions colormath/chromatic_adaptation.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ def apply_chromatic_adaptation(val_x, val_y, val_z, orig_illum, targ_illum,
http://brucelindbloom.com/ChromAdaptEval.html
"""

# It's silly to have to do this, but some people may want to call this
# function directly, so we'll protect them from messing up upper/lower case.
adaptation = adaptation.lower()
Expand Down Expand Up @@ -102,7 +101,6 @@ def apply_chromatic_adaptation_on_color(color, targ_illum, adaptation='bradford'
"""
Convenience function to apply an adaptation directly to a Color object.
"""

xyz_x = color.xyz_x
xyz_y = color.xyz_y
xyz_z = color.xyz_z
Expand Down
20 changes: 10 additions & 10 deletions colormath/color_appearance_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
logger = logging.getLogger(__name__)


class Nayatani95():
class Nayatani95(object):
"""
**References**
Expand Down Expand Up @@ -226,7 +226,7 @@ def xyz_to_rgb(cls, xyz):
return cls.xyz_to_rgb_m.dot(xyz)


class Hunt():
class Hunt(object):
"""
**References**
Expand Down Expand Up @@ -625,7 +625,7 @@ def _calculate_eccentricity_factor(hue_angle):
return out


class RLAB():
class RLAB(object):
"""
**References**
Expand Down Expand Up @@ -717,9 +717,10 @@ def __init__(self, x, y, z, x_n, y_n, z_n, y_n_abs, sigma, d):
logger.debug('A: {}'.format(a))
xyz_ref = self.R.dot(a).dot(Hunt.xyz_to_rgb_m).dot(xyz)
else:
# So we have an array. Since constructing huge multidimensional arrays might not bee the best idea,
# we will handle each input dimension separately.
# First figure out how many values we have to deal with.
# So we have an array. Since constructing huge multidimensional
# arrays might not bee the best idea, we will handle each input
# dimension separately. First figure out how many values we have to
# deal with.
input_dim = len(x)
# No create the ouput array that we will fill layer by layer
xyz_ref = numpy.zeros((3, input_dim))
Expand Down Expand Up @@ -751,7 +752,7 @@ def __init__(self, x, y, z, x_n, y_n, z_n, y_n_abs, sigma, d):
self._saturation = self.chroma / self.lightness


class ATD95():
class ATD95(object):
"""
**References**
Expand Down Expand Up @@ -850,7 +851,7 @@ def _xyz_to_lms(xyz):
return numpy.array([l, m, s])


class LLAB():
class LLAB(object):
"""
**References**
Expand Down Expand Up @@ -992,7 +993,7 @@ def xyz_to_rgb(cls, xyz):
return cls.xyz_to_rgb_m.dot(xyz / xyz[1])


class CIECAM02():
class CIECAM02(object):
"""
**References**
Expand Down Expand Up @@ -1216,7 +1217,6 @@ class CIECAM02m1(CIECAM02):
* Wu, R. C., & Wardman, R. H. (2007). Proposed modification to the CIECAM02 colour appearance model to include the
simultaneous contrast effects. *Color Research & Application*, 32(2), 121-129.
"""

def __init__(self, x, y, z, x_w, y_w, z_w, x_b, y_b, z_b, l_a, c, n_c, f, p, d=False):
"""
:param x: X value of test sample :math:`X`.
Expand Down
Loading

0 comments on commit 426044d

Please sign in to comment.