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

Adding support for commas in active views list #26

Merged
merged 9 commits into from
Dec 13, 2024

Conversation

larochj
Copy link
Collaborator

@larochj larochj commented Dec 10, 2024

Added a set/get/clear/remove for the active views and displays.
Made changes to the YAML save to avoid repeating the parsing of the string list.

@larochj larochj requested a review from doug-walker December 10, 2024 22:43
Copy link

@doug-walker doug-walker left a comment

Choose a reason for hiding this comment

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

Thanks for adding this Jonathan, I think it will be very helpful for OCIO!

Please add unit tests in tests/cpu/ParseUtils_tests.cpp. This should include the various edge cases, including unmatched quotes.

src/OpenColorIO/ParseUtils.cpp Outdated Show resolved Hide resolved
src/OpenColorIO/ParseUtils.cpp Outdated Show resolved Hide resolved
src/OpenColorIO/OCIOYaml.cpp Show resolved Hide resolved
src/OpenColorIO/ParseUtils.cpp Show resolved Hide resolved
src/OpenColorIO/Config.cpp Show resolved Hide resolved
src/OpenColorIO/Config.cpp Outdated Show resolved Hide resolved
src/OpenColorIO/Config.cpp Outdated Show resolved Hide resolved
src/OpenColorIO/Config.cpp Show resolved Hide resolved
@larochj larochj force-pushed the larochj/set-active-views-commas branch 2 times, most recently from a3dd78e to d53c452 Compare December 12, 2024 00:23
@larochj larochj requested a review from doug-walker December 12, 2024 00:32
-Adding test cases and some parsing fixes
-Fix for join
-Fix for bug in split string and move order of functions
@larochj larochj force-pushed the larochj/set-active-views-commas branch from d53c452 to 6c41780 Compare December 12, 2024 00:32
added a test case for SplitStringEnvStyle and JoinStringEnvStyle.
src/OpenColorIO/LookParse.cpp Outdated Show resolved Hide resolved
src/OpenColorIO/Config.cpp Show resolved Hide resolved
src/OpenColorIO/OCIOYaml.cpp Show resolved Hide resolved
tests/cpu/ParseUtils_tests.cpp Outdated Show resolved Hide resolved
src/OpenColorIO/ParseUtils.cpp Show resolved Hide resolved
src/OpenColorIO/ParseUtils.cpp Outdated Show resolved Hide resolved
outputvec.clear();

outputvec = { "This", "is \": a: test" };
OCIO_CHECK_EQUAL( "This, \"is \": a: test\"", OCIO::JoinStringEnvStyle(outputvec) );

Choose a reason for hiding this comment

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

Please add more tests that use commas and quotes, such as:
outputvec = { "This", "is: ", ""a very good,"", " fine, helpful, and useful ", "test" };

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Added this test case and another one

Choose a reason for hiding this comment

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

Actually, please make the first word ""This"", to test that quotes are omitted when they aren't necessary.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Join would not remove the quotes in this case, but it would not add another around a string that is already surrounded by quotes. I would expect split to remove the quotes (not join).

I changed two test case to touch what I just described.

src/OpenColorIO/Config.cpp Outdated Show resolved Hide resolved
src/OpenColorIO/Config.cpp Show resolved Hide resolved
@larochj larochj force-pushed the larochj/set-active-views-commas branch from 07e0c57 to dcbd876 Compare December 12, 2024 16:05
outputvec.clear();

outputvec = { "This", "is \": a: test" };
OCIO_CHECK_EQUAL( "This, \"is \": a: test\"", OCIO::JoinStringEnvStyle(outputvec) );

Choose a reason for hiding this comment

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

Actually, please make the first word ""This"", to test that quotes are omitted when they aren't necessary.

tests/cpu/ParseUtils_tests.cpp Show resolved Hide resolved
src/OpenColorIO/ParseUtils.cpp Outdated Show resolved Hide resolved
src/OpenColorIO/LookParse.cpp Outdated Show resolved Hide resolved
@larochj larochj force-pushed the larochj/set-active-views-commas branch from 5b0fcc7 to 6df1d60 Compare December 13, 2024 05:11
@larochj larochj requested a review from doug-walker December 13, 2024 05:28
Copy link

@doug-walker doug-walker left a comment

Choose a reason for hiding this comment

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

If you're able to fix the Windows CI failure, that would be great. Otherwise, go ahead and merge and I will fix it before submitting to OCIO.

Don't worry about the other CI failures. I need to pull over the latest Actions workflow from OCIO main to get that working again on our branch.

@larochj larochj force-pushed the larochj/set-active-views-commas branch from 8f9854d to 659b7b3 Compare December 13, 2024 14:26
@larochj larochj force-pushed the larochj/set-active-views-commas branch from 659b7b3 to 8e37809 Compare December 13, 2024 14:35
@larochj larochj merged commit da5a4bf into flame_ocio_features2 Dec 13, 2024
12 of 29 checks passed
@larochj larochj deleted the larochj/set-active-views-commas branch December 13, 2024 15:00
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.

2 participants