-
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
C++ refactoring: Implemented the type tracer for Awkward-Dask. #1110
Conversation
This is what the latest commit does. Given a concrete array, >>> typetracer = ak._typetracer.TypeTracer.instance()
>>> concrete = ak._v2.contents.NumpyArray(np.arange(2*3*5).reshape(2, 3, 5) * 0.1)
>>> concrete
<NumpyArray dtype='float64' shape='(2, 3, 5)'>
[[[0. 0.1 0.2 0.3 0.4]
[0.5 0.6 0.7 0.8 0.9]
...
[2. 2.1 2.2 2.3 2.4]
[2.5 2.6 2.7 2.8 2.9]]]
</NumpyArray> we can now make abstract arrays that know their >>> abstract = ak._v2.contents.NumpyArray(concrete.to(typetracer))
>>> abstract
<NumpyArray dtype='float64' shape='(2...2, 3, 5)'>[?? ... ??]</NumpyArray>
>>> abstract[0]
<NumpyArray dtype='float64' shape='(3...3, 5)'>[?? ... ??]</NumpyArray>
>>> abstract[0][0]
<NumpyArray dtype='float64' len='5...5'>[?? ... ??]</NumpyArray>
>>> abstract[0][0][0]
0.0 The scalar output ( |
… was wrong, and subsequently the reducer implementation.
@ioanaif @ianna @stormiestsin I'll be merging this soon: it has a lot of little diffs throughout the tests to verify that every v2 test we've ever written preserves type information when passed through with TypeTracerArrays (arrays with no concrete values, going through the code just to see how the Form changes). There have also been a few changes to the code to make it work, and I noticed a few tests hadn't been enabled (commented out or still testing v1, rather than v2). I've turned the latter into Let me know if there are any issues with merging this PR (i.e. you're working on something that would have a substantial diff with this branch). Thanks! |
Hi Jim, I went through the tests that I wrote earlier. For the There is one case, where checking for Everything else in the tests look great! I am not working on anything at the moment, so you can merge it if others don't have an issue. |
It's not exactly the All of the implementations looked fine, but some of the tests hadn't been running. I got a few of them running, adding code where necessary, but others have been left as skipped tests. |
No description provided.