Skip to content

Commit

Permalink
apply isort
Browse files Browse the repository at this point in the history
  • Loading branch information
nschloe committed Jul 10, 2019
1 parent 7fefd04 commit 7c1bd09
Show file tree
Hide file tree
Showing 12 changed files with 51 additions and 56 deletions.
6 changes: 2 additions & 4 deletions colorio/__about__.py
@@ -1,8 +1,6 @@

__author__ = u"Nico Schlömer"
__author__ = "Nico Schlömer"
__email__ = "nico.schloemer@gmail.com"
__copyright__ = u"Copyright (c) 2018-2019 {} <{}>".format(__author__, __email__)
__copyright__ = "Copyright (c) 2018-2019 {} <{}>".format(__author__, __email__)
__license__ = "License :: OSI Approved :: MIT License"
__version__ = "0.2.5"
__maintainer__ = "Nico Schlömer"
__status__ = "Development Status :: 4 - Beta"
36 changes: 16 additions & 20 deletions colorio/__init__.py
@@ -1,54 +1,50 @@
from . import illuminants, observers
from .__about__ import (
__author__,
__email__,
__copyright__,
__email__,
__license__,
__version__,
__maintainer__,
__status__,
__version__,
)

from .cam16 import CAM16, CAM16UCS
from .ciecam02 import CIECAM02, CAM02, NegativeAError
from .ciecam02 import CAM02, CIECAM02, NegativeAError
from .ciehcl import CIEHCL
from .cielab import CIELAB
from .cielch import CIELCH
from .cieluv import CIELUV
from . import illuminants
from .ictcp import ICtCp
from .ipt import IPT
from .jzazbz import JzAzBz
from . import observers
from .rec2020 import Rec2020
from .srgb import SrgbLinear
from .xyy import XYY
from .xyz import XYZ
from .tools import (
show_srgb_gamut,
show_rec2020_gamut,
show_visible_gamut,
show_flat_gamut,
delta,
plot_luo_rigg,
plot_macadam,
save_macadam,
show_ebner_fairchild,
show_flat_gamut,
show_hung_berns,
show_munsell,
show_luo_rigg,
show_macadam,
save_macadam,
plot_macadam,
plot_luo_rigg,
show_munsell,
show_rec2020_gamut,
show_srgb_gamut,
show_straights,
xy_gamut_mesh,
show_luo_rigg,
show_visible_gamut,
show_xiao,
xy_gamut_mesh,
)
from .xyy import XYY
from .xyz import XYZ

__all__ = [
"__author__",
"__email__",
"__copyright__",
"__license__",
"__version__",
"__maintainer__",
"__status__",
#
"CAM16",
Expand Down
2 changes: 1 addition & 1 deletion colorio/data/xiao/convert.py
@@ -1,10 +1,10 @@
"""
Helper tool for converting XLSX data to YAML.
"""
import openpyxl
import numpy
import yaml

import openpyxl

wb = openpyxl.load_workbook("xiao.xlsx")

Expand Down
1 change: 0 additions & 1 deletion colorio/illuminants.py
Expand Up @@ -5,7 +5,6 @@

from . import observers


# The 'standard' 2 degree observer (CIE 1931). From
# <https://github.com/njsmith/colorspacious/blob/master/colorspacious/illuminants.py>
whitepoints_cie1931 = {
Expand Down
3 changes: 2 additions & 1 deletion colorio/srgb.py
@@ -1,13 +1,14 @@
import numpy

from .illuminants import whitepoints_cie1931
from .xyy import XYY
from .linalg import dot, solve
from .xyy import XYY


class SrgbLinear:
"""Rec. 709 SRGB.
"""

def __init__(self, whitepoint_correction=True):
# The standard actually gives the values in terms of M, but really inv(M) is a
# direct derivative of the primary specification at
Expand Down
6 changes: 3 additions & 3 deletions colorio/tools.py
@@ -1,17 +1,17 @@
import os

import matplotlib
from matplotlib.patches import Ellipse
import matplotlib.pyplot as plt
import numpy
import yaml
from matplotlib.patches import Ellipse
from scipy.optimize import leastsq
from scipy.spatial import ConvexHull
import yaml

import meshzoo

from .illuminants import spectrum_to_xyz100, planckian_radiator, whitepoints_cie1931
from . import observers
from .illuminants import planckian_radiator, spectrum_to_xyz100, whitepoints_cie1931
from .rec2020 import Rec2020
from .srgb import SrgbLinear
from .xyy import XYY
Expand Down
2 changes: 0 additions & 2 deletions colorio/xyz.py
@@ -1,5 +1,3 @@


class XYZ:
def __init__(self):
self.labels = ["X", "Y", "Z"]
Expand Down
33 changes: 16 additions & 17 deletions experiments/new-cs.py
@@ -1,34 +1,33 @@
import os

import numpy
import yaml
from dolfin import (
BoundingBoxTree,
Cell,
Expression,
Function,
FunctionSpace,
Mesh,
MeshEditor,
FunctionSpace,
Function,
grad,
VectorFunctionSpace,
project,
TrialFunction,
Point,
TestFunction,
dot,
dx,
assemble,
Expression,
TrialFunction,
VectorFunctionSpace,
as_backend_type,
BoundingBoxTree,
Point,
Cell,
assemble,
dof_to_vertex_map,
dot,
dx,
grad,
project,
vertex_to_dof_map,
)
import numpy
from scipy import sparse
from scipy.sparse.linalg import LinearOperator
from scipy.optimize import leastsq
import yaml
from scipy.sparse.linalg import LinearOperator

import meshzoo

from pade2d import Pade2d


Expand Down
4 changes: 2 additions & 2 deletions experiments/show_transformation.py
@@ -1,8 +1,8 @@
import argparse
import matplotlib.pyplot as plt

from dolfin import Mesh, FunctionSpace, Function, MeshEditor
import matplotlib.pyplot as plt
import numpy
from dolfin import Function, FunctionSpace, Mesh, MeshEditor

import colorio
import meshzoo
Expand Down
2 changes: 1 addition & 1 deletion setup.py
@@ -1,7 +1,7 @@
import codecs
import os

from setuptools import setup, find_packages
from setuptools import find_packages, setup

# https://packaging.python.org/single_source_version/
base_dir = os.path.abspath(os.path.dirname(__file__))
Expand Down
5 changes: 2 additions & 3 deletions test/test_comparisons.py
@@ -1,9 +1,8 @@
import numpy

# import colour
import colorspacious
import colorio
import numpy

import colorio
from cam16_legacy import CAM16Legacy

numpy.random.seed(0)
Expand Down
7 changes: 6 additions & 1 deletion test/test_jzazbz.py
Expand Up @@ -5,7 +5,12 @@


@pytest.mark.parametrize(
"xyz", [100 * numpy.random.rand(3), 100 * numpy.random.rand(3, 7), 100 * numpy.random.rand(3, 4, 5)]
"xyz",
[
100 * numpy.random.rand(3),
100 * numpy.random.rand(3, 7),
100 * numpy.random.rand(3, 4, 5),
],
)
def test_conversion(xyz):
jzazbz = colorio.JzAzBz()
Expand Down

0 comments on commit 7c1bd09

Please sign in to comment.