JuliaArrays / JuliaArrays/FillArrays.jl

Unary broadcasting `identity.(a)` and `ComplexF64.(a)` don't preserve `Ones` and `Zeros`

Open
#416 4 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

For example:

julia> identity.(Zeros(2))
2-element Fill{Float64}, with entries equal to 0.0

julia> identity.(Ones(2))
2-element Fill{Float64}, with entries equal to 1.0

julia> ComplexF64.(Zeros(2))
2-element Fill{ComplexF64}, with entries equal to 0.0 + 0.0im

julia> ComplexF64.(Ones(2))
2-element Fill{ComplexF64}, with entries equal to 1.0 + 0.0im

julia> complex.(Zeros(2))
2-element Fill{ComplexF64}, with entries equal to 0.0 + 0.0im

julia> complex.(Ones(2))
2-element Fill{ComplexF64}, with entries equal to 1.0 + 0.0im

julia> pkgversion(FillArrays)
v"1.13.0"

julia> versioninfo()
Julia Version 1.11.6
Commit 9615af0f269 (2025-07-09 12:58 UTC)
Build Info:
  Official https://julialang.org/ release
Platform Info:
  OS: macOS (arm64-apple-darwin24.0.0)
  CPU: 10 × Apple M1 Max
  WORD_SIZE: 64
  LLVM: libLLVM-16.0.6 (ORCJIT, apple-m1)
Threads: 1 default, 0 interactive, 1 GC (on 8 virtual cores)
Environment:
  JULIA_EDITOR = code

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

Run the Julia REPL examples from the issue with FillArrays v1.13.0 and confirm the displayed results for identity., ComplexF64.(), and complex.(). Then trace the unary broadcasting implementation used by Ones and Zeros; done means these calls preserve the appropriate filled-array representation and values.

Written by the indexing model from the issue text.

Assessment

Tech stack
julia
Domain
data
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.