def assert_all_finite(X):
    X = np.asanyarray(X)
    # First try an O(n) time, O(1) space solution for the common case that
    # everything is finite; fall back to O(n) space np.isfinite to prevent
    # false positives from overflow in sum method.
    if (X.dtype.char in np.typecodes['AllFloat'] and not np.isfinite(X.sum())
            and not np.isfinite(X).all()):
        raise ValueError("Input contains NaN, infinity"
                         " or a value too large for %r." % X.dtype)
Test clean_coords if it receives a dict with only longitude.
dataset/ETHPy150Open ibayer/fastFM/fastFM/validation.py/assert_all_finite--crossover with--dataset/ETHPy150Open ofa/connect/open_connect/connect_core/tests/test_utils_location.py/CleanCoordsTest.test_coords_dict_no_lng