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

Add char arrays output #43

Merged
merged 6 commits into from
Nov 5, 2024
Merged

Add char arrays output #43

merged 6 commits into from
Nov 5, 2024

Conversation

MelReyCG
Copy link
Contributor

@MelReyCG MelReyCG commented Oct 17, 2024

As geos::string_array type output as int8 array, we cannot really diagnose changing text data in the integrated tests.
As a temporary solution, I propose to add a character comparison output to the current one.

  • The comparison operates on the following characters:
!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ012456789
  • To prevent indentation false-positive, all successive whitespaces are merged as one space before comparison.
  • Other non-printable characters are ignored and considered as string separators, useful to detect if the string_array could have been only reordered.

As an exemple, for my PR about extending the cellBlocks input (which order the cellBlock names alphabetically), we would have this message in the compositionalMultiphaseFlow/deadoil_3ph_staircase_3d_01 test logs:

********************************************************************************
Error: /Problem/domain/MeshBodies/mesh/meshLevels/Level0/ElementRegions/elementRegionsGroup/Channel/cellBlocks/__values__
        Arrays of types int8 and int8 have 148 values of which 11 have differing values.
        Statistics of the differences greater than 0:
                max_index = (99,), max = 2, mean = 1.0909090909090908, std = 0.28747978728803447
********************************************************************************

And this is what I propose:

********************************************************************************
Error: /Problem/domain/MeshBodies/mesh/meshLevels/Level0/ElementRegions/elementRegionsGroup/Channel/cellBlocks/__values__
        Arrays of types int8 and int8 have 148 values of which 11 have differing values.
        Statistics of the differences greater than 0:
                max_index = (99,), max = 2, mean = 1.0909090909090908, std = 0.28747978728803447
        Differing valid characters (substrings reordering detected):
            cb-1_0_0  cb-0_0_0  cb-0_0_1  cb-0_1_1  cb-0_1_2  cb-1_1_2  cb-1_1_3  cb-1_0_3
            cb-0_0_0  cb-0_0_1  cb-0_1_1  cb-0_1_2  cb-1_0_0  cb-1_0_3  cb-1_1_2  cb-1_1_3
               ^             ^       ^           ^     ^ ^ ^       ^ ^         ^       ^  ********************************************************************************

The "substrings reordering detected" note helps the reader to know that the substrings are only reordered.

@CusiniM CusiniM merged commit a88a093 into main Nov 5, 2024
31 checks passed
@MelReyCG MelReyCG deleted the feature/rey/addCharArraysOutput branch November 6, 2024 09:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants