JuliaArrays / JuliaArrays/FillArrays.jl

Broadcasting style for FillArrays?

Open
#188 3 comments 1 reaction 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

Perhaps we need a broadcasting rule for FillArrays that takes precedence over Broadcast.DefaultArrayStyle{0}. Currently, we obtain the somewhat unsatisfactory

julia> x = Fill(2, 10)
10-element Fill{Int64}, with entries equal to 2

julia> 2 * x * 3
10-element Fill{Int64}, with entries equal to 12

julia> 2 .* x .* 3
10-element Fill{Int64}, with entries equal to 12

julia> @. 2 * x * 3
10-element Vector{Int64}:
 12
 12
 12
 12
 12
 12
 12
 12
 12
 12

This may be resolved by defining a custom broadcast style.

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

Reproduce the Julia REPL examples in the issue, especially @. 2 * x * 3 with x = Fill(2, 10). Investigate FillArrays' broadcasting behavior and the proposed custom broadcast style; done means the broadcasted expression preserves the appropriate FillArrays result rather than producing a Vector, with tests covering the shown cases.

Written by the indexing model from the issue text.

Assessment

Tech stack
julia
Domain
data
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.