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

refactor: rename ak.nplikeak.nplikes & nplikes.ofnplikes.nplike_of #1744

Merged
merged 3 commits into from
Sep 28, 2022

Conversation

agoose77
Copy link
Collaborator

@agoose77 agoose77 commented Sep 28, 2022

Changes

  1. Rename ak.nplike to ak.nplikes
  2. Rename ak.nplikes.of to ak.nplikes.nplike_of

Motivation

In type-hinting situations, it would give us more flexability to be able to import ak.nplikes as nplikes. Currently, the nplike module name would clash with local-scoped nplike variables. This is easy to work around - just use from awkward import nplike as nplikes, however we'll be doing that a lot, so let's just clean this up now.

Furthermore, should we wish to import nplike.of as a free-standing function, the same applies. nplike_for is a more descriptive name than nplike.of, even though the latter is pretty snazzy.

Closes #1741

@agoose77 agoose77 force-pushed the agoose77/refactor-rename-nplike branch from ddf1464 to 4b9c8ac Compare September 28, 2022 10:25
@codecov
Copy link

codecov bot commented Sep 28, 2022

Codecov Report

Merging #1744 (86a76d2) into main (084fa4b) will not change coverage.
The diff coverage is 93.64%.

Additional details and impacted files
Impacted Files Coverage Δ
src/awkward/_connect/jax/__init__.py 90.47% <ø> (ø)
src/awkward/_connect/rdataframe/from_rdataframe.py 0.00% <0.00%> (ø)
src/awkward/operations/ak_from_parquet.py 88.72% <0.00%> (ø)
src/awkward/nplikes.py 66.00% <33.33%> (ø)
src/awkward/contents/unionarray.py 86.32% <75.00%> (ø)
src/awkward/operations/ak_backend.py 66.66% <75.00%> (ø)
src/awkward/contents/numpyarray.py 90.09% <77.77%> (ø)
src/awkward/_connect/numpy.py 65.42% <80.00%> (ø)
src/awkward/operations/ak_to_categorical.py 90.90% <83.33%> (ø)
src/awkward/behaviors/string.py 75.86% <88.88%> (ø)
... and 111 more

@agoose77 agoose77 changed the title refactor: rename ak.nplike to ak.nplikes refactor: rename ak.nplikeak.nplikes & nplikes.ofnplikes.nplike_for Sep 28, 2022
Copy link
Member

@jpivarski jpivarski left a comment

Choose a reason for hiding this comment

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

Great! (Although now it occurred to me that we have behavior_of and maybe a few other of's, while this is nplike_for, but...

Ah, heck. I'll just change it to nplike_of.)

I'll let you counter-approve by not setting this to merge, but merge it if you agree about nplike_fornplike_of.

@agoose77 agoose77 changed the title refactor: rename ak.nplikeak.nplikes & nplikes.ofnplikes.nplike_for refactor: rename ak.nplikeak.nplikes & nplikes.ofnplikes.nplike_of Sep 28, 2022
@agoose77 agoose77 merged commit 4f9ecd9 into main Sep 28, 2022
@agoose77 agoose77 deleted the agoose77/refactor-rename-nplike branch September 28, 2022 19:34
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.

Rename ak.nplike into ak.nplikes
2 participants