The problem arises here, in which process_sw_supp is passed both explicitly (kwargs.get('process_sw_supp', None)) and implicitly through the **kwargs argument. I can 'solve' this locally by commenting out the **kwargs but that of course means I lose whatever else is being passed.