Fix h5ls issue with quoting when displaying integer data as ASCII characters - #6553
Conversation
bcbfa6c to
c17486f
Compare
|
What's the issue number for this PR? |
|
|
||
| ## Tools | ||
|
|
||
| ### Fixed an issue with quoting of data values in h5ls and h5dump when displaying as ASCII characters |
There was a problem hiding this comment.
quoting of data values -> data value quoting
There was a problem hiding this comment.
I find the former better to read since the issue was with quoting and not "data value XXX"
|
|
||
| When using the `-s` (h5ls) or `-r` (h5dump) option to display 1-byte integer datasets and | ||
| attributes as ASCII characters, a closing double-quote character for data values was being | ||
| dropped in some cases. This double-quote character has been restored and similar formatting |
There was a problem hiding this comment.
has been restored and similar -> has been restored, and similar
There was a problem hiding this comment.
This is at best a preference
| attributes as ASCII characters, a closing double-quote character for data values was being | ||
| dropped in some cases. This double-quote character has been restored and similar formatting | ||
| issues have been fixed for cases where elements are wrapped to new lines according to the | ||
| particular tool's column limit setting. |
There was a problem hiding this comment.
Particular here is to distinguish between h5ls and h5dump, as each tool has its own column limit setting
No issue currently, as the problem was reported external to GitHub |
| status = h5tools_dump_mem(stream, &string_dataformat, &datactx, obj_id); | ||
| } | ||
| } | ||
| if (datactx.display_char && H5Tget_size(f_type) == 1 && H5Tget_class(f_type) == H5T_INTEGER) { |
There was a problem hiding this comment.
This logic was added so that h5dump adds the closing quote character when displaying the data as ASCII characters, but it goes against the general tools architecture and complicates the logic. The fix that follows the tools architecture, allowing h5tools_simple_prefix() to print the closing quote character, is below.
| } | ||
|
|
||
| /* Output closing line suffix character when printing 1-byte integer data as ASCII */ | ||
| if (info->ascii) { |
There was a problem hiding this comment.
Since h5ls doesn't use the h5tools_dump_data() function from the tools library, it needs its own specific logic to cover this case.
| issues have been fixed for cases where elements are wrapped to new lines according to the | ||
| particular tool's column limit setting. | ||
| attributes as ASCII characters, a closing double-quote character for data values was dropped | ||
| in some cases. This double-quote character has been restored and similar formatting issues |
There was a problem hiding this comment.
Add comma. has been restored and similar -> has been restored, and similar
d6a201a to
4223d69
Compare
|
Fixed the conflict in CHANGELOG.md |
lrknox
left a comment
There was a problem hiding this comment.
It appears you've considered previous suggestions for the CHANGELOG.md entry. Most CHANGELOG.md entries are a single line for the description part of the entry; you might consider changing that, or it can be done later if necessary.
I applied a few of the suggestions, but don't particularly agree with the remaining ones so left them alone. |
When using the
-roption to haveh5dumpdisplay 1-byte integer datasets and attributes as ASCII characters, the data display logic includes a section that deals with including a closing double-quote character for the data values. This logic wasn't carried over toh5lsfor its similar-soption, causing it to drop the closing double-quote:h5ls -ds testchar.h5 dset Dataset {81} Data: "abcdefghijklmnopqrstuvwxyz0123456789abcdefghijklmnopqrstuvwxyz012345678901234567\000These changes restore the double-quote for
h5lsand refactor the logic forh5dumpto fix some other similar formatting issues when data elements are wrapped to new lines according to the tool's column limit setting.