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

Store Relative objects in top level of Topology in Dicts #52

Open
mrdanbrooks opened this issue Jul 22, 2014 · 1 comment
Open

Store Relative objects in top level of Topology in Dicts #52

mrdanbrooks opened this issue Jul 22, 2014 · 1 comment

Comments

@mrdanbrooks
Copy link
Owner

Right now it is very expensive to talk about relative objects, because each time we call

topology.blocks 

we are generating a dictionary of the block attribute in every single vertex, and testing to see if it has an index value. The same is true for bands and snaps.

The current arrangement is optimized for talking about a relative object in the context of a logical object - such as "this vertex's block" or "the bands associated with this edge". But if we want to get information about a vertex (such as a Node) based on a relative object's attribute (like a block index), it only makes since to do it with a single topology.blocks call. Doing that call repeatedly is very inefficient.

Unfortunately, we can't just store the relative objects by the attribute we want to search by, since it may or may not have that value assigned. For example, a block may not have an index assigned to it if we are not wanting to display it, or during the process of reordering blocks.

@mrdanbrooks
Copy link
Owner Author

This would be super useful for implemented a

RosAdapter.get_block_item_label(index) 

function to be called from BaseAdapter._update_view().

@mrdanbrooks mrdanbrooks reopened this Jul 22, 2014
@mrdanbrooks mrdanbrooks removed their assignment Jul 23, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant