Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BugFix] Fixing descriptions of inversed NamedTransforms #117

Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions opencolorio_config_aces/config/cg/generate/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ def clf_transform_to_description(
clf_transform,
describe=DescriptionStyle.LONG_UNION,
amf_components=None,
inverse_direction=False,
direction="Forward",
):
"""
Generate the *OpenColorIO* `Colorspace` or `NamedTransform` description for
Expand All @@ -181,9 +181,10 @@ def clf_transform_to_description(
amf_components : mapping, optional
*ACES* *AMF* components used to extend the *ACES* *CTL* transform
description.
inverse_direction : bool, optional
direction : str, optional
Direction of transform -- determines order of transform descriptors.
Default: False (i.e., assume 'Forward' direction)
{"Forward", "Reverse"}
Default: "Forward" (i.e., assume 'Forward' direction)

Returns
-------
Expand All @@ -204,7 +205,7 @@ def clf_transform_to_description(
DescriptionStyle.SHORT_UNION,
):
if clf_transform.description is not None:
if inverse_direction:
if direction == "Forward":
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe if direction.lower() == "forward": so that it becomes case insensitive?

LGTM otherwise and thank you!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated with the case insensitive check.
Let me know of anything else that needs to be addressed!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are good! Thanks a lot @ajymoonILM!

description.append(
f"Convert {clf_transform.output_descriptor} "
f"to {clf_transform.input_descriptor}"
Expand Down Expand Up @@ -409,12 +410,12 @@ def clf_transform_to_named_transform(
if is_reference(clf_transform.source):
signature["inverse_transform"] = file_transform
signature["description"] = clf_transform_to_description(
clf_transform, describe, amf_components, inverse_direction=True
clf_transform, describe, amf_components, direction="Reverse"
)
else:
signature["forward_transform"] = file_transform
signature["description"] = clf_transform_to_description(
clf_transform, describe, amf_components, inverse_direction=False
clf_transform, describe, amf_components, direction="Forward"
)

signature.update(kwargs)
Expand Down