-
Notifications
You must be signed in to change notification settings - Fork 41
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
Broadcasting over a DimArray
drops the name field
#580
Comments
Yeah, there are for and against for this. I think the question isnt about broadcast but if Often the name says something about the data that the broadcast totally changes. And raw But IDK, I also see your point. Im open to changing it. Maybe try a PR changing |
You should rename it to the previous name, plus the operation applied. |
The use-case that prompted this issue was converting digital numbers into reflectance for satellite imagery. For example, calculating the surface-reflectance for Sentinel 2 imagery is done as follows: sentinel .* 0.0001f0 In this case, if a layer has the name |
This is the problem, what to do in this case: mycustomfunction.(sentinel .* 0.0001f0 .* some_other_dim_array.^2) ./ yet_another_dim_array Its a broadcast just like yours, and at the level of Doing what you want probably requires putting name rules into our broadcast mechanisms. Its possible, but not easy. (Or we can let precedence win, maybe that will be predictable enough that users can rearrange their functions so the right name "wins" but even so should this still be called |
I suppose that one could use Perhaps we should consider that broadcasting directly over a |
Broadcasting is a huge use case of We could (should) allow you to specify the name in This is just a hard problem. We want the best generic native julia syntax, and we want names to propagate intelligently. |
This is partially solved now using the Its not automated, but automating this is hard. Anyway, I will close this now. A new issue may propose how to automate guessing the name generically. |
Problem:
I've found that broadcasting over a
DimArray
causes thename
field to be set toSymbol("")
I find this behaviour to be quite unexpected. Moreover, it's difficult to feed a broadcasted array into a table, since the column names depend on the array name.
Minimal Example:
The text was updated successfully, but these errors were encountered: