-
Notifications
You must be signed in to change notification settings - Fork 2
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 table format for class object output #249
Comments
The class is sufficiently complex that it is probably impossible to express a class or a group of classes as a single table. DMTF does represent a single class as table in html . The DMTF actually presents the class HTML as a group of items described below some of which are tables.. An example is at: See Example
i Method Qualifiers
|
What is clear from this is that it is impossible to represent all of the characteristics of a class as a single simple table. It looks like we would need to present this as multiple tables (qualifiers, properties, methods). Note that we do not need to implement the inherited properties/methods as separate tables but with the table for each type. However, while this works for a single getclass, I am still not sure what we do with enumerate since that would be a series of tables. |
We agreed not to do this in version 0.6.0 but future version beyond that |
I have prototyped this in several ways
The questions are:
DISCUSSION |
We discussed vendoring this tool and will look further into that as an alternative to completing subtabling and creating one table per class (at least) as a table solution. We also discussed how and what we want to support.
|
I'll take on the vendoring part of this issue and have created issue #701 for that. |
Before we start vendoring tabulate, let's work out what is actually missing as of the latest tabulate version 0.8.7. The things I mentioned in tabulate issue 126 seem to be fixable on our user's end (ie without a change to tabulate). |
BTW, note that the current tabulate repo is on GitHub (https://github.com/astanin/python-tabulate), he moved there in 9/2019, so we should not hope for answers from the issue tracker on BitBucket. Also, he released a number of versions from the new repo on GitHub, the last release 0.8.7 was in 3/2020. So it is not that bad actually. He just did not care of moving any issues or PRs forward from BitBucket... and since 4/2020 no PRs were merged or issues commented on. |
Here is a first example, just to demonstrate that we can capture much of the class info as tables. This is organized as multiple tables rather than a single table, only shows a single table and does a terrible job of showing the qualifiers but it does show subtables within tables and most of the components of the class. NOTE: This version was put together just to demonstrate an overall concept and how the pieces could look.
|
Add html to the list of formats that does not really work. It is not really creating the subtable for some reason.
|
module. This is first part of adding the code for issue #249, display classes as tables. Because the new code is going to significantly increase the size of the functions associated with displaying objects as tables, it was logical to move this from _common.py to its own file. Fixes alse one pylint issue by changing code Fixes issue where pylint was reporting possible undefined variable in pick_one_from_list() when the variable was part of a for statement by not using that variable and creating a new variable to represent the same information. In the process we noted that there was no test for the correct pick of last item in the list and confirmation that if the next higher number was picked it treated as invalid a so test was added.
module. This is first part of adding the code for issue #249, display classes as tables. Because the new code is going to significantly increase the size of the functions associated with displaying objects as tables, it was logical to move this from _common.py to its own file. Fixes alse one pylint issue by changing code Fixes issue where pylint was reporting possible undefined variable in pick_one_from_list() when the variable was part of a for statement by not using that variable and creating a new variable to represent the same information. In the process we noted that there was no test for the correct pick of last item in the list and confirmation that if the next higher number was picked it treated as invalid a so test was added.
module. This is first part of adding the code for issue #249, display classes as tables. Because the new code is going to significantly increase the size of the functions associated with displaying objects as tables, it was logical to move this from _common.py to its own file. Fixes alse one pylint issue by changing code Fixes issue where pylint was reporting possible undefined variable in pick_one_from_list() when the variable was part of a for statement by not using that variable and creating a new variable to represent the same information. In the process we noted that there was no test for the correct pick of last item in the list and confirmation that if the next higher number was picked it treated as invalid a so test was added.
module. This is first part of adding the code for issue #249, display classes as tables. Because the new code is going to significantly increase the size of the functions associated with displaying objects as tables, it was logical to move this from _common.py to its own file. Fixes alse one pylint issue by changing code Fixes issue where pylint was reporting possible undefined variable in pick_one_from_list() when the variable was part of a for statement by not using that variable and creating a new variable to represent the same information. In the process we noted that there was no test for the correct pick of last item in the list and confirmation that if the next higher number was picked it treated as invalid a so test was added.
Adds functions to display class(es) as a table.
DISCUSSION: Discuss proposals and try to limit the options |
Details: * In _display_classes_as_table(), replaced the TODO that was in the docstring and thus not reported by Pylint, with a TODO as a comment that references the existing issue #249 for this TODO. Signed-off-by: Andreas Maier <[email protected]>
Details: * In _display_classes_as_table(), replaced the TODO that was in the docstring and thus not reported by Pylint, with a TODO as a comment that references the existing issue #249 for this TODO. Signed-off-by: Andreas Maier <[email protected]>
Moved to V 1.0.0 |
Move forward to 1.4.0 |
DISCUSSION: Looking for ideas here
Today we can output instances and qualifier decls in a table format where the columns are rows but not classes. It might be logical to have a table format for classes.
This could be used to see what properties occur in which classes in a hiearchy.
This has a couple of issues to be resolved:
What would we do with qualifiers since they are a key part of each property and also of the class.
With classes the default value of most properties is Null so it would be an almost empty table. Therefore it might make sense to do something different but I am not sure what yet.
QUESTION: What would goals be for displaying classes in a table format.
Display a single class in something more easily readable on the console than MOF. This could include things like the addition of properties in subclasses, NOTE: From note below that since the class is really fairly complex it will be difficult to do this with a single table, especially on the console.
Display more information on the relations between classes than is in the tree. Note sure this one applies. This could include things like the addition of properties in subclasses, Note that another pr is adding display of the tree-like display of the association relations between classes and instances expanding on the associators and references operations.
Display common or differing characteristics between classes than you can see with things like Enumerate. This could show the changing functionality in a tree of classes, for example.
The text was updated successfully, but these errors were encountered: