-
Notifications
You must be signed in to change notification settings - Fork 43
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
Utilities for managing deeply nested data? #862
Comments
This makes me think It's pretty much what they are meant for - tracking where in a larger array a slice comes from. We could even add a DimNestedArray object that holds other DimArray/DimStack that updates |
Oh I see. I'll check out
Are you saying it doesn't implement the Tables.jl interface so it won't work out-of-the-box with AoG? I'm about to check it out now and see what it can do.
I see. From my superficial understanding, The automatic I also found |
+1 for treating |
One thing This realisation of mine negates my above thought that:
On top of your suggestion that accessing layers updates |
Ok I've made a new issue to add |
TL; DR
I'm looking to simplify code for managing nested
DimArray
s andDimStack
s.E.g. feeding nested data to
AlgebraOfGraphics
.Maybe an
add_dims
function? I've prototyped one that I'm happy to PR:Motivating Example
My work typically involves exploring nested data structures that are best not laid out as a long-format data table. A (non-obvious) example is visualised in the following plot:
where the titles are bearings [deg], the horizontal axis is sound speed [m/s], the vertical axis is depth [m] and the colour is range [m].
And this is still a simplified version of the type of data I manage probably half my days at work.
The data plotted above is generated by the following code:
I can show the nested structures of
env
by:Each bearing
Dim{:θ}
has a collection of rangesDim{:r}
whose values aren't shared between eachθ
.Likewise each
Dim{:r}
has a collection of depth-sound speedDim{:z}
-Dim{:c}
pairs whosez
values aren't shared between eachr
.(In other words, vector data I guess 😅 but with structures resembling raster data,
DimensionalData
is the best I've found so far for managing such data.)I've played around with ways to efficiently and flexibly visualise the above in different ways.
My current preference involves the auxiliary function
add_dims
I've defined above, which behaves likereshape
but forDimArray
s.The idea for
add_dims
is that when you access aDimArray
inside anotherDimArray
, that innerDimArray
doesn't hold information on theDim
(s) you used to call it.I'll define the compass bearing relationships:
and then plot like so:
Okay so, what's your question?
My question is, does anyone know any better ways to manage/handle this data, including interaction with
AlgebraOfGraphics
?The above is still only a simplified example of the type of data I handle about half by work days.
Re AoG I'll be looking into pagination next as well, excited to see what it can do.
If you guys like
add_dims
I'm happy to PR it with docs and example of course.I'm partially open to alternatives. I'd like to avoid
pregrouped
, it makes my soul hurt and in my opinion goes against the whole declarative syntax idea AoG was made for (but I still understand whypregrouped
exists).Are there other packages of storage structures that work better on this type of vector data but allows dimensional names and indexing, including grammar-of-graphics interoperability like what AoG provides?
The text was updated successfully, but these errors were encountered: