Closed m-mcewen closed 1 month ago
This is unfortunately the intended behavior.
The coordinate filter is a prefix match. When you specify an empty list, you are doing the equivalent of saying "include everything whose coordinates start with the empty list". Same as str.startswith("")
this returns true for all items. It's sortof a useless corner case, but it's forced by various consistency properties w.r.t. going from n+1 to n coordinates on the prefix.
Ah I was using the ability to give it detector labels, i'd forgotten that filter_coords
was originally a filter for the coords...
Possibly a good reason to separate out filter_dem_targets
given they're not prefix-y
When an empty list is explicitly passed to
circuit.diagram
, rather than filter out out everything, the diagram filters out nothing. This behavior wasn't what I expected, and made debugging marginally harder. I was constructing filter coord lists based on conditions about the det regions, which happened to be empty for one In that case, the diagram was populated with all detecting regions, rather than showing that no detecting regions matched the criteria I used to construct the filter coords (which happened to be none of them, which is what I expected / wanted to be shown)