Skip to content

Add (in)equality, direct access to index, and validity checking to collection item proxies

Pieter David requested to merge piedavid/bamboo:itemproxycomparison into master

Fixes #51 (closed)

I did a few sanity checks:

  • isValid and idx look as expected
  • equal/unequal indices from the same collection look as expected
  • comparing an item from an op.select-subset with one from the original correction compares the index in the original (this should also make op.sort work, since the only difference is the action on the indices)
  • comparing a jet with a muon raises an error (the same should go for different variations of the jets)

but more testing or suggestions are welcome. Since the actual proxy classes inherit from this one, they should override the attributes if these are present in the tree (that is why isValid and __eq__ do not use idx in the implementation).

Merge request reports