Add set_calc_mode with tests and docs