JuliaArrays / JuliaArrays/FillArrays.jl

Broadcasting over binary functions

Open
#40 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Julia
Stars
187
Forks
41
Avg merge
17h 29m
Merged PRs (30d)
1

Description

I'm a bit confused by the broadcasting behaviour outlined below. Admittedly, I don't understand the broadcasting machinery, but shouldn't all of these examples (ideally) return Fill objects?

julia> using FillArrays

julia> f(x) = x
f (generic function with 1 method)

julia> g(x, y) = x
g (generic function with 1 method)

julia> f.(Fill(1, 2))   # good
2-element Fill{Int64,1,Tuple{Base.OneTo{Int64}}}:
 1
 1

julia> g.(Fill(1, 2), 3)   # ok
2-element Fill{Int64,1,Tuple{Base.OneTo{Int64}}}:
 1
 1

julia> g.(Fill(1, 2), "a")   # why not a Fill output?
2-element Array{Int64,1}:
 1
 1

julia> g.(Fill(1, 2), Ref(2))
2-element Array{Int64,1}:
 1
 1

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No file or test entry point is named. Start by reproducing the four Julia REPL examples with FillArrays, then trace the broadcasting machinery to compare why the scalar, string, and Ref cases produce Array results; done means the intended cases consistently return Fill objects or the behavior is clearly documented.

Written by the indexing model from the issue text.

Assessment

Tech stack
julia
Domain
data
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.