pick = {}
for filter in plot_filter_labels:
pick[filter] = (source['band'] == filter)
…the name filter is used to represent each element of plot_filter_labels. Python actually has a built-in method called filter() and when the Python interpreter gets to this for-loop it overwrites the built-in filter() method and replaces it with a variable. After this cell the method filter is no longer callable and instead represents whatever the last value of the for loop was.
[12:36](https://lsstc.slack.com/archives/D049RJZCQP7/p1706034982711459)
Discovered this when I was using trying to use the filter() method to test something out later in the notebook
My solution (implemented in branch #70 ) is to rename filter --> band. Also delete plot_filter_colors and plot_filter_symbols, which are unused in the rest of the notebook.
From Eric:
pick = {} for filter in plot_filter_labels: pick[filter] = (source['band'] == filter)