Introduce optional sort option field for output control#11523
Introduce optional sort option field for output control#11523joseph-robertson wants to merge 5 commits intodevelopfrom
Conversation
| \key Yes | ||
| \key No | ||
| \default Yes | ||
| A4; \field Sort Option |
There was a problem hiding this comment.
Field name and keys borrowed from Output:VariableDictionary.
| int colsBody) | ||
| { | ||
| int index = 0; | ||
| auto it = std::find(std::begin(columnLabels), std::end(columnLabels), "Name"); |
There was a problem hiding this comment.
There are probably other column names we'd want to sort on (and not just "Name"). Not sure how to handle this.
There was a problem hiding this comment.
Many times, the first column that you would want to sort on doesn't have a column heading at all (almost all predefined tables).
Monthly tables probably should not be sorted.
Tables that have statistics (sum, average, min, or max) as the last rows should probably keep them as the last rows and not intermingle them (like monthly tables).
The Initialization Summary has all the tables with a row count in the first column, so that they are in the same order as the EIO file, but sometimes the second column is the zone name or the object name, so maybe they should be sorted by the second column.
Overall, this is a good idea, but complicated with a lot of cases to consider.
Maybe the approach is that for each predefined table, a column that would make sense to sort on is optionally defined. If it is not defined, then maybe just the first column is used.
There was a problem hiding this comment.
Thanks @JasonGlazer, this is very useful information. And agreed that this gets complicated with a lot of cases to consider.
| } | ||
|
|
||
| if (currentStyle.produceTabular) { | ||
| if (tableName == "ScheduleTypeLimits") { |
There was a problem hiding this comment.
(Just testing on this table for right now.)
| } | ||
| WriteSubtitle(state, tableName); | ||
| std::string footnote; | ||
| WriteTable(state, tableBody, rowHead, columnHead, columnWidth, false, footnote); |
There was a problem hiding this comment.
We could probably move the sort to within WriteTable, but putting it here may give more control (the table name isn't passed into WriteTable).
| HTML, !- Column Separator | ||
| , !- Unit Conversion | ||
| , !- Format Numeric Values | ||
| Name; !- Sort Option |
There was a problem hiding this comment.
We could introduce similar field for Output:JSON and Output:SQLite? I'm not totally sure how these three objects are all related.
There was a problem hiding this comment.
For Output:JSON it would be good to have something similar. I'm not so sure if SQLite.
Pull request overview
Description of the purpose of this PR
Pull Request Author
Reviewer