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

Cannot create zero-length ComponentArray #173

Open
nrontsis opened this issue Oct 26, 2022 · 4 comments
Open

Cannot create zero-length ComponentArray #173

nrontsis opened this issue Oct 26, 2022 · 4 comments

Comments

@nrontsis
Copy link
Contributor

nrontsis commented Oct 26, 2022

I cannot manage to create a zero length ComponentArray. Instead I get an Array back:

julia> ComponentArray(zeros(0), Axis(()))
Float64[]

This seems to be due to this line, that if deleted several things stop working in the package. I wonder what was the rationale behind that line?

I found this to affect type stability.

@jonniedie
Copy link
Owner

Hm. Yeah, it seems that we should make FlatAxis be a real type instead of a type alias. I don’t remember the rationale for making it a type alias. I won’t be able to get to this for the next few days, unfortunately, but I’d be happy to review a PR.

@nrontsis
Copy link
Contributor Author

Somewhat related: #116 (comment)

@nrontsis
Copy link
Contributor Author

Thanks for the reply, I am happy to give a go at opening a PR for this, but I would prefer that the open PRs get reviewed first, to minimise potentially duplicated work.

@nrontsis
Copy link
Contributor Author

nrontsis commented Nov 4, 2022

Not a solution, but it seems possible to create a zero-length array via:

ComponentVector(Vector{Float64}(), (Axis(),))

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