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

add name etc keywords to DimArray similar #750

Closed
haakon-e opened this issue Jun 25, 2024 · 1 comment · Fixed by #844
Closed

add name etc keywords to DimArray similar #750

haakon-e opened this issue Jun 25, 2024 · 1 comment · Fixed by #844
Labels
enhancement New feature or request

Comments

@haakon-e
Copy link
Contributor

haakon-e commented Jun 25, 2024

Currently, you can do

a = zeros(X(1:3), Y(1:2), name="hi")
# prints
╭────────────────────────────╮
│ 3×2 DimArray{Float64,2} hi │
├────────────────────────────┴──────────────────── dims ┐
   X Sampled{Int64} 1:3 ForwardOrdered Regular Points,
   Y Sampled{Int64} 1:2 ForwardOrdered Regular Points
└───────────────────────────────────────────────────────┘
    1    2
 1    0.0  0.0
 2    0.0  0.0
 3    0.0  0.0

but not

similar(a, name="hello")

maybe there's other instances too that I can track down and patch. I'll try and add a PR if this seems reasonable.

@rafaqz
Copy link
Owner

rafaqz commented Jun 25, 2024

Ah maybe similar missed out on keywords back then, most other constructor methods e.g. rand/fill got them.

Feel free to add them.

@rafaqz rafaqz changed the title add name keyword to various DimArray constructors add name etc keywords to DimArray similar Jul 14, 2024
@rafaqz rafaqz added the enhancement New feature or request label Jul 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants