Closed svniemeijer closed 1 year ago
oh darnit. it looks like I mistakenly had assumed that path 'elements' are always field names. this means the 'reldepth' and goto_parent strategy optimization also doesn't work. for now I reverted the type_path and goto_parent optimizations..
if we want such optimizations again, we could perhaps detect the case that we only have field lookups (and integers) in the whole 'path'. in this case we can cache field indices and backtrack without having to call get_cursor_depth (twice)..
can we easily see that a node expression is just a field lookup? (alternatively we could also check that the whole node expression matches a field name in the current record).
(for just field names joined with '/' we could also cache field indices of course..)
An alternative to using goto_parent is to create a copy of the cursor and using that to navigate the subtree:
import copy
cursor = coda.Cursor()
cursor2 = copy.deepcopy(cursor)
This copied cursor can then be thrown away instead of having to call goto_parent.
Not sure how this works with the type_path part.
so this would probably be quite slow..
This was fixed in version 2.24.2
When using an AEOLUS L2B file, this works:
But this doesn't:
We should be using a
cursor_goto
to traverse any string arguments.