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: Improve overall code consistency. #5
Conversation
I'm right now working in a parallel branch: https://github.com/colour-science/OpenColorIO-Configs/tree/feature/code_style_rebase and will push back to that one once I have redone all the work. I'm taking a much more grained approach that will make changes easy to review. My comments above still apply though :) |
Here we go, still a lot to do though! |
I've added comments into the various commits but for the most part, they are pretty minor suggestions. Overall, this is a huge improvement. Thank you! |
PR: Improve overall code consistency.
This PR is NOT ready to merge but more a draft and discussion support as I was trying to improve consistency in the naming of the code objects:
Names Meaning
There is a mix of
create_*
andgenerate_*
definitions. For consistency I think it would be probably a good idea to have the create prefixes associated with any object creation within the code and generate with anything that produce a file as a result.Names Case
This is where the big chunk of work is for me, taking a look at a the most important cherry picked definitions and their arguments:
ACES_AP1_TO_AP0
ACES_AP0_TO_AP1
ACES_AP0_TO_XYZ
ACES_XYZ_TO_AP0
create_ACES
create_ACEScc
create_ACESproxy
create_ACEScg
create_ADX
create_generic_log
create_Dolby_PQ
-aces_CTL_directory
-lut_directory
-lut_resolution_1d
-cleanup
-name
-aliases
-min_value
-max_value
-input_scale
create_Dolby_PQ_scaled
create_ACES_LMT
create_LMTs
create_ACES_RRT_plus_ODT
create_ODTs
get_transform_info
get_ODTs_info
get_LMTs_info
create_colorspaces
There is a huge margin for improvement, for example we have mix of:
PEP 8 recommend having everything lower cased, it would remove any consistency problems however I quite like having definitions such as
create_ACESproxy
instead ofcreate_aces_proxy
. We do use upper cased often inColour
without it being an issue provided it is consistent. Maybe what we can do for now it allow upper case in definitions names, and use lower cased arguments.Which leads me to a question regarding parameters for the command line binaries, we should have better naming consistency there too:
Is it also maybe worth dropping the camel cased names for something along those lines, which is probably more usual in command line tools: