Add docstrings skeletons.
[OpenColorIO-Configs.git] / aces_1.0.0 / python / aces_ocio / util.py
index f525d11..f7b2e23 100644 (file)
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+
 import os
 import re
 
 import PyOpenColorIO as OCIO
 
+__author__ = 'ACES Developers'
+__copyright__ = 'Copyright (C) 2014 - 2015 - ACES Developers'
+__license__ = ''
+__maintainer__ = 'ACES Developers'
+__email__ = 'aces@oscars.org'
+__status__ = 'Production'
+
+__all__ = ['ColorSpace',
+           'mat44FromMat33',
+           'filter_words',
+           'files_walker']
+
 #
 # Utility classes and functions
 #
+
 class ColorSpace:
-    "A container for data needed to define an OCIO 'Color Space' "
+    """
+    A container for data needed to define an OCIO 'Color Space'
+    """
 
     def __init__(self,
-        name,
-        description=None,
-        bitDepth=OCIO.Constants.BIT_DEPTH_F32,
-        equalityGroup=None,
-        family=None,
-        isData=False,
-        toReferenceTransforms=[],
-        fromReferenceTransforms=[],
-        allocationType=OCIO.Constants.ALLOCATION_UNIFORM,
-        allocationVars=[0.0, 1.0]):
-        "Initialize the standard class variables"
+                 name,
+                 description=None,
+                 bitDepth=OCIO.Constants.BIT_DEPTH_F32,
+                 equalityGroup=None,
+                 family=None,
+                 isData=False,
+                 toReferenceTransforms=[],
+                 fromReferenceTransforms=[],
+                 allocationType=OCIO.Constants.ALLOCATION_UNIFORM,
+                 allocationVars=[0.0, 1.0]):
+        """
+        Object description.
+
+        Parameters
+        ----------
+        parameter : type
+            Parameter description.
+
+        Returns
+        -------
+        type
+             Return value description.
+        """
+
         self.name = name
-        self.bitDepth=bitDepth
+        self.bitDepth = bitDepth
         self.description = description
-        self.equalityGroup=equalityGroup
-        self.family=family
-        self.isData=isData
-        self.toReferenceTransforms=toReferenceTransforms
-        self.fromReferenceTransforms=fromReferenceTransforms
-        self.allocationType=allocationType
-        self.allocationVars=allocationVars
-
-# Create a 4x4 matrix (list) based on a 3x3 matrix (list) input
+        self.equalityGroup = equalityGroup
+        self.family = family
+        self.isData = isData
+        self.toReferenceTransforms = toReferenceTransforms
+        self.fromReferenceTransforms = fromReferenceTransforms
+        self.allocationType = allocationType
+        self.allocationVars = allocationVars
+
+
 def mat44FromMat33(mat33):
+    """
+    Creates a 4x4 matrix from given 3x3 matrix.
+
+    Parameters
+    ----------
+    parameter : type
+        Parameter description.
+
+    Returns
+    -------
+    type
+         Return value description.
+    """
+
     return [mat33[0], mat33[1], mat33[2], 0.0,
             mat33[3], mat33[4], mat33[5], 0.0,
             mat33[6], mat33[7], mat33[8], 0.0,
-            0,0,0,1.0]
+            0, 0, 0, 1.0]
+
 
-# TODO: Worth moving to *util.py*.
 def filter_words(words, filters_in=None, filters_out=None, flags=0):
     """
+    Object description.
+
+    Parameters
+    ----------
+    parameter : type
+        Parameter description.
+
+    Returns
+    -------
+    type
+         Return value description.
     """
 
     filtered_words = []
@@ -69,6 +125,17 @@ def filter_words(words, filters_in=None, filters_out=None, flags=0):
 
 def files_walker(directory, filters_in=None, filters_out=None, flags=0):
     """
+    Object description.
+
+    Parameters
+    ----------
+    parameter : type
+        Parameter description.
+
+    Returns
+    -------
+    type
+         Return value description.
     """
 
     for parent_directory, directories, files in os.walk(directory,
@@ -81,7 +148,3 @@ def files_walker(directory, filters_in=None, filters_out=None, flags=0):
                     continue
 
                 yield path
-
-
-
-