3333__status__ = 'Production'
3434
3535__all__ = [
36- 'CLF_URN ' , 'CLF_URN_SEPARATOR ' , 'CLF_ID_SEPARATOR ' , 'CLF_NAMESPACE ' ,
37- 'CLF_TYPES ' , 'CLF_TRANSFORMS_ROOT' , 'CLF_TRANSFORM_FAMILIES ' ,
38- 'DEFAULT_CLF_TRANSFORM_GENUS ' , 'DEFAULT_CLF_TRANSFORM_FILTERERS ' ,
39- 'DESCRIPTION_SUBSTITUTION_PATTERNS ' , 'clf_transform_relative_path ' ,
40- 'CLFTransformID ' , 'CLFTransform ' , 'CLFTransformPair ' ,
41- 'find_clf_transform_pairs' , 'discover_clf_transforms' ,
36+ 'URN_CLF ' , 'SEPARATOR_URN_CLF ' , 'SEPARATOR_ID_CLF ' , 'NAMESPACE_CLF ' ,
37+ 'TRANSFORM_TYPES_CLF ' , 'TRANSFORM_FAMILIES_CLF ' ,
38+ 'TRANSFORM_GENUS_DEFAULT_CLF ' , 'TRANSFORM_FILTERERS_DEFAULT_CLF ' ,
39+ 'PATTERNS_DESCRIPTION_CLF ' , 'ROOT_TRANSFORMS_CLF ' ,
40+ 'clf_transform_relative_path ' , 'CLFTransformID ' , 'CLFTransform ' ,
41+ 'CLFTransformPair' , ' find_clf_transform_pairs' , 'discover_clf_transforms' ,
4242 'classify_clf_transforms' , 'unclassify_clf_transforms' ,
4343 'filter_clf_transforms' , 'print_clf_taxonomy'
4444]
4545
46- CLF_URN = 'urn:aswf:ocio:transformId:v1.0'
46+ URN_CLF = 'urn:aswf:ocio:transformId:v1.0'
4747"""
4848*CLF* Uniform Resource Name (*URN*).
4949
50- CLF_URN : unicode
50+ URN_CLF : unicode
5151"""
5252
53- CLF_URN_SEPARATOR = ':'
53+ SEPARATOR_URN_CLF = ':'
5454"""
5555*CLFtransformID* separator used to separate the *URN* and *ID* part of the
5656*CLFtransformID*.
5757
58- CLF_URN_SEPARATOR : unicode
58+ SEPARATOR_URN_CLF : unicode
5959"""
6060
61- CLF_ID_SEPARATOR = '.'
61+ SEPARATOR_ID_CLF = '.'
6262"""
6363*CLFtransformID* separator used to tokenize the *ID* part of the
6464*CLFtransformID*.
6565
6666urn:aswf:ocio:transformId:v1.0:ACES.OCIO.AP0_to_AP1-Gamma2pnt2.c1.v1
6767|-------------URN------------|:|-----------------ID----------------|
6868
69- CLF_ID_SEPARATOR : unicode
69+ SEPARATOR_ID_CLF : unicode
7070"""
7171
72- CLF_NAMESPACE = 'OCIO'
72+ NAMESPACE_CLF = 'OCIO'
7373"""
7474*ACES* namespace for the *OCIO* *CLF* transforms.
7575
76- CLF_NAMESPACE : unicode
76+ NAMESPACE_CLF : unicode
7777"""
7878
79- CLF_TYPES = [
79+ TRANSFORM_TYPES_CLF = [
8080 'ACES' ,
8181 'Common' ,
8282]
8383"""
8484*CLF* transform types.
8585
86- CLF_TYPES : list
86+ TRANSFORM_TYPES_CLF : list
8787"""
8888
89- CLF_TRANSFORMS_ROOT = os .path .normpath (
90- os .environ .get (
91- 'OPENCOLORIO_CONFIG_ACES__CLF_TRANSFORMS_ROOT' ,
92- os .path .join (
93- os .path .dirname (__file__ ), '..' , 'transforms' , 'builtins' )))
89+ TRANSFORM_FAMILIES_CLF = {'aces' : 'aces' }
9490"""
95- *CLF* transforms root directory, default to the version controlled
96- sub-module repository. It can be defined by setting the
97- `OPENCOLORIO_CONFIG_ACES__CLF_TRANSFORMS_ROOT` environment variable with
98- the local 'transforms/clf' directory.
91+ *CLF* transform families mapping the *CLF* transform directories to family
92+ names.
9993
100- CLF_TRANSFORMS_ROOT : unicode
94+ TRANSFORM_FAMILIES_CLF : dict
10195"""
10296
103- CLF_TRANSFORM_FAMILIES = { 'aces' : 'aces' }
97+ TRANSFORM_GENUS_DEFAULT_CLF = 'undefined'
10498"""
105- *CLF* transform families mapping the *CLF* transform directories to family
106- names.
99+ *CLF* transform default genus, i.e. *undefined*.
107100
108- CLF_TRANSFORM_FAMILIES : dict
101+ TRANSFORM_GENUS_DEFAULT_CLF : unicode
109102"""
110103
111- DEFAULT_CLF_TRANSFORM_GENUS = 'undefined'
104+ TRANSFORM_FILTERERS_DEFAULT_CLF = []
112105"""
113- *CLF* transform default genus, i.e. *undefined* .
106+ Default list of *CLF* transform filterers .
114107
115- DEFAULT_CLF_TRANSFORM_GENUS : unicode
108+ TRANSFORM_FILTERERS_DEFAULT_CLF : list
116109"""
117110
118- DESCRIPTION_SUBSTITUTION_PATTERNS = {}
111+ PATTERNS_DESCRIPTION_CLF = {}
119112"""
120113*CLF* transform description substitution patterns.
121114
122- DESCRIPTION_SUBSTITUTION_PATTERNS : dict
115+ PATTERNS_DESCRIPTION_CLF : dict
123116"""
124117
125- DEFAULT_CLF_TRANSFORM_FILTERERS = []
118+ ROOT_TRANSFORMS_CLF = os .path .normpath (
119+ os .environ .get (
120+ 'OPENCOLORIO_CONFIG_ACES__CLF_TRANSFORMS_ROOT' ,
121+ os .path .join (
122+ os .path .dirname (__file__ ), '..' , 'transforms' , 'builtins' )))
126123"""
127- Default list of *CLF* transform filterers.
124+ *CLF* transforms root directory, default to the version controlled
125+ sub-module repository. It can be defined by setting the
126+ `OPENCOLORIO_CONFIG_ACES__CLF_TRANSFORMS_ROOT` environment variable with
127+ the local 'transforms/clf' directory.
128128
129- DEFAULT_CLF_TRANSFORM_FILTERERS : list
129+ ROOT_TRANSFORMS_CLF : unicode
130130"""
131131
132132
133- def clf_transform_relative_path (path , root_directory = CLF_TRANSFORMS_ROOT ):
133+ def clf_transform_relative_path (path , root_directory = ROOT_TRANSFORMS_CLF ):
134134 """
135135 Helper definition returning the relative path from given *CLF* transform to
136136 *CLF* transforms root directory.
@@ -457,11 +457,11 @@ def _parse(self):
457457
458458 clf_transform_id = self ._clf_transform_id
459459
460- self ._urn , components = clf_transform_id .rsplit (CLF_URN_SEPARATOR , 1 )
461- components = components .split (CLF_ID_SEPARATOR )
460+ self ._urn , components = clf_transform_id .rsplit (SEPARATOR_URN_CLF , 1 )
461+ components = components .split (SEPARATOR_ID_CLF )
462462 self ._type , components = components [0 ], components [1 :]
463463
464- assert self ._urn == CLF_URN , (
464+ assert self ._urn == URN_CLF , (
465465 f'{ self ._clf_transform_id } URN { self ._urn } is invalid!' )
466466
467467 assert len (components ) in (4 , 5 ), (
@@ -475,7 +475,7 @@ def _parse(self):
475475 self ._minor_version_number ,
476476 self ._patch_version_number ) = components
477477
478- assert self ._type in CLF_TYPES , (
478+ assert self ._type in TRANSFORM_TYPES_CLF , (
479479 f'{ self ._clf_transform_id } type { self ._type } is invalid!' )
480480
481481 if self ._name is not None :
@@ -647,7 +647,7 @@ def family(self):
647647 Getter and setter property for the *CLF* transform family, e.g.
648648 *aces*, a value in
649649 :attr:`opencolorio_config_aces.clf.reference.\
650- CLF_TRANSFORM_FAMILIES ` attribute dictionary.
650+ TRANSFORM_FAMILIES_CLF ` attribute dictionary.
651651
652652 Parameters
653653 ----------
@@ -986,7 +986,7 @@ def stem(path):
986986 return clf_transform_pairs
987987
988988
989- def discover_clf_transforms (root_directory = CLF_TRANSFORMS_ROOT ):
989+ def discover_clf_transforms (root_directory = ROOT_TRANSFORMS_CLF ):
990990 """
991991 Discovers the *CLF* transform paths in given root directory: The given
992992 directory is traversed and the `*.clf` files are collected.
@@ -1090,11 +1090,11 @@ def classify_clf_transforms(unclassified_clf_transforms):
10901090 for directory , clf_transforms in unclassified_clf_transforms .items ():
10911091 sub_directory = directory .replace (f'{ root_directory } { os .sep } ' , '' )
10921092 family , * genus = [
1093- CLF_TRANSFORM_FAMILIES .get (part , part )
1093+ TRANSFORM_FAMILIES_CLF .get (part , part )
10941094 for part in sub_directory .split (os .sep )
10951095 ]
10961096
1097- genus = DEFAULT_CLF_TRANSFORM_GENUS if not genus else '/' .join (genus )
1097+ genus = TRANSFORM_GENUS_DEFAULT_CLF if not genus else '/' .join (genus )
10981098
10991099 for basename , pairs in find_clf_transform_pairs (
11001100 clf_transforms ).items ():
@@ -1208,7 +1208,7 @@ def filter_clf_transforms(clf_transforms, filterers=None):
12081208 """
12091209
12101210 if filterers is None :
1211- filterers = DEFAULT_CLF_TRANSFORM_FILTERERS
1211+ filterers = TRANSFORM_FILTERERS_DEFAULT_CLF
12121212
12131213 if isinstance (clf_transforms , Mapping ):
12141214 clf_transforms = unclassify_clf_transforms (clf_transforms )
@@ -1231,7 +1231,7 @@ def print_clf_taxonomy():
12311231
12321232 - The *CLF* transforms are discovered by traversing the directory defined
12331233 by the :attr:`opencolorio_config_aces.clf.\
1234- reference.CLF_TRANSFORMS_ROOT ` attribute using the
1234+ reference.ROOT_TRANSFORMS_CLF ` attribute using the
12351235 :func:`opencolorio_config_aces.discover_clf_transforms` definition.
12361236 - The *CLF* transforms are classified by *family* e.g. *aces*, and
12371237 *genus* e.g. *undefined* using the
0 commit comments