def parallel_scipylsp_worker(task): ''' This is a worker to wrap the scipy lombscargle function. ''' try: return lombscargle(*task) except Exception as e: return npnan