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

Add split offset function v0.6 #2365

Merged
merged 5 commits into from
Apr 26, 2019

Conversation

shayzluf
Copy link
Contributor

@shayzluf shayzluf commented Apr 24, 2019

[Part of] #2307


Add helper function SplitOffset needed for shuffling

includes:
TestSplitOffset_OK
SplitOffset

Write why you are making the changes in this pull request
to comply with 0.6 spec

Write a summary of the changes you are making
changes in:

@shayzluf shayzluf changed the base branch from master to spec-v0.6 April 24, 2019 01:17
Copy link
Member

@terencechain terencechain left a comment

Choose a reason for hiding this comment

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

@shayzluf
Copy link
Contributor Author

shayzluf commented Apr 24, 2019

there is no splitoffset function @terencechain

    """
    Returns a value such that for a list L, chunk count k and index i,
    split(L, k)[i] == L[get_split_offset(len(L), k, i): get_split_offset(len(L), k, i+1)]
    """
    return (list_size * index) // chunks```

@terencechain
Copy link
Member

there is no splitoffset function @terencechain

It's a split function. SplitIndices essentially does the same thing and we only need one, so I'd say delete that and use your SplitOffset or update the name of SplitIndices to SplitOffset. We are not just implementing the new functions we have to replace/fix current ones too : )

@shayzluf
Copy link
Contributor Author

you are right, i thought it was an added function. didn't notice that it changed the old function. its an improvement to the other one. fixing
Thanks

@shayzluf shayzluf force-pushed the update-split-offset-v0.6 branch from 093a81a to 2052184 Compare April 24, 2019 07:07
@terencechain terencechain changed the title add split offset function v0.6 Add split offset function v0.6 Apr 24, 2019
error format change

Co-Authored-By: shayzluf <thezluf@gmail.com>
@codecov
Copy link

codecov bot commented Apr 25, 2019

Codecov Report

Merging #2365 into spec-v0.6 will not change coverage.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           spec-v0.6    #2365   +/-   ##
==========================================
  Coverage      69.16%   69.16%           
==========================================
  Files            119      119           
  Lines           9594     9594           
==========================================
  Hits            6636     6636           
  Misses          2264     2264           
  Partials         694      694

@@ -72,3 +72,20 @@ func TestSplitIndices_OK(t *testing.T) {
}
}
}

func TestSplitOffset_OK(t *testing.T) {
Copy link
Member

Choose a reason for hiding this comment

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

Can you add a test that tests splitoffset only? This test seems to depend on SplitIndicies

Copy link
Member

Choose a reason for hiding this comment

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

addressed here d0e4a47

@nisdas nisdas merged commit 6cdf27c into prysmaticlabs:spec-v0.6 Apr 26, 2019
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.

4 participants