Skip to content

Commit

Permalink
Implement code review notes.
Browse files Browse the repository at this point in the history
  • Loading branch information
KelSolaar committed Aug 2, 2015
1 parent 0c69264 commit 465abef
Show file tree
Hide file tree
Showing 14 changed files with 39 additions and 34 deletions.
2 changes: 1 addition & 1 deletion aces_1.0.0/python/aces_ocio/__init__.py
Expand Up @@ -11,7 +11,7 @@
Python
******
>>> from aces_ocio.config import generate_config
>>> from aces_ocio.generate_config import generate_config
>>> aces_ctl_directory = '/path/to/github/checkout/releases/v1.0.0/transforms/ctl'
>>> config_directory = '/path/to/configuration/dir'
>>> generate_config(aces_ctl_directory, config_directory, 1024, 33, True)
Expand Down
9 changes: 4 additions & 5 deletions aces_1.0.0/python/aces_ocio/colorspaces/aces.py
Expand Up @@ -16,7 +16,7 @@

import PyOpenColorIO as ocio

from aces_ocio.lut import (
from aces_ocio.generate_lut import (
generate_1d_LUT_from_CTL,
generate_3d_LUT_from_CTL,
write_SPI_1d)
Expand Down Expand Up @@ -737,8 +737,7 @@ def create_ACES_LMT(lmt_name,
ctls = [os.path.join(aces_ctl_directory,
lmt_values['transformCTLInverse']),
shaper_from_aces_ctl % aces_ctl_directory]
# TODO: Investigate unresolved `odt_name` reference.
lut = 'Inverse.%s.%s.spi3d' % (odt_name, shaper_name)
lut = 'Inverse.%s.%s.spi3d' % (lmt_name, shaper_name)

lut = sanitize(lut)

Expand Down Expand Up @@ -1200,8 +1199,8 @@ def create_ODTs(aces_ctl_directory,
for odt in sorted_odts:
(odt_name, odt_values) = odt

# Defining full range transform for *ODTs* that can only generate
# either *legal* or *full* output.
# Defining full range transform for *ODTs* that can generate either
# *legal* or *full* output.

# Uncomment these lines and the lower section and
# flip the `legalRange` value to 1 to restore the old behavior,
Expand Down
2 changes: 1 addition & 1 deletion aces_1.0.0/python/aces_ocio/colorspaces/arri.py
Expand Up @@ -13,7 +13,7 @@

import PyOpenColorIO as ocio

import aces_ocio.lut as genlut
import aces_ocio.generate_lut as genlut
from aces_ocio.utilities import ColorSpace, mat44_from_mat33, sanitize

__author__ = 'ACES Developers'
Expand Down
2 changes: 1 addition & 1 deletion aces_1.0.0/python/aces_ocio/colorspaces/canon.py
Expand Up @@ -12,7 +12,7 @@

import PyOpenColorIO as ocio

import aces_ocio.lut as genlut
import aces_ocio.generate_lut as genlut
from aces_ocio.utilities import ColorSpace

__author__ = 'ACES Developers'
Expand Down
2 changes: 1 addition & 1 deletion aces_1.0.0/python/aces_ocio/colorspaces/general.py
Expand Up @@ -12,7 +12,7 @@

import PyOpenColorIO as ocio

import aces_ocio.lut as genlut
import aces_ocio.generate_lut as genlut
from aces_ocio.colorspaces import aces
from aces_ocio.utilities import ColorSpace, mat44_from_mat33

Expand Down
2 changes: 1 addition & 1 deletion aces_1.0.0/python/aces_ocio/colorspaces/gopro.py
Expand Up @@ -12,7 +12,7 @@

import PyOpenColorIO as ocio

import aces_ocio.lut as genlut
import aces_ocio.generate_lut as genlut
from aces_ocio.utilities import (ColorSpace, sanitize)

__author__ = 'ACES Developers'
Expand Down
2 changes: 1 addition & 1 deletion aces_1.0.0/python/aces_ocio/colorspaces/panasonic.py
Expand Up @@ -11,7 +11,7 @@

import PyOpenColorIO as ocio

import aces_ocio.lut as genlut
import aces_ocio.generate_lut as genlut
from aces_ocio.utilities import ColorSpace

__author__ = 'ACES Developers'
Expand Down
2 changes: 1 addition & 1 deletion aces_1.0.0/python/aces_ocio/colorspaces/red.py
Expand Up @@ -12,7 +12,7 @@

import PyOpenColorIO as ocio

import aces_ocio.lut as genlut
import aces_ocio.generate_lut as genlut
from aces_ocio.utilities import ColorSpace, mat44_from_mat33

__author__ = 'ACES Developers'
Expand Down
2 changes: 1 addition & 1 deletion aces_1.0.0/python/aces_ocio/colorspaces/sony.py
Expand Up @@ -12,7 +12,7 @@

import PyOpenColorIO as ocio

import aces_ocio.lut as genlut
import aces_ocio.generate_lut as genlut
from aces_ocio.utilities import ColorSpace, mat44_from_mat33

__author__ = 'ACES Developers'
Expand Down
Expand Up @@ -419,7 +419,7 @@ def add_look(config,

config_data['colorSpaces'].append(colorspace)

print()
print('')


def add_looks_to_views(looks,
Expand Down Expand Up @@ -575,13 +575,20 @@ def create_config(config_data,

if aliases:
if reference_data.aliases:
# TODO: Explain context for following comment.
# Deferring adding alias colorspaces until end, which helps with
# some applications.
# applications listing the colorspaces in the order that they were
# defined in the configuration: alias colorspaces are usually named
# lower case with spaces but normal colorspaces names are longer
# and more verbose, thus it becomes harder for user to visually
# parse the list of colorspaces when there are names such as
# "crv_canonlog" interspersed with names like
# "Input - Canon - Curve - Canon-Log".
# Moving the alias colorspace definitions to the end of the
# configuration avoids the above problem.
alias_colorspaces.append(
[reference_data, reference_data, reference_data.aliases])

print()
print('')

if look_info:
print('Adding looks')
Expand All @@ -600,7 +607,7 @@ def create_config(config_data,
config_data,
multiple_displays)

print()
print('')

print('Adding regular colorspaces')

Expand Down Expand Up @@ -649,15 +656,15 @@ def create_config(config_data,

if aliases:
if colorspace.aliases:
# TODO: Explain context for following comment.
# Deferring adding alias colorspaces until end, which helps
# with some applications.
# with applications listing the colorspaces in the order that
# they were defined in the configuration.
alias_colorspaces.append(
[reference_data, colorspace, colorspace.aliases])

print()
print('')

print()
print('')

# Adding roles early so that alias colorspaces can be created
# with roles names before remaining colorspace aliases are added
Expand All @@ -680,7 +687,7 @@ def create_config(config_data,
texture_paint=prefixed_names[
config_data['roles']['texture_paint']])

# TODO: Should we remove this dead code path?
# TODO: Pending code path reactivation.
# Not allowed at the moment as role names can not overlap
# with colorspace names.
"""
Expand Down Expand Up @@ -721,7 +728,7 @@ def create_config(config_data,
scene_linear=config_data['roles']['scene_linear'],
texture_paint=config_data['roles']['texture_paint'])

# TODO: Should we remove this dead code path?
# TODO: Pending code path reactivation.
# Not allowed at the moment as role names can not overlap
# with colorspace names.
"""
Expand All @@ -746,7 +753,7 @@ def create_config(config_data,
config, reference_data, role_colorspace, [role_name], 'Roles')
"""

print()
print('')

# Adding alias colorspaces at the end as some applications use
# colorspaces definitions order of the configuration to order
Expand All @@ -758,7 +765,7 @@ def create_config(config_data,
for reference, colorspace, aliases in alias_colorspaces:
add_colorspace_aliases(config, reference, colorspace, aliases)

print()
print('')

print('Adding the diplays and views')

Expand Down Expand Up @@ -890,7 +897,7 @@ def create_config(config_data,
config.setActiveDisplays(','.join(sorted(displays)))
config.setActiveViews(','.join(views))

print()
print('')

# Ensuring the configuration is valid.
config.sanityCheck()
Expand Down
Expand Up @@ -829,11 +829,11 @@ def main():
else:
print('3D LUT generation options')

print('Lut : %s' % lut)
print('LUT : %s' % lut)
print('Format : %s' % format)
print('CTLs : %s' % ctls)
print('Lut Res 1d : %s' % lut_resolution_1d)
print('Lut Res 3d : %s' % lut_resolution_3d)
print('LUT Res 1d : %s' % lut_resolution_1d)
print('LUT Res 3d : %s' % lut_resolution_3d)
print('Min Value : %s' % min_value)
print('Max Value : %s' % max_value)
print('Input Scale : %s' % input_scale)
Expand Down
3 changes: 1 addition & 2 deletions aces_1.0.0/python/aces_ocio/tests/tests_aces_config.py
Expand Up @@ -19,7 +19,7 @@
os.path.join(os.path.dirname(__file__), '..', '..')))

from aces_ocio.utilities import files_walker
from aces_ocio.config import (
from aces_ocio.generate_config import (
ACES_OCIO_CTL_DIRECTORY_ENVIRON,
generate_config)

Expand All @@ -40,7 +40,6 @@
# tests.
REFERENCE_CONFIG_ROOT_DIRECTORY = os.path.abspath(
os.path.join(os.path.dirname(__file__), '..', '..', '..'))
REFERENCE_CONFIG_ROOT_DIRECTORY = '/colour-science/colour-ramblings/ocio/aces'

HASH_TEST_PATTERNS = ('\.3dl', '\.lut', '\.csp')
UNHASHABLE_TEST_PATTERNS = ('\.icc', '\.ocio')
Expand Down
2 changes: 1 addition & 1 deletion aces_1.0.0/python/bin/create_aces_config
Expand Up @@ -12,7 +12,7 @@ import sys

sys.path.append(os.path.join(os.path.dirname(__file__), '..'))

from aces_ocio.config import main
from aces_ocio.generate_config import main

__author__ = 'ACES Developers'
__copyright__ = 'Copyright (C) 2014 - 2015 - ACES Developers'
Expand Down
2 changes: 1 addition & 1 deletion aces_1.0.0/python/bin/generate_lut
Expand Up @@ -12,7 +12,7 @@ import sys

sys.path.append(os.path.join(os.path.dirname(__file__), '..'))

from aces_ocio.lut import main
from aces_ocio.generate_lut import main

__author__ = 'ACES Developers'
__copyright__ = 'Copyright (C) 2014 - 2015 - ACES Developers'
Expand Down

0 comments on commit 465abef

Please sign in to comment.