Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions colorpy/blackbody.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,13 @@
You should have received a copy of the GNU Lesser General Public License
along with ColorPy. If not, see <http://www.gnu.org/licenses/>.
'''
from __future__ import absolute_import

import math
import numpy
import pylab

import colormodels
import ciexyz
import plots
from . import colormodels, ciexyz, plots

# Physical constants in mks units
PLANCK_CONSTANT = 6.6237e-34 # J-sec
Expand Down
4 changes: 3 additions & 1 deletion colorpy/ciexyz.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,11 @@ def get_normalized_spectral_line_colors (
You should have received a copy of the GNU Lesser General Public License
along with ColorPy. If not, see <http://www.gnu.org/licenses/>.
'''
from __future__ import absolute_import

import math, numpy

import colormodels
from . import colormodels

# Assumed physical brightness of the monitor [W/m^2]
# 80 cd/m^2 * 20.3 mW/cd (assuming light at 556 nm)
Expand Down
11 changes: 4 additions & 7 deletions colorpy/figures.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,10 @@
You should have received a copy of the GNU Lesser General Public License
along with ColorPy. If not, see <http://www.gnu.org/licenses/>.
'''
import colormodels
import illuminants
import plots
import blackbody
import rayleigh
import thinfilm
import misc
from __future__ import absolute_import

from . import (colormodels, illuminants, plots, blackbody, rayleigh,
thinfilm, misc)

def figures ():
'''Create all the ColorPy sample figures.'''
Expand Down
6 changes: 3 additions & 3 deletions colorpy/illuminants.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,9 @@
You should have received a copy of the GNU Lesser General Public License
along with ColorPy. If not, see <http://www.gnu.org/licenses/>.
'''
import ciexyz
import blackbody
import plots
from __future__ import absolute_import

from . import ciexyz, blackbody, plots

# table of CIE Illuminant D65 spectrum.
# data from: http://cvrl.ioo.ucl.ac.uk/database/data/cie/Illuminantd65.txt
Expand Down
6 changes: 3 additions & 3 deletions colorpy/misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,11 @@
You should have received a copy of the GNU Lesser General Public License
along with ColorPy. If not, see <http://www.gnu.org/licenses/>.
'''
from __future__ import absolute_import

import math, numpy

import colormodels
import ciexyz
import plots
from . import colormodels, ciexyz, plots

# Some sample lists of displayable RGB colors as hex strings

Expand Down
5 changes: 2 additions & 3 deletions colorpy/plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,13 +121,12 @@
You should have received a copy of the GNU Lesser General Public License
along with ColorPy. If not, see <http://www.gnu.org/licenses/>.
'''
from __future__ import print_function
from __future__ import print_function, absolute_import

import math
import numpy, pylab

import colormodels
import ciexyz
from . import colormodels, ciexyz

# Miscellaneous utilities for plots

Expand Down
8 changes: 3 additions & 5 deletions colorpy/rayleigh.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,12 @@
You should have received a copy of the GNU Lesser General Public License
along with ColorPy. If not, see <http://www.gnu.org/licenses/>.
'''
from __future__ import absolute_import

import math
import numpy, pylab

import colormodels
import ciexyz
import illuminants
import blackbody
import plots
from . import colormodels, ciexyz, illuminants, blackbody, plots

def rayleigh_scattering (wl_nm):
'''Get the Rayleigh scattering factor for the wavelength.
Expand Down
10 changes: 3 additions & 7 deletions colorpy/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,12 @@
You should have received a copy of the GNU Lesser General Public License
along with ColorPy. If not, see <http://www.gnu.org/licenses/>.
'''
from __future__ import print_function
from __future__ import print_function, absolute_import

import unittest

import test_colormodels
import test_ciexyz
import test_illuminants
import test_blackbody
import test_rayleigh
import test_thinfilm
from . import (test_colormodels, test_ciexyz, test_illuminants,
test_blackbody, test_rayleigh, test_thinfilm)

def test ():
# no test cases for plots/misc - but figures.py will exercise those.
Expand Down
5 changes: 2 additions & 3 deletions colorpy/test_blackbody.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,13 @@
You should have received a copy of the GNU Lesser General Public License
along with ColorPy. If not, see <http://www.gnu.org/licenses/>.
'''
from __future__ import print_function
from __future__ import print_function, absolute_import

import math
import numpy
import unittest

import blackbody
import colormodels
from . import blackbody, colormodels

# FIXME: The following calculation is not working currently.
# It is an attempt to get the scale of the intensity correct.
Expand Down
4 changes: 2 additions & 2 deletions colorpy/test_ciexyz.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@
You should have received a copy of the GNU Lesser General Public License
along with ColorPy. If not, see <http://www.gnu.org/licenses/>.
'''
from __future__ import print_function
from __future__ import print_function, absolute_import

import random
import unittest

import ciexyz
from . import ciexyz


class TestCiexyz(unittest.TestCase):
Expand Down
5 changes: 2 additions & 3 deletions colorpy/test_colormodels.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,12 @@
You should have received a copy of the GNU Lesser General Public License
along with ColorPy. If not, see <http://www.gnu.org/licenses/>.
'''
from __future__ import print_function
from __future__ import print_function, absolute_import

import math, random, numpy
import unittest

import colormodels
import ciexyz
from . import colormodels, ciexyz

# Functions to calculate the cutoff point between various algorithms.
# These do not really belong here...
Expand Down
4 changes: 2 additions & 2 deletions colorpy/test_illuminants.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@
You should have received a copy of the GNU Lesser General Public License
along with ColorPy. If not, see <http://www.gnu.org/licenses/>.
'''
from __future__ import print_function
from __future__ import print_function, absolute_import

import unittest

import illuminants
from . import illuminants


class TestIlluminants(unittest.TestCase):
Expand Down
6 changes: 2 additions & 4 deletions colorpy/test_rayleigh.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,14 @@
You should have received a copy of the GNU Lesser General Public License
along with ColorPy. If not, see <http://www.gnu.org/licenses/>.
'''
from __future__ import print_function
from __future__ import print_function, absolute_import

import math
import numpy
import random
import unittest

import ciexyz
import rayleigh
import illuminants
from . import ciexyz, rayleigh, illuminants


class TestRayleigh(unittest.TestCase):
Expand Down
5 changes: 2 additions & 3 deletions colorpy/test_thinfilm.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,12 @@
You should have received a copy of the GNU Lesser General Public License
along with ColorPy. If not, see <http://www.gnu.org/licenses/>.
'''
from __future__ import print_function
from __future__ import print_function, absolute_import

import random
import unittest

import illuminants
import thinfilm
from . import illuminants, thinfilm


class TestThinFilm(unittest.TestCase):
Expand Down
7 changes: 3 additions & 4 deletions colorpy/thinfilm.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,11 @@ class thin_film (n1, n2, n3, thickness_nm) -
You should have received a copy of the GNU Lesser General Public License
along with ColorPy. If not, see <http://www.gnu.org/licenses/>.
'''
from __future__ import absolute_import

import math, cmath, numpy

import colormodels
import ciexyz
import illuminants
import plots
from . import colormodels, ciexyz, illuminants, plots

class thin_film:
'''A thin film of dielectric material.'''
Expand Down