DedalusProject/dedalus

file handlers can no longer set the max writes to infinity

ekaufman5 opened this issue · 2 comments

I've recently updated to the newest version of dedalus, and I found that the file handlers are no longer allowing me to set max_writes to infinity. I had previously been using
scalars = solver.evaluator.add_file_handler(output_dir+'scalar', max_writes=np.inf, iter=100, mode=file_handler_mode) scalars.add_task(integ(0.5*d3.dot(u, u)), name='KE')
But now it's throwing the error
OverflowError: cannot convert float infinity to integer
When it first tries to save the scalars

Try using None instead of np.inf. np.inf should not work, and we will correct any example problems that still use this formulation

scalars = solver.evaluator.add_file_handler(output_dir+'scalar', max_writes=None, iter=100, mode=file_handler_mode) scalars.add_task(integ(0.5*d3.dot(u, u)), name='KE'

I think we'll keep the current d3 behavior. It's in the new docstring and it doesn't look like any d3 examples have np.inf, so I'll close. Thanks!