-
Notifications
You must be signed in to change notification settings - Fork 25
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 data-tree list-attributes #1025
add data-tree list-attributes #1025
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1025 +/- ##
==========================================
- Coverage 88.55% 88.44% -0.12%
==========================================
Files 78 78
Lines 8869 8887 +18
==========================================
+ Hits 7854 7860 +6
- Misses 1015 1027 +12 |
src/ansys/dpf/core/data_tree.py
Outdated
@@ -482,6 +482,16 @@ def get_as(self, name, type_to_return=types.string): | |||
out = DataTree(data_tree=obj, server=self._server) | |||
return out | |||
|
|||
def get_attributes(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jose-henriquezroa could you please add a dosctring and in this docstring precise whether sub attributes are returned or not (whether this function is recursive basically?))
To comply with our other python classes I would make this function a property instead, what do you think?
|
||
def to_dict(self): | ||
""" | ||
Returns a dictionary representation of the DataTree |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the idea!
Returns a dictionary representation of the DataTree | |
Returns a read only dictionary representation of the DataTree |
|
||
return coll_obj.get_integral_entries() | ||
|
||
def get_sub_tree_names(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we use properties here please to be consistent with other classes, ie: "attribute_name", "sub_stree_names"
Exposed DataTree function for listing attributes.