Skip to content

improve error when broadcast failed due to axistype#45922

Merged
IanButterworth merged 5 commits into
JuliaLang:masterfrom
Moelf:helpful_error_broadcast_mix_axis
Feb 5, 2024
Merged

improve error when broadcast failed due to axistype#45922
IanButterworth merged 5 commits into
JuliaLang:masterfrom
Moelf:helpful_error_broadcast_mix_axis

Conversation

@Moelf
Copy link
Copy Markdown
Contributor

@Moelf Moelf commented Jul 4, 2022

fix #45921

Comment thread base/broadcast.jl Outdated
Comment thread base/broadcast.jl Outdated
@Moelf Moelf force-pushed the helpful_error_broadcast_mix_axis branch from e83bce1 to 4110374 Compare July 6, 2022 13:40
Comment thread base/broadcast.jl Outdated
@inkydragon inkydragon added the error messages Better, more actionable error messages label Jul 8, 2022
@IanButterworth
Copy link
Copy Markdown
Member

Is this good to go?

@N5N3
Copy link
Copy Markdown
Member

N5N3 commented Jul 21, 2022

I'm not sure if it's a good idea to remove "broadcast" in the error message.
Also if we want to print the axes instead of size, it seems a good idea to drop the type info,.
1:1000 is clearer than Base.OneTo(1000) and it should be enough for DimensionMismatch, see also #41311

@vtjnash vtjnash force-pushed the helpful_error_broadcast_mix_axis branch from f29854b to 5cd8e8b Compare February 4, 2024 01:33
Comment thread base/broadcast.jl Outdated
Co-authored-by: Jameson Nash <vtjnash@gmail.com>
@vtjnash vtjnash added the merge me PR is reviewed. Merge when all tests are passing label Feb 4, 2024
@IanButterworth IanButterworth merged commit 914de06 into JuliaLang:master Feb 5, 2024
@oscardssmith oscardssmith removed the merge me PR is reviewed. Merge when all tests are passing label Feb 5, 2024
@Moelf Moelf deleted the helpful_error_broadcast_mix_axis branch February 5, 2024 05:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

error messages Better, more actionable error messages

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Uninformative/confusing broadcast error with mixed indexing

7 participants