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 cell.above to refer to previous row value #295

Merged
merged 8 commits into from
Apr 2, 2019

Conversation

MykolaGolubyev
Copy link
Member

@MykolaGolubyev MykolaGolubyev commented Mar 31, 2019

Initial functionality to allow the following.

["Col A" | "Col B" | "Col C"] {
__________________________________________
   "v1a" |   "v1b" | 10
   "v2a" |   "v2b" | cell.above
   "v2a" |   "v2b" | cell.above + 10 }

It is not feature complete yet but want us to settle on names and approach.
Most likely __ shortcut will be added to mean the same as cell.above

# Conflicts:
#	webtau-core/src/main/java/com/twosigma/webtau/Ddjt.java
#	webtau-core/src/test/groovy/com/twosigma/webtau/data/table/TableDataTest.groovy
Copy link
Collaborator

@tsiq-karold tsiq-karold left a comment

Choose a reason for hiding this comment

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

Should also rename the PR as it's not cell.value.

["Col A" | "Col B" | "Col C"] {
__________________________________________
"v1a" | "v1b" | 10
"v2a" | "v2b" | cell.previous
Copy link
Collaborator

Choose a reason for hiding this comment

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

How about cell.above? Or row.previous? I'm slightly concerned that cell.previous makes it ambiguous whether it means previous row or column.

Copy link
Member Author

Choose a reason for hiding this comment

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

I like row.previous. Wanted to have all the generator functions under one namespace. There is cell.value(lambda) and cell.previous, maybe more to come. but maybe it is ok.

Copy link
Member Author

Choose a reason for hiding this comment

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

cell.above is growing on me.

Copy link
Member Author

Choose a reason for hiding this comment

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

renamed


public RecordFromStream(Stream<Object> valuesStream) {
values = new ArrayList<>();
Iterator<Object> it = valuesStream.iterator();
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why not use valueStream.forEach instead of using the iterator manually?

Copy link
Member Author

Choose a reason for hiding this comment

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

Will it require some manipulation with index wrapping that needs to be defined outside?

Copy link
Member Author

Choose a reason for hiding this comment

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

OH nevermind, there is no more idx manipulation.


import com.twosigma.webtau.data.table.Record;

public interface TableDataCellValueGenOnlyRecordFunction<R> {
Copy link
Collaborator

Choose a reason for hiding this comment

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

That is quite an interface name...

Copy link
Member Author

Choose a reason for hiding this comment

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

Agree, happy to rename :( It is two parts name, last being OnlyRecordFunction

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yeah, I have no suggestions :) was just commenting on how long it was.

@MykolaGolubyev MykolaGolubyev changed the title add cell.value to refer to previous row value add cell.previous to refer to previous row value Apr 1, 2019
@MykolaGolubyev MykolaGolubyev changed the title add cell.previous to refer to previous row value add cell.above to refer to previous row value Apr 1, 2019
@tsiq-clemens
Copy link
Collaborator

TBD: what's the definition of "cell.above" if the written value is a permute() function?
From a user's perspective, you'd repeat the permute() instruction. Under the hood it's more complicated.

@MykolaGolubyev
Copy link
Member Author

#297 to continue with validation of cell.above + permute.

@MykolaGolubyev MykolaGolubyev merged commit 1a94257 into master Apr 2, 2019
@MykolaGolubyev MykolaGolubyev deleted the core/table-previous-value branch April 2, 2019 20:50
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.

None yet

3 participants