Skip to content
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 Operations #4

Closed
oxinabox opened this issue Apr 13, 2019 · 3 comments
Closed

Broadcasting Operations #4

oxinabox opened this issue Apr 13, 2019 · 3 comments

Comments

@oxinabox
Copy link
Member

Needs to be done following similar rules to #3
and further:

  • unitary operations keep dim names
  • NamedDimArray op scalar: keeps dim names.
@oxinabox oxinabox mentioned this issue Apr 16, 2019
@mcabbott
Copy link
Collaborator

mcabbott commented May 7, 2019

I was about to open an issue, but perhaps this isn't expected to work yet... anyway this broadcasting operation gives an error:

julia> nda = NamedDimsArray{(:x,:y,:z)}(rand(10,20,30)); # as in readme, but Array not Arrays

julia> nda .+ rand(20)'
ERROR: duplicate field name in NamedTuple: "_" is not unique
Stacktrace:
 [1] identity_namedtuple(::Tuple{Symbol,Symbol}) at /Users/me/.julia/packages/NamedDims/JWdM2/src/name_core.jl:78
 [2] combine_names_longest(::Tuple{Symbol,Symbol,Symbol}, ::Tuple{Symbol,Symbol}) at /Users/me/.julia/packages/NamedDims/JWdM2/src/name_core.jl:201
 [3] broadcasted_names at /Users/me/.julia/packages/NamedDims/JWdM2/src/broadcasting.jl:20 [inlined]

Curiously it doesn't happen for 3 dimensions:

julia> nda .+ rand(1,1,30);

julia> nda .+ rand(10);

julia> nda .+ rand(1,20);
ERROR: duplicate field name in NamedTuple: "_" is not unique

@oxinabox
Copy link
Member Author

oxinabox commented May 7, 2019

This issue should have been closed by #9

Your particular issue @mcabbott is basically part of #8

@mcabbott
Copy link
Collaborator

mcabbott commented May 7, 2019

OK, I wondered if that was related, thanks for taking a look!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants