# select foo and bar:
foo_mat = snipper.select("foo","foo")
bar_mat = snipper.select("bar","bar")
# snip foo and bar:
foo_snip = snipper.snip(foo_mat, "foo", "foo", (100000000, 107000000, 120000000, 127000000) )
bar_snip = snipper.snip(bar_mat, "bar", "bar", (100000000, 107000000, 120000000, 127000000) )
result would look like so:
Note that white bar on the foo_snip - it is because snipper.select("bar","bar") modified some instance attributes - _isnan1, _isnan2 etc, so now those attributes from "bar", modified them for "foo" as well ... We're lucky in this case it didn't crash because dimensions of "foo" and "bar" are identical.
Anyhow, this is not a big deal right now for the way snippers are used (they're used in the right order, even in multiprocessing scenario, i hope), but this is potentially confusing and I wanted to document this is a fact of life. potentially - would be nice to decouple selecting and snipping if others agree - also this could be added to such a refactoring wishlist #227
Here is a simple example, consider simple
CoolerSnipper
:where
view_df
isinputs are taken from cooltools/tests. Now, if we select/snip in the "right" order:
results look like this:
when we change the order of snip/select, like so:
result would look like so:
Note that white bar on the
foo_snip
- it is becausesnipper.select("bar","bar")
modified some instance attributes -_isnan1, _isnan2
etc, so now those attributes from "bar", modified them for "foo" as well ... We're lucky in this case it didn't crash because dimensions of "foo" and "bar" are identical.Anyhow, this is not a big deal right now for the way snippers are used (they're used in the right order, even in multiprocessing scenario, i hope), but this is potentially confusing and I wanted to document this is a fact of life. potentially - would be nice to decouple selecting and snipping if others agree - also this could be added to such a refactoring wishlist #227