-
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
feat: replace v1 with v2 (preserve-history) #1721
Conversation
Codecov Report
Additional details and impacted files
|
refactor: (remove v1 highlevel) fix filepaths in tests refactor: (remove v1 highlevel) restore kSliceNone constants for typetracer refactor: (remove v1 highlevel) duplicate v1 `is_sized_iterable` refactor: (remove v1 highlevel) remove v1 imports in v1.__init__ refactor: (remove v1 highlevel) replace references to ak._util with ak._v2._util refactor: (remove v1 highlevel) use new v2 `to_list`in ArrayBuilder
refactor: (remove v1 highlevel) remove _v2 from imports in awkward.__init__ refactor: (remove v1 highlevel) merge v2 and v1 __init__ refactor: (remove v1 highlevel) remove "_v2" component from filepaths fix: catch missing changes since rebase refactor: (remove v1 highlevel) replace `awkward._v2` imports with `awkward` fix: drop v2 style: pre-commit fixes chore: use broadcsting from root refactor: (remove v1 highlevel) remove `__init_old__` that somehow escaped deletion refactor: remove v1 test for record refactor: (forth) remove use of NumpyArray in Forth refactor: fix Avro buffer conversion refactor: replace references to ak.layout for new contents/index refactor: remove Python bindings for contents refactor: remove unused includes refactor: remove content_methods refactor: remove content-related methods from `make_LayoutBuilder` refactor: remove content-related methods from `make_ArrayBuilder` refactor: remove `PersistentSharedPtr` refactor: remove `Iterator` bindings refactor: remove Content Python bindings remove tosjon refactor: remove Content / Type refactor: remove Reducer refactor: remove Reducer.h refactor: remove Form wip: remove forms import refactor: remove Identities refactor: remove Slice refactor: remove dlpack refactor: remove Index refactor: use kernel directly in `UnionArrayBuilder` refactor: remove typed kernel accessors refactor: remove unused kernels refactor: drop unused test data refactor: remove startup & kernel-utils refactor: delete startup include refactor: remove `startup` call refactor: remove `kernel_lib` export refactor: use new/malloc with correct free instead of kernel allocator refactor: add `util::array_deleter` refactor: remove cuda-utils refactor: remove unused code in `utils` refactor: remove unused code in `kernel-utils` refactor: fix kernel location refactor: use `to_list` check instead of isinstance in `builder_fromiter` feat: add Python datetime support to `from_iter` feat: enable `implements` feat: enable `__array_function__` fix: rely on `nplike.to_rectilinear` to type check inputs docs: remove references to v1 classes docs: remove unused / broken references refactor: remove unused symbol export fix: undo bad sed feat: add `deprecate` decorator fix: enable warnings chore: remove unused code chore: remove duplicated constant fix: handle `layout.ArrayBuilder` in `ak.type` test: fix and enable `EmptyArray` test fix: change case to handle low-level ArrayBuilder Removed ToJson and its subclasses. Removed the old/unused from-json functions, leaving the new ones intact. Removed the Python-interfaced (i.e. old) LayoutBuilder. Removed ak.layout in favor of getting ArrayBuilder directly from _ext. refactor: remove redundant if chore: remove old comment chore: remove old code chore: remove commented debug code
0c075e1
to
fc1427a
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.
Looks good to me!
Note, I did not go through all deleted tests - I think we can rely on coverage to add more tests if anything is missing.
Please, see a comment inlined. I think, it would be nice to use either long or short form consistently. I think, it can be auto corrected after this PR is merged.
out = ak._v2.index.Index64.empty(0, self._nplike) | ||
return ak._v2.contents.numpyarray.NumpyArray(out, None, None, self._nplike) | ||
out = ak.index.Index64.empty(0, self._nplike) | ||
return ak.contents.numpyarray.NumpyArray(out, None, None, self._nplike) |
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 guess, eventually we want to use ak.contents.NumpyArray
instead of ak.contents.numpyarray.NumpyArray
. The same applies to other *Array
s
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.
Right, that would be a good thing to unify (later). I think we'll be able to take all of the short forms, e.g. ak.contents.NumpyArray
instead of ak.contents.numpyarray.NumpyArray
. The only reason I can think of for the long forms is if there's a cyclic reference and awkward/contents/__init__.py
isn't fully evaluated yet, but that can only happen in module-level references.
I think there's something that I don't understand about Python's (or Python 3's) submodule imports because @henryiii said that it should be possible to make awkward/__init__.py
's imports order-independent. On another occasion, he said something about Vector being limited because Awkward wasn't using relative imports consistently. I think there's a rule I or we need to learn about that, but then it will be a mechanical or semi-mechanical process to apply it.
(This, by the way, might become its own issue; it doesn't affect PR #1721 dropping v1.)
I'm unable to verify that these commits are the same, and I can't find 0c075e1 in this branch. (So I'm okay with closing #1690 and merging this PR into I'd feel a little more secure if there is a https://github.com/scikit-hep/awkward/compare URL that shows the final #1690 commit is equal to one of these commits, and then I can look at the further diffs beyond it that are only here to be certain what happened after that. I just rechecked the last commit of #1690 (6e696b1) and I'm on board up to that point. |
Followed your advice on Slack:
This looks good! You have my approval to merge this into Thanks again! |
So, this PR has git diff 78274500975cd337cb52c551bf39252075d70680 6e696b1f91030ffa6871b638d844fbcd76a9b914 which yields diff --git a/src/awkward/__init__.py b/src/awkward/__init__.py
index 6c98b8af..27df449f 100644
--- a/src/awkward/__init__.py
+++ b/src/awkward/__init__.py
@@ -41,8 +41,8 @@ import awkward.behaviors.mixins
import awkward.behaviors.string
behavior = {}
-awkward.behaviors.string.register(behavior) # noqa: F405
-awkward.behaviors.categorical.register(behavior) # noqa: F405
+awkward.behaviors.string.register(behavior) # noqa: F405 pylint: disable=E0602
+awkward.behaviors.categorical.register(behavior) # noqa: F405 pylint: disable=E0602
# operations
from awkward.operations import * Therefore I'm happy to rebase-and-merge. |
@ianna and @jpivarski, I didn't want to squash and merge #1690 into main, as it would destroy all of the v2 history. Whilst that's less catastrophic than in the case of v1, which has been around for much longer, I would rather keep it. That way, future bugs that are just porting errors will be easier to spot, as the history will inform us of this.
I've just refactored the commits in #1690 so that move operations are preserved. You can confirm that this PR does not change the result with
If you're both happy with my changes in line with your reviews, then feel free to merge (via rebase and merge, or merge commit (NOT squash!))