Converting param type to string now in shared file#223
Conversation
Signed-off-by: James Ball <jameball@qti.qualcomm.com>
There was a problem hiding this comment.
Pull request overview
This PR centralizes “parameter/CSR type → display string” rendering into tools/shared_utils.py and updates both the HTML params generator and the AsciiDoc appendix generator to use the shared implementation, with corresponding unit tests and golden-file updates.
Changes:
- Add
infer_param_type_string()totools/shared_utils.pyto format scalar/range/array parameter types for table output. - Replace duplicated type-formatting logic in
tools/create_params.py(HTML tables) andtools/create_param_appendix.py(AsciiDoc output) with the shared helper. - Add unit tests for the new helper and update expected AsciiDoc fixtures to match the new formatting (e.g.,
range ...andN-bit signed/unsigned integer).
Reviewed changes
Copilot reviewed 43 out of 43 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| tools/shared_utils.py | Adds shared infer_param_type_string() formatter. |
| tools/create_params.py | Switches HTML table type rendering to the shared formatter. |
| tools/create_param_appendix.py | Switches AsciiDoc appendix type rendering to the shared formatter. |
| tests/shared_utils/test_shared_utils.py | Adds unit coverage for success + fatal paths of the new formatter. |
| tests/params/expected/test-param-table-variants/test-param-table-reordered/test-ch2/ASIDLEN2.adoc | Updates expected type string formatting. |
| tests/params/expected/test-param-table-variants/test-param-table-reordered/test-ch2/ASIDLEN1.adoc | Updates expected type string formatting. |
| tests/params/expected/test-param-table-variants/test-param-table-reordered/test-ch1/UINT_MXLEN.adoc | Updates expected type string formatting. |
| tests/params/expected/test-param-table-variants/test-param-table-reordered/test-ch1/UINT_1TO100.adoc | Updates expected type string formatting. |
| tests/params/expected/test-param-table-variants/test-param-table-reordered/test-ch1/UINT6.adoc | Updates expected type string formatting. |
| tests/params/expected/test-param-table-variants/test-param-table-reordered/test-ch1/UINT32.adoc | Updates expected type string formatting. |
| tests/params/expected/test-param-table-variants/test-param-table-reordered/test-ch1/INT_MXLEN.adoc | Updates expected type string formatting. |
| tests/params/expected/test-param-table-variants/test-param-table-reordered/test-ch1/INT64.adoc | Updates expected type string formatting. |
| tests/params/expected/test-param-table-variants/test-param-table-reordered/test-ch1/ARRAY_OF_UINT64.adoc | Updates expected type string formatting. |
| tests/params/expected/test-param-table-variants/test-param-table-reordered/test-ch1/ARRAY_OF_UINT5.adoc | Updates expected type string formatting. |
| tests/params/expected/test-param-table-variants/test-param-table-reordered/test-ch1/ARRAY_OF_NEG10TO20.adoc | Updates expected type string formatting. |
| tests/params/expected/test-param-table-variants/test-param-table-reordered/test-ch1/ARRAY_OF_INT32.adoc | Updates expected type string formatting. |
| tests/params/expected/test-param-table-variants/test-param-table-reordered/test-ch1/ALL_BASES.adoc | Updates expected type string formatting. |
| tests/params/expected/test-param-table-variants/test-param-table-full-default/test-ch2/ASIDLEN2.adoc | Updates expected type string formatting. |
| tests/params/expected/test-param-table-variants/test-param-table-full-default/test-ch2/ASIDLEN1.adoc | Updates expected type string formatting. |
| tests/params/expected/test-param-table-variants/test-param-table-full-default/test-ch1/UINT_MXLEN.adoc | Updates expected type string formatting. |
| tests/params/expected/test-param-table-variants/test-param-table-full-default/test-ch1/UINT_1TO100.adoc | Updates expected type string formatting. |
| tests/params/expected/test-param-table-variants/test-param-table-full-default/test-ch1/UINT6.adoc | Updates expected type string formatting. |
| tests/params/expected/test-param-table-variants/test-param-table-full-default/test-ch1/UINT32.adoc | Updates expected type string formatting. |
| tests/params/expected/test-param-table-variants/test-param-table-full-default/test-ch1/INT_MXLEN.adoc | Updates expected type string formatting. |
| tests/params/expected/test-param-table-variants/test-param-table-full-default/test-ch1/INT64.adoc | Updates expected type string formatting. |
| tests/params/expected/test-param-table-variants/test-param-table-full-default/test-ch1/ARRAY_OF_UINT64.adoc | Updates expected type string formatting. |
| tests/params/expected/test-param-table-variants/test-param-table-full-default/test-ch1/ARRAY_OF_UINT5.adoc | Updates expected type string formatting. |
| tests/params/expected/test-param-table-variants/test-param-table-full-default/test-ch1/ARRAY_OF_NEG10TO20.adoc | Updates expected type string formatting. |
| tests/params/expected/test-param-table-variants/test-param-table-full-default/test-ch1/ARRAY_OF_INT32.adoc | Updates expected type string formatting. |
| tests/params/expected/test-param-table-variants/test-param-table-full-default/test-ch1/ALL_BASES.adoc | Updates expected type string formatting. |
| tests/params/expected/test-param-appendix-adoc-includes/test-ch2/ASIDLEN2.adoc | Updates expected type string formatting. |
| tests/params/expected/test-param-appendix-adoc-includes/test-ch2/ASIDLEN1.adoc | Updates expected type string formatting. |
| tests/params/expected/test-param-appendix-adoc-includes/test-ch1/UINT_MXLEN.adoc | Updates expected type string formatting. |
| tests/params/expected/test-param-appendix-adoc-includes/test-ch1/UINT_1TO100.adoc | Updates expected type string formatting. |
| tests/params/expected/test-param-appendix-adoc-includes/test-ch1/UINT6.adoc | Updates expected type string formatting. |
| tests/params/expected/test-param-appendix-adoc-includes/test-ch1/UINT32.adoc | Updates expected type string formatting. |
| tests/params/expected/test-param-appendix-adoc-includes/test-ch1/INT_MXLEN.adoc | Updates expected type string formatting. |
| tests/params/expected/test-param-appendix-adoc-includes/test-ch1/INT64.adoc | Updates expected type string formatting. |
| tests/params/expected/test-param-appendix-adoc-includes/test-ch1/ARRAY_OF_UINT64.adoc | Updates expected type string formatting. |
| tests/params/expected/test-param-appendix-adoc-includes/test-ch1/ARRAY_OF_UINT5.adoc | Updates expected type string formatting. |
| tests/params/expected/test-param-appendix-adoc-includes/test-ch1/ARRAY_OF_NEG10TO20.adoc | Updates expected type string formatting. |
| tests/params/expected/test-param-appendix-adoc-includes/test-ch1/ARRAY_OF_INT32.adoc | Updates expected type string formatting. |
| tests/params/expected/test-param-appendix-adoc-includes/test-ch1/ALL_BASES.adoc | Updates expected type string formatting. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
James Ball (@james-ball-qualcomm) I've opened a new pull request, #224, to work on those changes. Once the pull request is ready, I'll request review from you. |
|
James Ball (@james-ball-qualcomm) I've opened a new pull request, #225, to work on those changes. Once the pull request is ready, I'll request review from you. |
|
James Ball (@james-ball-qualcomm) I've opened a new pull request, #226, to work on those changes. Once the pull request is ready, I'll request review from you. |
No description provided.