jonniedie / ComponentArrays.jl

Arrays with arbitrarily nested named components.
MIT License
287 stars 34 forks source link

Overlapping labels #163

Closed dawbarton closed 2 years ago

dawbarton commented 2 years ago

Due to a bug in my code, I noticed that it is possible to create overlapping labels using Axis - is this a feature or a bug? I'm hoping it's the former so I can put it to use 😃

For example,

ax = Axis((a=1, b=2:10, b_start=2:3, b_mid=3:8, b_end=9:10))

creates an Axis that allows me to access all of the b vector or specific parts of it. All the functionality of ComponentArrays seems to work correctly but I'm not sure whether it's something I should rely on or not as I can't see any mention of this behaviour in the documentation. (In the example above, I could create a nested ComponentArray but that might not always be the case for what I want to do.)

jonniedie commented 2 years ago

It's a... feature. But it's a little off the beaten path and there may be a few things that aren't well tested around it. I actually use it sometimes too. So you're safe to use it in the sense that it won't go away, I just hesitate to document it until I can properly test it.