Skip to content
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

Merged
merged 15 commits into from
Jul 19, 2023

Conversation

jose-henriquezroa
Copy link
Contributor

Exposed DataTree function for listing attributes.

@jose-henriquezroa jose-henriquezroa marked this pull request as draft July 12, 2023 12:52
@jose-henriquezroa jose-henriquezroa marked this pull request as ready for review July 12, 2023 12:52
@jose-henriquezroa jose-henriquezroa marked this pull request as draft July 12, 2023 13:01
@jose-henriquezroa jose-henriquezroa marked this pull request as ready for review July 12, 2023 13:01
@codecov
Copy link

codecov bot commented Jul 12, 2023

Codecov Report

Merging #1025 (aececcd) into master (01e38f9) will decrease coverage by 0.12%.
The diff coverage is 100.00%.

@@            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     

@@ -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):
Copy link
Contributor

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?

@jose-henriquezroa jose-henriquezroa marked this pull request as draft July 18, 2023 13:24
@jose-henriquezroa jose-henriquezroa marked this pull request as ready for review July 18, 2023 13:26

def to_dict(self):
"""
Returns a dictionary representation of the DataTree
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the idea!

Suggested change
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):
Copy link
Contributor

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"

@jose-henriquezroa jose-henriquezroa merged commit 99e8b4f into master Jul 19, 2023
@jose-henriquezroa jose-henriquezroa deleted the jhenriqu/data-tree-list-attributes branch July 19, 2023 09:01
@PProfizi PProfizi added the enhancement New feature or request label Aug 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants