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

PR: Implement Support for Executing CLF Workflows #1310

Draft
wants to merge 11 commits into
base: develop
Choose a base branch
from

Conversation

MichaelMauderer
Copy link
Member

Summary

Add support for executing CLF workflows defined as per https://docs.acescentral.com/specifications/clf/#common-lut-format-clf-a-common-file-format-for-look-up-tables

Closes #636

TODO

  • Extend documentation
  • Add tests for more complex workflows
  • Add better error handling for invalid inputs
  • Create a release of the CLF IO package and update the pyproject.tomlto use that instead of directly referring to the repo.

Preflight

Code Style and Quality

  • Unit tests have been implemented and passed.
  • Pyright static checking has been run and passed.
  • Pre-commit hooks have been run and passed.
  • New transformations have been added to the Automatic Colour Conversion Graph.
  • New transformations have been exported to the relevant namespaces, e.g. colour, colour.models.

Documentation

  • New features are documented along with examples if relevant.
  • The documentation is Sphinx and numpydoc compliant.

@MichaelMauderer MichaelMauderer self-assigned this Nov 7, 2024
@KelSolaar KelSolaar changed the title Implement Support for Executing CLF Workflows PR: Implement Support for Executing CLF Workflows Nov 13, 2024
Copy link
Member

@KelSolaar KelSolaar left a comment

Choose a reason for hiding this comment

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

Thanks Michael for the work! This is just a first batch of important notes WRT to the implementation, core idea is that we try as much as possible to use our existing code.

@@ -49,8 +49,12 @@ dependencies = [
"numpy>=1.24,<3",
"scipy>=1.10,<2",
"typing-extensions>=4,<5",
"colour-clf-io"
Copy link
Member

Choose a reason for hiding this comment

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

Major

This should be an optional dependency as we do not want to hard-depend on CLF.

We will thus need a new requirement entry and callable here: https://github.com/colour-science/colour/blob/develop/colour/utilities/requirements.py

We will also want to track its version in colour.utilities.describe_environment

]

[tool.uv.sources]
colour-clf-io = {git = 'https://github.com/colour-science/colour-clf-io.git'}
Copy link
Member

Choose a reason for hiding this comment

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

Minor

This is fine for now but we will need to release it on Pypi.


import numpy.typing as npt
from colour_clf_io import ExponentStyle
from colour_clf_io.values import Channel
Copy link
Member

Choose a reason for hiding this comment

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

Minor

Do you have the precommit hooks running, it looks like isort is not really running.

FLT_MIN = 1.175494e-38


def apply_log_internal(value: NDArrayFloat, params, extra_args) -> NDArrayFloat:
Copy link
Member

Choose a reason for hiding this comment

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

Major

We wrote the functions for this during GSoc, let's please use those:

def logarithmic_function_basic(
,
def logarithmic_function_quasilog(
and
def logarithmic_function_camera(



def apply_exponent_internal(
value: NDArrayFloat, params: clf.ExponentParams, extra_args
Copy link
Member

Choose a reason for hiding this comment

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

Major

We also wrote the functions for this during GSoc, let's please use those:

def exponent_function_basic(
and
def exponent_function_monitor_curve(



def asc_cdl_luma(value):
R, G, B = tsplit(value)
Copy link
Member

Choose a reason for hiding this comment

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

Minor

We should be able to do something along the line of np.sum(weights * value, axis=-1) to avoid the tsplit.

return result


def apply(
Copy link
Member

Choose a reason for hiding this comment

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

Major

We should try to use colour.io.LUTSequence here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement support for Common LUT Format (CLF).
2 participants