You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've had a bit of a play around with the example IPython notebook you provided, and found that the API is fairly easy to navigate - thanks!
I didn't want to submit this as a PR as it a) it isn't really designed for this repo (it's more general Glue), and b) It's definitely not robust enough or general enough to be used generically...but I wanted to show what I've done.
I've written a simple qadd function, that works like qglue, but adds an array as an extra component to an already-existing DataCollection. This is the kind of thing that would be very useful to me, so that I can add in various different 'partially-processed' bits of satellite imagery and compare them.
defqadd(arr, label, collection_id=None):
iflen(app.data_collection) >1andcollection_idisNone:
raiseValueError('More than one collection exists, you must specify a collection_id')
collection_id=collection_idor0dc=app.data_collection[collection_id]
dc.add_component(arr, label=label)
The text was updated successfully, but these errors were encountered:
Just for information, I also merged a PR after our chat that adds a new add_data method on the application instance: glue-viz/glue#993 - this can be used similarly to qglue, e.g.:
app.add_data(myarray=array)
and I think it will suggest to merge with an existing dataset. However, it would be nice to have a way to add components to existing datasets, so maybe we can think of how to modify add_data to allow for that.
Alternatively, we could make it easier for you to get the data object that corresponds to data you created with qglue so you can then add components to it. For instance, if we could do:
app=qglue(myarray=array)
data=app.data_collection['myarray']
data['mylabel'] =newarray# add new component
So this would require allowing data to be accessed by key in data_collection, which is not currently possible because we don't (yet) enforce unique data labels (this is a to-do: glue-viz/glue#773).
I've had a bit of a play around with the example IPython notebook you provided, and found that the API is fairly easy to navigate - thanks!
I didn't want to submit this as a PR as it a) it isn't really designed for this repo (it's more general Glue), and b) It's definitely not robust enough or general enough to be used generically...but I wanted to show what I've done.
I've written a simple
qadd
function, that works likeqglue
, but adds an array as an extra component to an already-existing DataCollection. This is the kind of thing that would be very useful to me, so that I can add in various different 'partially-processed' bits of satellite imagery and compare them.The text was updated successfully, but these errors were encountered: