From 28be899eb8b3772c5f258a18f825a38eba84c6e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Agnieszka=20=C5=BBaba?= Date: Sun, 24 Nov 2024 21:59:50 +0100 Subject: [PATCH] disable pylint "pointless-statement" check --- .../PySDM_examples/Bolin_1958/table_1.ipynb | 136 +++++++++--------- 1 file changed, 71 insertions(+), 65 deletions(-) diff --git a/examples/PySDM_examples/Bolin_1958/table_1.ipynb b/examples/PySDM_examples/Bolin_1958/table_1.ipynb index 502cbb28e..9b9ed1808 100644 --- a/examples/PySDM_examples/Bolin_1958/table_1.ipynb +++ b/examples/PySDM_examples/Bolin_1958/table_1.ipynb @@ -14,9 +14,7 @@ "cell_type": "markdown", "id": "bb84c52c57a729ec", "metadata": {}, - "source": [ - "### based on Table 1 from B.Bolin 1958 \"On the use of tritium as a tracer for water in nature\"." - ] + "source": "### based on Table 1 from B.Bolin 1958 \"On the use of tritium as a tracer for water in nature\"." }, { "cell_type": "code", @@ -55,6 +53,14 @@ "outputs": [], "execution_count": 4 }, + { + "metadata": {}, + "cell_type": "code", + "outputs": [], + "execution_count": null, + "source": "# pylint: disable=pointless-statement", + "id": "a1097d761bc5b541" + }, { "cell_type": "code", "id": "e29a92d6680c4e51", @@ -72,73 +78,13 @@ "execution_count": 5 }, { - "cell_type": "code", - "id": "314f42c310883cfa", "metadata": { "ExecuteTime": { "end_time": "2024-11-23T14:42:06.731063Z", "start_time": "2024-11-23T14:42:03.594204Z" } }, - "source": [ - "formulae = Formulae(\n", - " terminal_velocity='RogersYau',\n", - " drop_growth='Mason1951',\n", - " diffusion_thermics='Neglect',\n", - " saturation_vapour_pressure='AugustRocheMagnus',\n", - " ventilation='Froessling1938',\n", - " particle_shape_and_density='LiquidSpheres',\n", - " air_dynamic_viscosity='ZografosEtAl1987',\n", - ")\n", - "const = formulae.constants\n", - "any_non_zero_value = 44.\n", - "temperature = const.T0 + 10 * si.K\n", - "pressure = const.p_STP\n", - "pvs = formulae.saturation_vapour_pressure.pvs_water(temperature)\n", - "v_term = formulae.terminal_velocity.v_term(radii)\n", - "eta_air=formulae.air_dynamic_viscosity.eta_air(temperature)\n", - "D=formulae.diffusion_thermics.D(T=temperature, p=pressure)\n", - "\n", - "air_density = pressure/const.Rd/temperature\n", - "assert abs(air_density - 1)/air_density <.3\n", - "Re = formulae.particle_shape_and_density.reynolds_number(\n", - " radius=radii,\n", - " velocity_wrt_air=v_term,\n", - " dynamic_viscosity=eta_air,\n", - " density=air_density,\n", - ")\n", - "Sc = formulae.trivia.air_schmidt_number(\n", - " dynamic_viscosity=eta_air, \n", - " diffusivity=D, \n", - " density=air_density,\n", - ")\n", - "F = formulae.ventilation.ventilation_coefficient(sqrt_re_times_cbrt_sc=Re**(1/2) * Sc**(1/3))\n", - "f = .75\n", - "\n", - "r_dr_dt = formulae.drop_growth.r_dr_dt(\n", - " RH_eq=1,\n", - " T=temperature,\n", - " RH=0,\n", - " lv=0,\n", - " pvs=pvs,\n", - " D=D,\n", - " K=any_non_zero_value,\n", - " ventilation_factor=F\n", - ")\n", - "adjustment_time = (-3 / radii**2 * r_dr_dt * c1)**-1\n", - "\n", - "\n", - "pandas.options.display.float_format = '{:>,.2g}'.format\n", - "data = pandas.DataFrame({\n", - " 'radius [cm]': in_unit(radii, si.cm),\n", - " 'adjustment time [s]': adjustment_time,\n", - " 'terminal velocity [m/s]': v_term,\n", - " 'distance [m]': v_term * adjustment_time,\n", - " \n", - "})\n", - "\n", - "data" - ], + "cell_type": "code", "outputs": [ { "data": { @@ -245,7 +191,67 @@ "output_type": "execute_result" } ], - "execution_count": 6 + "execution_count": 6, + "source": [ + "formulae = Formulae(\n", + " terminal_velocity='RogersYau',\n", + " drop_growth='Mason1951',\n", + " diffusion_thermics='Neglect',\n", + " saturation_vapour_pressure='AugustRocheMagnus',\n", + " ventilation='Froessling1938',\n", + " particle_shape_and_density='LiquidSpheres',\n", + " air_dynamic_viscosity='ZografosEtAl1987',\n", + ")\n", + "const = formulae.constants\n", + "any_non_zero_value = 44.\n", + "temperature = const.T0 + 10 * si.K\n", + "pressure = const.p_STP\n", + "pvs = formulae.saturation_vapour_pressure.pvs_water(temperature)\n", + "v_term = formulae.terminal_velocity.v_term(radii)\n", + "eta_air=formulae.air_dynamic_viscosity.eta_air(temperature)\n", + "D=formulae.diffusion_thermics.D(T=temperature, p=pressure)\n", + "\n", + "air_density = pressure/const.Rd/temperature\n", + "assert abs(air_density - 1)/air_density <.3\n", + "Re = formulae.particle_shape_and_density.reynolds_number(\n", + " radius=radii,\n", + " velocity_wrt_air=v_term,\n", + " dynamic_viscosity=eta_air,\n", + " density=air_density,\n", + ")\n", + "Sc = formulae.trivia.air_schmidt_number(\n", + " dynamic_viscosity=eta_air, \n", + " diffusivity=D, \n", + " density=air_density,\n", + ")\n", + "F = formulae.ventilation.ventilation_coefficient(sqrt_re_times_cbrt_sc=Re**(1/2) * Sc**(1/3))\n", + "f = .75\n", + "\n", + "r_dr_dt = formulae.drop_growth.r_dr_dt(\n", + " RH_eq=1,\n", + " T=temperature,\n", + " RH=0,\n", + " lv=0,\n", + " pvs=pvs,\n", + " D=D,\n", + " K=any_non_zero_value,\n", + " ventilation_factor=F\n", + ")\n", + "adjustment_time = (-3 / radii**2 * r_dr_dt * c1)**-1\n", + "\n", + "\n", + "pandas.options.display.float_format = '{:>,.2g}'.format\n", + "data = pandas.DataFrame({\n", + " 'radius [cm]': in_unit(radii, si.cm),\n", + " 'adjustment time [s]': adjustment_time,\n", + " 'terminal velocity [m/s]': v_term,\n", + " 'distance [m]': v_term * adjustment_time,\n", + " \n", + "})\n", + "\n", + "data " + ], + "id": "314f42c310883cfa" }, { "cell_type": "code",