Urjtag doesn't provide an interface to clear its tracking of the TAPs in the JTAG chain. The add_part() call allows a way to for users to manually add custom-defined TAPs to the chain. However, the only way I have found to remove TAPs from the chain is to use the cable() call to re-initialize the cable.
However, doing this causes urjtag to execute a JTAG reset, which in my use case destroys state in the JTAG device being tested. I see two possible routes here:
1) Add a clear_parts() or remove_part() interface, to get back to a no-parts state in urjtag.
2) Create a way to inhibit the detect operation (ie JTAG Reset and IR/DR overshift) from being performed in the cable() call.
I think 1) is cleaner.
On a little investigation, I found this is a limitation of the Python bindings, not urjtag itself. The urj_part_parts_free() method does what I'm after; it simply needs to be added to the Python bindings.