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

Closes #1783 - SegArray.__getitem__ to Server #1790

Merged
merged 6 commits into from
Sep 22, 2022

Conversation

Ethan-DeBandi99
Copy link
Contributor

Closes #1783
Closes #1708

  • Move SegArray indexing to the server and updates __getitem__ to use server messages for indexing. The majority of the indexing logic was modeled from SegString.
  • Moves OutOfBoundsError to ServerErrors.chpl because 2 modules are not utilizing this
  • Updates SegArray creation response messages to be formatted as JSON. These messages also now return the create statements for the values, segments, and lengths pdarray components so that subsequent server calls are not required for access.
  • Adds ak.SegArray.from_parts. This operates as the __init__ previously did. The __init__ method has been updated to build SegArray from the response message components. This was modeled after SegmentedStrings client side code.
  • Adds ak.segarray method to ease the transition to this update for users. This is an alias to ak.SegArray.from_parts but the syntax resembles the creation of pdarrays via ak.array and only requires case changes in existing code.

arkouda/segarray.py Outdated Show resolved Hide resolved
arkouda/segarray.py Outdated Show resolved Hide resolved
arkouda/segarray.py Outdated Show resolved Hide resolved
if len(d) != 1:
raise ValueError("All columns must have same dtype")
dtype = d.pop()
newsegs = arange(size) * n
Copy link
Member

Choose a reason for hiding this comment

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

for the pdarray case is every element of the pdarray its own segment?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No the pdarray indicates when segments to access. For example, ak.array([1,3]) would return a SegArray containing segments 1 and 3 of the original.

arkouda/segarray.py Outdated Show resolved Hide resolved
src/SegmentedArray.chpl Outdated Show resolved Hide resolved
src/SegmentedArray.chpl Outdated Show resolved Hide resolved
src/SegmentedArray.chpl Outdated Show resolved Hide resolved
src/SegmentedArray.chpl Outdated Show resolved Hide resolved
src/SegmentedMsg.chpl Show resolved Hide resolved
Copy link
Member

@stress-tess stress-tess left a comment

Choose a reason for hiding this comment

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

This seems good to me!

@stress-tess stress-tess merged commit 2045093 into Bears-R-Us:master Sep 22, 2022
@Ethan-DeBandi99 Ethan-DeBandi99 deleted the 1783_segarray_getitem branch September 23, 2022 13:26
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.

SegArray.__getitem__ to Server SegArray JSON Return Formatting
3 participants