uncscode / particula

a simple, fast, and powerful particle simulator
https://uncscode.github.io/particula
MIT License
6 stars 9 forks source link

address warnings in tests #502

Open mahf708 opened 1 month ago

mahf708 commented 1 month ago
warnings

``` 2024-10-15T14:09:59.7816757Z =============================== warnings summary =============================== 2024-10-15T14:09:59.7817175Z particula/data/tests/loader_test.py::test_filter_list 2024-10-15T14:09:59.7818012Z $PREFIX/lib/python3.11/site-packages/particula/data/loader.py:112: UserWarning: More than 0.5 of the rows have been filtered out based on the character: ,. 2024-10-15T14:09:59.7818443Z warnings.warn( 2024-10-15T14:09:59.7818613Z 2024-10-15T14:09:59.7818923Z particula/data/tests/loader_test.py::test_filter_list 2024-10-15T14:09:59.7819543Z $PREFIX/lib/python3.11/site-packages/particula/data/loader.py:112: UserWarning: More than 0.5 of the rows have been filtered out based on the character: z. 2024-10-15T14:09:59.7819967Z warnings.warn( 2024-10-15T14:09:59.7820157Z 2024-10-15T14:09:59.7820688Z particula/equilibria/tests/partitioning_test.py::test_partitioning 2024-10-15T14:09:59.7821084Z particula/equilibria/tests/partitioning_test.py::test_partitioning 2024-10-15T14:09:59.7821471Z particula/equilibria/tests/partitioning_test.py::test_partitioning 2024-10-15T14:09:59.7821835Z particula/equilibria/tests/partitioning_test.py::test_partitioning 2024-10-15T14:09:59.7822217Z particula/equilibria/tests/partitioning_test.py::test_partitioning 2024-10-15T14:09:59.7823069Z $PREFIX/lib/python3.11/site-packages/particula/equilibria/partitioning.py:240: DeprecationWarning: Conversion of an array with ndim > 0 to a scalar is deprecated, and will error in future. Ensure you extract a single element from your array before performing this operation. (Deprecated NumPy 1.25.) 2024-10-15T14:09:59.7823723Z mass_fraction_water_ab[i, 0] = alpha[2] 2024-10-15T14:09:59.7823913Z 2024-10-15T14:09:59.7824234Z particula/equilibria/tests/partitioning_test.py::test_partitioning 2024-10-15T14:09:59.7824623Z particula/equilibria/tests/partitioning_test.py::test_partitioning 2024-10-15T14:09:59.7825470Z $PREFIX/lib/python3.11/site-packages/particula/equilibria/partitioning.py:245: DeprecationWarning: Conversion of an array with ndim > 0 to a scalar is deprecated, and will error in future. Ensure you extract a single element from your array before performing this operation. (Deprecated NumPy 1.25.) 2024-10-15T14:09:59.7826015Z gamma_organic_ab[i, 1] = beta[-1] 2024-10-15T14:09:59.7826216Z 2024-10-15T14:09:59.7826515Z particula/equilibria/tests/partitioning_test.py::test_partitioning 2024-10-15T14:09:59.7826904Z particula/equilibria/tests/partitioning_test.py::test_partitioning 2024-10-15T14:09:59.7827748Z $PREFIX/lib/python3.11/site-packages/particula/equilibria/partitioning.py:246: DeprecationWarning: Conversion of an array with ndim > 0 to a scalar is deprecated, and will error in future. Ensure you extract a single element from your array before performing this operation. (Deprecated NumPy 1.25.) 2024-10-15T14:09:59.7828300Z mass_fraction_water_ab[i, 1] = beta[2] 2024-10-15T14:09:59.7828502Z 2024-10-15T14:09:59.7828758Z particula/equilibria/tests/partitioning_test.py::test_partitioning 2024-10-15T14:09:59.7829104Z particula/equilibria/tests/partitioning_test.py::test_partitioning 2024-10-15T14:09:59.7829445Z particula/equilibria/tests/partitioning_test.py::test_partitioning 2024-10-15T14:09:59.7829786Z particula/equilibria/tests/partitioning_test.py::test_partitioning 2024-10-15T14:09:59.7830126Z particula/equilibria/tests/partitioning_test.py::test_partitioning 2024-10-15T14:09:59.7830929Z $PREFIX/lib/python3.11/site-packages/particula/equilibria/partitioning.py:247: DeprecationWarning: Conversion of an array with ndim > 0 to a scalar is deprecated, and will error in future. Ensure you extract a single element from your array before performing this operation. (Deprecated NumPy 1.25.) 2024-10-15T14:09:59.7831681Z q_ab[i, 0] = q_alpha 2024-10-15T14:09:59.7831846Z 2024-10-15T14:09:59.7832101Z particula/equilibria/tests/partitioning_test.py::test_partitioning 2024-10-15T14:09:59.7832459Z particula/equilibria/tests/partitioning_test.py::test_partitioning 2024-10-15T14:09:59.7832965Z particula/equilibria/tests/partitioning_test.py::test_partitioning 2024-10-15T14:09:59.7833330Z particula/equilibria/tests/partitioning_test.py::test_partitioning 2024-10-15T14:09:59.7833680Z particula/equilibria/tests/partitioning_test.py::test_partitioning 2024-10-15T14:09:59.7834501Z $PREFIX/lib/python3.11/site-packages/particula/equilibria/partitioning.py:248: DeprecationWarning: Conversion of an array with ndim > 0 to a scalar is deprecated, and will error in future. Ensure you extract a single element from your array before performing this operation. (Deprecated NumPy 1.25.) 2024-10-15T14:09:59.7835054Z q_ab[i, 1] = 1 - q_alpha 2024-10-15T14:09:59.7835204Z 2024-10-15T14:09:59.7835518Z particula/next/dynamics/properties/tests/dyn_wall_loss_test.py::test_spherical_system_state 2024-10-15T14:09:59.7835915Z particula/next/dynamics/tests/dyn_wall_loss_rate_test.py::test_spherical_wall_loss_rate 2024-10-15T14:09:59.7836424Z particula/next/particles/properties/tests/special_functions_test.py::test_debye_function_single_float 2024-10-15T14:09:59.7837023Z $PREFIX/lib/python3.11/site-packages/particula/next/particles/properties/special_functions.py:61: RuntimeWarning: overflow encountered in exp 2024-10-15T14:09:59.7837499Z array[1:] / (np.exp(array[1:]) - 1), array[1:], axis=0 2024-10-15T14:09:59.7837689Z 2024-10-15T14:09:59.7837991Z particula/next/particles/properties/tests/special_functions_test.py::test_debye_function_single_float 2024-10-15T14:09:59.7838579Z $PREFIX/lib/python3.11/site-packages/particula/next/particles/properties/special_functions.py:66: RuntimeWarning: overflow encountered in exp 2024-10-15T14:09:59.7839064Z array[1:] ** n / (np.exp(array[1:]) - 1), array[1:], axis=0 2024-10-15T14:09:59.7839256Z 2024-10-15T14:09:59.7839587Z particula/next/particles/tests/activity_strategies_test.py::test_kappa_parameter_activity_multiple_species 2024-10-15T14:09:59.7840471Z $PREFIX/lib/python3.11/site-packages/particula/next/particles/properties/activity_module.py:216: DeprecationWarning: Conversion of an array with ndim > 0 to a scalar is deprecated, and will error in future. Ensure you extract a single element from your array before performing this operation. (Deprecated NumPy 1.25.) 2024-10-15T14:09:59.7842756Z activity[water_index] = water_activity 2024-10-15T14:09:59.7842937Z 2024-10-15T14:09:59.7843268Z particula/next/particles/tests/representation_factories_test.py::test_limited_radius_build 2024-10-15T14:09:59.7843961Z $PREFIX/lib/python3.11/site-packages/particula/next/particles/properties/lognormal_size_distribution.py:114: RuntimeWarning: divide by zero encountered in scalar divide 2024-10-15T14:09:59.7844401Z np.sum(number_of_particles)/distribution_pmf_sum) 2024-10-15T14:09:59.7844589Z 2024-10-15T14:09:59.7844902Z particula/next/particles/tests/representation_factories_test.py::test_limited_radius_build 2024-10-15T14:09:59.7845529Z $PREFIX/lib/python3.11/site-packages/particula/next/particles/properties/lognormal_size_distribution.py:113: RuntimeWarning: invalid value encountered in multiply 2024-10-15T14:09:59.7845933Z return distribution_pmf * ( 2024-10-15T14:09:59.7846082Z 2024-10-15T14:09:59.7846362Z particula/util/tests/machine_limit_test.py::test_safe_exp 2024-10-15T14:09:59.7846742Z $SRC_DIR/particula/util/tests/machine_limit_test.py:15: RuntimeWarning: overflow encountered in exp 2024-10-15T14:09:59.7847077Z assert not np.allclose( 2024-10-15T14:09:59.7847219Z 2024-10-15T14:09:59.7847502Z particula/util/tests/machine_limit_test.py::test_safe_log 2024-10-15T14:09:59.7848026Z $SRC_DIR/particula/util/tests/machine_limit_test.py:30: RuntimeWarning: invalid value encountered in log 2024-10-15T14:09:59.7848503Z assert not np.allclose(safe_log([-1, -2, -3]), np.log([-1, -2, -3])) 2024-10-15T14:09:59.7848706Z 2024-10-15T14:09:59.7848972Z particula/util/tests/machine_limit_test.py::test_safe_log10 2024-10-15T14:09:59.7849361Z $SRC_DIR/particula/util/tests/machine_limit_test.py:43: RuntimeWarning: invalid value encountered in log10 2024-10-15T14:09:59.7849835Z assert not np.allclose(safe_log10([-1, -2, -3]), np.log10([-1, -2, -3])) 2024-10-15T14:09:59.7850040Z 2024-10-15T14:09:59.7850309Z particula/util/tests/reduced_quantity_test.py::test_reduced_value_zero_division 2024-10-15T14:09:59.7850863Z $PREFIX/lib/python3.11/site-packages/particula/util/reduced_quantity.py:125: RuntimeWarning: invalid value encountered in divide 2024-10-15T14:09:59.7851265Z return np.where(denominator != 0, alpha * beta / denominator, 0) 2024-10-15T14:09:59.7851448Z 2024-10-15T14:09:59.7851768Z particula/util/tests/reduced_quantity_test.py::test_reduced_self_broadcast_zero_elements 2024-10-15T14:09:59.7852341Z $PREFIX/lib/python3.11/site-packages/particula/util/reduced_quantity.py:151: RuntimeWarning: invalid value encountered in divide 2024-10-15T14:09:59.7852733Z alpha_matrix * alpha_matrix_transpose / denominator, 2024-10-15T14:09:59.7852992Z 2024-10-15T14:09:59.7853367Z -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html 2024-10-15T14:09:59.7853748Z ================= 488 passed, 33 warnings in 123.14s (0:02:03) ================= ```