-
Notifications
You must be signed in to change notification settings - Fork 89
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
refactor: split ak._do
into meta
and content
#2852
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files
|
1313cbe
to
c14a473
Compare
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 see that this splits the ak._do
module into two submodules for Content
and the superclasses of both Content
classes and Form
classes.
Meta
replaces the TypeVar T
in many places; I suppose that's because T
used to represent a Content
or a Form
, which had no common superclass, and now it can all be OOP-style, rather than template-style.
The merge* functions have moved. That's fine.
On the whole, there's a lot of differences, but it seems to be just (1) moving things and (2) merging the Content
and Form
hierarchies. Does this PR complete the merging of those hierarchies, or is there another after this?
Also, what will the hierarchy look like after merging is complete? Is it like this?
flowchart LR
C(Content)
F(Form)
M(Meta)
ListArray --> C
NumpyArray --> C
ListForm --> F
NumpyForm --> F
ListMeta --> M
NumpyMeta --> M
ListArray --> ListMeta
NumpyArray --> NumpyMeta
ListForm --> ListMeta
NumpyForm --> NumpyMeta
The |
Yes, I think so. We may be able to promote some Content functions to Meta, but on balance I think its complete. |
47290e1
to
7d62858
Compare
This PR:
Content._mergeable_next
andak._do.mergeable
intoMeta._mergeable_next
andak._do.meta.mergeable
.dtype
toNumpyMeta
Generic
in type hints forMeta
classes(3) is required because of the lack of higher-kinded types. This means that our type hints will only let us prove that
NumpyArray
is aNumpyMeta
in some contexts, e.g. viaak._meta.meta.is_numpy()