From 1340fe459b44c6f50b891866d15c46cae3f23738 Mon Sep 17 00:00:00 2001 From: Python3pkg Date: Sun, 21 May 2017 01:57:52 -0700 Subject: [PATCH] Convert to Python3 --- blackbody.py | 8 ++++---- ciexyz.py | 6 +++--- colormodels.py | 2 +- figures.py | 2 +- illuminants.py | 2 +- misc.py | 2 +- plots.py | 2 +- rayleigh.py | 4 ++-- test.py | 2 +- test_blackbody.py | 2 +- test_ciexyz.py | 2 +- test_colormodels.py | 2 +- test_illuminants.py | 2 +- test_rayleigh.py | 2 +- test_thinfilm.py | 2 +- thinfilm.py | 6 +++--- 16 files changed, 24 insertions(+), 24 deletions(-) diff --git a/blackbody.py b/blackbody.py index 4cd2b22..6c979bb 100755 --- a/blackbody.py +++ b/blackbody.py @@ -67,7 +67,7 @@ You should have received a copy of the GNU Lesser General Public License along with ColorPy. If not, see . ''' -from __future__ import division, absolute_import, print_function + import math, numpy, pylab @@ -176,9 +176,9 @@ def figures (): blackbody_patch_plot (T_list_cool, 'Cool Blackbody Colors', 'Blackbody-CoolPatch') # color vs temperature - blackbody_color_vs_temperature_plot (range (1200, 16000, 50), 'Blackbody Colors', 'Blackbody-Colors') - blackbody_color_vs_temperature_plot (range (10000, 40000, 100), 'Hot Blackbody Colors', 'Blackbody-HotColors') - blackbody_color_vs_temperature_plot (range (950, 1200, 1), 'Cool Blackbody Colors', 'Blackbody-CoolColors') + blackbody_color_vs_temperature_plot (list(range(1200, 16000, 50)), 'Blackbody Colors', 'Blackbody-Colors') + blackbody_color_vs_temperature_plot (list(range(10000, 40000, 100)), 'Hot Blackbody Colors', 'Blackbody-HotColors') + blackbody_color_vs_temperature_plot (list(range(950, 1200, 1)), 'Cool Blackbody Colors', 'Blackbody-CoolColors') # spectrum of specific temperatures blackbody_spectrum_plot (2000.0) diff --git a/ciexyz.py b/ciexyz.py index c7d460f..dd2b66a 100755 --- a/ciexyz.py +++ b/ciexyz.py @@ -116,7 +116,7 @@ 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 . ''' -from __future__ import division, absolute_import, print_function + import math, numpy @@ -690,7 +690,7 @@ def empty_spectrum (): The result can be passed to xyz_from_spectrum() to convert to an xyz color. ''' - wl_nm_range = range (start_wl_nm, end_wl_nm + 1) + wl_nm_range = list(range(start_wl_nm, end_wl_nm + 1)) num_wl = len (wl_nm_range) spectrum = numpy.zeros ((num_wl, 2)) for i in range (0, num_wl): @@ -742,7 +742,7 @@ def get_normalized_spectral_line_colors ( dwl_angstroms - Wavelength separation, in angstroms (0.1 nm). Default 10 A. (1 nm spacing) ''' # get range of wavelengths, in angstroms, so that we can have finer resolution than 1 nm - wl_angstrom_range = range (10*start_wl_nm, 10*(end_wl_nm + 1), dwl_angstroms) + wl_angstrom_range = list(range(10*start_wl_nm, 10*(end_wl_nm + 1), dwl_angstroms)) # get total point count num_spectral = len (wl_angstrom_range) num_points = num_spectral + num_purples diff --git a/colormodels.py b/colormodels.py index e6618dd..eef2ea6 100755 --- a/colormodels.py +++ b/colormodels.py @@ -248,7 +248,7 @@ You should have received a copy of the GNU Lesser General Public License along with ColorPy. If not, see . ''' -from __future__ import division, absolute_import, print_function + import math, numpy diff --git a/figures.py b/figures.py index b2f63c2..d02022d 100755 --- a/figures.py +++ b/figures.py @@ -42,7 +42,7 @@ You should have received a copy of the GNU Lesser General Public License along with ColorPy. If not, see . ''' -from __future__ import division, absolute_import, print_function + from . import (colormodels, ciexyz, illuminants, plots, blackbody, rayleigh, thinfilm, misc) diff --git a/illuminants.py b/illuminants.py index f8424f3..5a1ca54 100755 --- a/illuminants.py +++ b/illuminants.py @@ -88,7 +88,7 @@ You should have received a copy of the GNU Lesser General Public License along with ColorPy. If not, see . ''' -from __future__ import division, absolute_import, print_function + import math, numpy diff --git a/misc.py b/misc.py index ea64bee..e07b43c 100755 --- a/misc.py +++ b/misc.py @@ -61,7 +61,7 @@ You should have received a copy of the GNU Lesser General Public License along with ColorPy. If not, see . ''' -from __future__ import division, absolute_import, print_function + import math, numpy, pylab diff --git a/plots.py b/plots.py index 0345749..9e96cc1 100755 --- a/plots.py +++ b/plots.py @@ -121,7 +121,7 @@ You should have received a copy of the GNU Lesser General Public License along with ColorPy. If not, see . ''' -from __future__ import division, absolute_import, print_function + import math, random import numpy, pylab diff --git a/rayleigh.py b/rayleigh.py index cc5e785..24f9421 100755 --- a/rayleigh.py +++ b/rayleigh.py @@ -62,7 +62,7 @@ You should have received a copy of the GNU Lesser General Public License along with ColorPy. If not, see . ''' -from __future__ import division, absolute_import, print_function + import math import numpy, pylab @@ -160,7 +160,7 @@ def figures (): 'Rayleigh Scattering by Various Illuminants', 'Rayleigh-PatchVarious') # color vs illuminant temperature - T_list = range (1200, 16000, 50) # must be integers for range() + T_list = list(range(1200, 16000, 50)) # must be integers for range() rayleigh_color_vs_illuminant_temperature_plot (T_list, 'Rayleigh Scattering Sky Colors', 'Rayleigh-SkyColors') # spectra for several illuminants diff --git a/test.py b/test.py index b4fc98c..be30ee4 100755 --- a/test.py +++ b/test.py @@ -27,7 +27,7 @@ You should have received a copy of the GNU Lesser General Public License along with ColorPy. If not, see . ''' -from __future__ import division, absolute_import, print_function + from . import (test_colormodels, test_ciexyz, test_illuminants, test_blackbody, test_rayleigh, test_thinfilm) diff --git a/test_blackbody.py b/test_blackbody.py index a7bb481..ccff0ab 100755 --- a/test_blackbody.py +++ b/test_blackbody.py @@ -22,7 +22,7 @@ You should have received a copy of the GNU Lesser General Public License along with ColorPy. If not, see . ''' -from __future__ import division, absolute_import, print_function + import math, random, numpy diff --git a/test_ciexyz.py b/test_ciexyz.py index d886943..2057954 100755 --- a/test_ciexyz.py +++ b/test_ciexyz.py @@ -22,7 +22,7 @@ You should have received a copy of the GNU Lesser General Public License along with ColorPy. If not, see . ''' -from __future__ import division, absolute_import, print_function + import random diff --git a/test_colormodels.py b/test_colormodels.py index 9365012..9cea5b1 100755 --- a/test_colormodels.py +++ b/test_colormodels.py @@ -22,7 +22,7 @@ You should have received a copy of the GNU Lesser General Public License along with ColorPy. If not, see . ''' -from __future__ import division, absolute_import, print_function + import math, random, numpy from . import colormodels, ciexyz diff --git a/test_illuminants.py b/test_illuminants.py index 2543d9b..33b545e 100755 --- a/test_illuminants.py +++ b/test_illuminants.py @@ -22,7 +22,7 @@ You should have received a copy of the GNU Lesser General Public License along with ColorPy. If not, see . ''' -from __future__ import division, absolute_import, print_function + from . import illuminants diff --git a/test_rayleigh.py b/test_rayleigh.py index 6ade594..23a915c 100755 --- a/test_rayleigh.py +++ b/test_rayleigh.py @@ -22,7 +22,7 @@ You should have received a copy of the GNU Lesser General Public License along with ColorPy. If not, see . ''' -from __future__ import division, absolute_import, print_function + import random diff --git a/test_thinfilm.py b/test_thinfilm.py index 3142769..19bed6f 100755 --- a/test_thinfilm.py +++ b/test_thinfilm.py @@ -22,7 +22,7 @@ You should have received a copy of the GNU Lesser General Public License along with ColorPy. If not, see . ''' -from __future__ import division, absolute_import, print_function + import random diff --git a/thinfilm.py b/thinfilm.py index d0befdd..9f597e1 100755 --- a/thinfilm.py +++ b/thinfilm.py @@ -82,7 +82,7 @@ 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 . ''' -from __future__ import division, absolute_import, print_function + import math, cmath, numpy import pylab @@ -209,7 +209,7 @@ def thinfilm_spectrum_plot (n1, n2, n3, thickness_nm, illuminant, title, filenam def figures (): '''Draw some thin film plots.''' # simple patch plot - thickness_nm_list = range (0, 1000, 10) + thickness_nm_list = list(range(0, 1000, 10)) illuminant = illuminants.get_illuminant_D65() illuminants.scale_illuminant (illuminant, 9.50) thinfilm_patch_plot (1.500, 1.003, 1.500, thickness_nm_list, illuminant, 'ThinFilm Patch Plot', 'ThinFilm-Patch') @@ -217,7 +217,7 @@ def figures (): # plot the colors of films vs thickness. # we scale the illuminant to get a better range of color. #thickness_nm_list = range (0, 1000, 2) # faster - thickness_nm_list = range (0, 1000, 1) # nicer + thickness_nm_list = list(range(0, 1000, 1)) # nicer # gap in glass/plastic illuminant = illuminants.get_illuminant_D65() illuminants.scale_illuminant (illuminant, 4.50)