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

Fix parsing bug #328 #341

Closed
wants to merge 6 commits into from
Closed

Conversation

pdeffebach
Copy link
Collaborator

No description provided.

@@ -244,7 +257,8 @@ function get_source_fun(function_expr; exprflags = deepcopy(DEFAULT_FLAGS))
source = args_to_selectors(function_expr.args[2:end])
Copy link
Member

Choose a reason for hiding this comment

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

@pdeffebach get_source_fun is key and complex function. Can we document in e.g. a comment the logic of processing and all cases it considers? Thank you!

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes. One quick question in addition. Is there any scenario where [:x, :y] => ByRow(+) is preferred over [:x, :y] => .+ (assuming parsing works properly).

Currently for non-nested functions, we convert .+ to ByRow(+), and the same for .-, .*, etc.

It seems simpler to just maintain the base broadcasting, unless there are specializations for ByRow that I am missing that make things faster.

Copy link
Member

Choose a reason for hiding this comment

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

ByRow uses map. Normally broadcasting and map should give the same result and have the same performance (the reason is that you always pass vectors to them in your use case). However, in some particular cases there might be some small differences, e.g. a different type of vector can be allocated. Here is an example:

julia> (1:3) .+ (1:3)
2:2:6

julia> map(+, 1:3, 1:3)
3-element Vector{Int64}:
 2
 4
 6

(again - in DataFrames.jl this will not happen as we do not allow ranges, but this shows that there might be slight differences)

@pdeffebach
Copy link
Collaborator Author

Filed an issue in the main Julia repo here.

Once they confirm my intuition is correct I will document and merge.

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.

2 participants