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

Make InMemoryGroup provide more informative reprs #319

Merged
merged 1 commit into from
Apr 30, 2024

Conversation

peytondmurray
Copy link
Collaborator

This PR makes InMemoryGroup reprs more informative, closing #316.

h5py.Group reprs don't by default show anything about their data hierarchy. This change makes InMemoryGroup reprs show their child objects as part of their repr, making them substantially more useful. For example, in the test written below, repr(premade_group) returns:

<InMemoryGroup "/group" (3 members)>
  <InMemoryArrayDataset "foo": shape (6,), type "<f8">
  <InMemoryArrayDataset "bar": shape (6,), type "<f8">
  <InMemoryArrayDataset "baz": shape (6,), type "<f8">

Later on, we might consider replacing InMemoryDataset.keys() and InMemoryDataset.values(), and InMemoryDataset.items() to return more informative string representations as well.

@peytondmurray peytondmurray requested a review from ArvidJB April 26, 2024 05:13
@peytondmurray peytondmurray merged commit af81316 into deshaw:master Apr 30, 2024
7 checks passed
@peytondmurray peytondmurray deleted the improve-group-repr branch April 30, 2024 21:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant