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

feat: Stubs and RowGroups now inherit from Sequence #18

Merged
merged 7 commits into from
Oct 27, 2023

Conversation

machow
Copy link
Collaborator

@machow machow commented Oct 26, 2023

This PR fleshes out the Stub and RowGroups classes, so they implement collections.abc.Sequence. This allows them to behave like (immutable) lists.

It also makes RowInfo a dataclass, which simplifies its construction a bit, and lets us do equality checks on them.

See https://docs.python.org/3/library/collections.abc.html for more details.

TODO: I'm going to try scaffolding out a few functions that use these classes to be sure they're working okay!

@machow
Copy link
Collaborator Author

machow commented Oct 26, 2023

@rich-iannone I think this might be ready for you to review! It's a doozy, but I'm trying to shift the classes away from SomeClass([1,2,3])._some_class[1] to being used directly (e.g. SomeClass([1,2,3])[1]).

I tried to implement 3 functions:

  • body_rearrange
  • reorder_stub_df
  • get_row_reorder_df

which required fleshing out 4 classes: Stub, RowGroups, Boxhead, Body

I'm not totally sure exactly what they do, and just tried to follow the R code. So might need to lean on you for testing them 🙈

@machow machow marked this pull request as ready for review October 26, 2023 22:17
Copy link
Member

@rich-iannone rich-iannone left a comment

Choose a reason for hiding this comment

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

Lgtm!

@rich-iannone rich-iannone merged commit ac111ea into main Oct 27, 2023
4 checks passed
@rich-iannone rich-iannone deleted the feat-gt-data-abcs branch October 27, 2023 05:21
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.

2 participants