The issue is within the "richardson_number" method, but pertains to the four cases being evaluated by xr.where function when assigning the "richardson_function" value(s).
Two pytest setups triggered the following warning: "RuntimeWarning: invalid value encountered in scalar power". These tests were the "test_changed_water_temp_c" and "test_changed_air_temp_c" in the test_5_tsm_calculations_v2 module. @jrutyna, determined that these warnings were arising because a complex number could be calculated in the "true" argument [x] of the xr.where function for either case 2 or case 4 even though the "cond" argument of the xr.where function was evaluated as false and used the "false" argument [y] of the xr.where function.
For example, the "test_changed_air_temp_c" pytest setup evaluated case 1, case 2, and case 3 as false and case 4 as true, but the equation in the "true" argument of case 2 still gets evaluated at runtime and in this pytest setup yeilds a complex number (i.e. an imaginary number due to a negative number raised to the power of a fraction) which triggers the warning, but since case 2 was evaluated as false this complex number does not get applied.
The logic of the four cases prevents a complex number being assigned to the "richardson_function". After @jrutyna and @ptomasula reviewed these findings, it was agreed that this particular runtime warning could be suppressed within this method.
@ptomasula agreed to implement the warning suppression.
The issue is within the "richardson_number" method, but pertains to the four cases being evaluated by xr.where function when assigning the "richardson_function" value(s).
Two pytest setups triggered the following warning: "RuntimeWarning: invalid value encountered in scalar power". These tests were the "test_changed_water_temp_c" and "test_changed_air_temp_c" in the test_5_tsm_calculations_v2 module. @jrutyna, determined that these warnings were arising because a complex number could be calculated in the "true" argument [x] of the xr.where function for either case 2 or case 4 even though the "cond" argument of the xr.where function was evaluated as false and used the "false" argument [y] of the xr.where function.
For example, the "test_changed_air_temp_c" pytest setup evaluated case 1, case 2, and case 3 as false and case 4 as true, but the equation in the "true" argument of case 2 still gets evaluated at runtime and in this pytest setup yeilds a complex number (i.e. an imaginary number due to a negative number raised to the power of a fraction) which triggers the warning, but since case 2 was evaluated as false this complex number does not get applied.
The logic of the four cases prevents a complex number being assigned to the "richardson_function". After @jrutyna and @ptomasula reviewed these findings, it was agreed that this particular runtime warning could be suppressed within this method.
@ptomasula agreed to implement the warning suppression.