From 8b462e8c988780572ea2d6332b76900fcca39c68 Mon Sep 17 00:00:00 2001 From: galipremsagar Date: Fri, 4 Oct 2024 23:07:41 +0000 Subject: [PATCH 01/21] use nep rule --- pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/pyproject.toml b/pyproject.toml index 8f9aa165e5a..0240992fe1a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -90,6 +90,7 @@ select = [ "UP007", # Import from `collections.abc` instead: `Callable` "UP035", + "NPY002", ] ignore = [ # whitespace before : From 763ae358330426727846c9d0fb3b4e92c58d672d Mon Sep 17 00:00:00 2001 From: galipremsagar Date: Fri, 4 Oct 2024 23:13:41 +0000 Subject: [PATCH 02/21] update pre-commit config --- .pre-commit-config.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index f861fb57916..5a4162ce32b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -141,6 +141,7 @@ repos: hooks: - id: ruff files: python/.*$ + args: [ --fix ] - id: ruff-format files: python/.*$ - repo: https://github.com/rapidsai/pre-commit-hooks From 027e1488f42abb0b521004d1fdd661b61a4e38fa Mon Sep 17 00:00:00 2001 From: galipremsagar Date: Sat, 5 Oct 2024 02:41:34 +0000 Subject: [PATCH 03/21] first pass --- .pre-commit-config.yaml | 2 +- python/cudf/cudf/tests/test_binops.py | 22 +-- python/cudf/cudf/tests/test_categorical.py | 6 +- python/cudf/cudf/tests/test_column.py | 1 + python/cudf/cudf/tests/test_concat.py | 12 +- python/cudf/cudf/tests/test_copying.py | 9 +- python/cudf/cudf/tests/test_csv.py | 6 +- python/cudf/cudf/tests/test_dataframe.py | 136 +++++++++--------- python/cudf/cudf/tests/test_dataframe_copy.py | 34 +++-- python/cudf/cudf/tests/test_datetime.py | 6 +- python/cudf/cudf/tests/test_dlpack.py | 10 +- python/cudf/cudf/tests/test_dropna.py | 6 +- python/cudf/cudf/tests/test_duplicates.py | 3 +- python/cudf/cudf/tests/test_factorize.py | 8 +- python/cudf/cudf/tests/test_feather.py | 5 +- python/cudf/cudf/tests/test_groupby.py | 78 +++++----- python/cudf/cudf/tests/test_index.py | 6 +- python/cudf/cudf/tests/test_indexing.py | 80 ++++++----- python/cudf/cudf/tests/test_joining.py | 40 +++--- python/cudf/cudf/tests/test_json.py | 2 +- python/cudf/cudf/tests/test_multiindex.py | 12 +- python/cudf/cudf/tests/test_orc.py | 30 ++-- python/cudf/cudf/tests/test_parquet.py | 24 ++-- python/cudf/cudf/tests/test_query.py | 2 +- python/cudf/cudf/tests/test_reductions.py | 4 +- python/cudf/cudf/tests/test_repr.py | 20 +-- python/cudf/cudf/tests/test_resampling.py | 6 +- python/cudf/cudf/tests/test_reshape.py | 32 ++--- python/cudf/cudf/tests/test_serialize.py | 14 +- python/cudf/cudf/tests/test_series.py | 32 ++--- python/cudf/cudf/tests/test_sorting.py | 10 +- python/cudf/cudf/tests/test_stats.py | 32 ++--- python/cudf/cudf/tests/test_string.py | 6 +- python/cudf/cudf/tests/test_unique.py | 2 +- python/dask_cudf/dask_cudf/tests/test_join.py | 1 + .../dask_cudf/tests/test_reductions.py | 6 +- python/dask_cudf/dask_cudf/tests/test_sort.py | 4 +- python/dask_cudf/dask_cudf/tests/utils.py | 3 +- 38 files changed, 366 insertions(+), 346 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 5a4162ce32b..09f441b143b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -141,7 +141,7 @@ repos: hooks: - id: ruff files: python/.*$ - args: [ --fix ] + args: [ "--fix" ] - id: ruff-format files: python/.*$ - repo: https://github.com/rapidsai/pre-commit-hooks diff --git a/python/cudf/cudf/tests/test_binops.py b/python/cudf/cudf/tests/test_binops.py index 2e8519509e2..c1f4d9ac7e5 100644 --- a/python/cudf/cudf/tests/test_binops.py +++ b/python/cudf/cudf/tests/test_binops.py @@ -271,10 +271,9 @@ def test_series_bitwise_binop(binop, obj_class, lhs_dtype, rhs_dtype): "dtype", ["int8", "int32", "int64", "float32", "float64", "datetime64[ms]"] ) def test_series_compare(cmpop, obj_class, dtype): - arr1 = np.random.randint(0, 100, 100).astype(dtype) - arr2 = np.random.randint(0, 100, 100).astype(dtype) - sr1 = Series(arr1) - sr2 = Series(arr2) + rng = np.random.default_rng(seed=0) + sr1 = Series(rng.integers(0, 100, 100).astype(dtype)) + sr2 = Series(rng.integers(0, 100, 100).astype(dtype)) if obj_class == "Index": sr1 = Index(sr1) @@ -438,9 +437,10 @@ def test_str_series_compare_num_reflected( def test_series_compare_scalar( nelem, cmpop, obj_class, dtype, use_cudf_scalar ): - arr1 = np.random.randint(0, 100, 100).astype(dtype) + rng = np.random.default_rng(seed=0) + arr1 = rng.integers(0, 100, 100).astype(dtype) sr1 = Series(arr1) - rhs = random.choice(arr1).item() + rhs = rng.choice(arr1).item() if use_cudf_scalar: rhs = cudf.Scalar(rhs) @@ -774,7 +774,7 @@ def test_df_different_index_shape(df2, binop): @pytest.mark.parametrize("op", [operator.eq, operator.ne]) def test_boolean_scalar_binop(op): - psr = pd.Series(np.random.choice([True, False], 10)) + psr = pd.Series(rng.choice([True, False], 10)) gsr = cudf.from_pandas(psr) assert_eq(op(psr, True), op(gsr, True)) assert_eq(op(psr, False), op(gsr, False)) @@ -926,13 +926,13 @@ def gen_df(): pdf = pd.DataFrame() from string import ascii_lowercase - cols = np.random.choice(num_cols + 5, num_cols, replace=False) + cols = rng.choice(num_cols + 5, num_cols, replace=False) for i in range(num_cols): colname = ascii_lowercase[cols[i]] data = utils.gen_rand("float64", num_rows) * 10000 if nulls == "some": - idx = np.random.choice( + idx = rng.choice( num_rows, size=int(num_rows / 2), replace=False ) data[idx] = np.nan @@ -962,13 +962,13 @@ def gen_df(): pdf = pd.DataFrame() from string import ascii_lowercase - cols = np.random.choice(num_cols + 5, num_cols, replace=False) + cols = rng.choice(num_cols + 5, num_cols, replace=False) for i in range(num_cols): colname = ascii_lowercase[cols[i]] data = utils.gen_rand("float64", num_rows) * 10000 if nulls == "some": - idx = np.random.choice( + idx = rng.choice( num_rows, size=int(num_rows / 2), replace=False ) data[idx] = np.nan diff --git a/python/cudf/cudf/tests/test_categorical.py b/python/cudf/cudf/tests/test_categorical.py index cd1ad21ae59..aa43453fcb8 100644 --- a/python/cudf/cudf/tests/test_categorical.py +++ b/python/cudf/cudf/tests/test_categorical.py @@ -255,7 +255,7 @@ def test_categorical_unique(num_elements): np.random.seed(12) pd_cat = pd.Categorical( pd.Series( - np.random.choice( + rng.choice( list(string.ascii_letters + string.digits), num_elements ), dtype="category", @@ -282,9 +282,7 @@ def test_categorical_unique_count(nelem): np.random.seed(12) pd_cat = pd.Categorical( pd.Series( - np.random.choice( - list(string.ascii_letters + string.digits), nelem - ), + rng.choice(list(string.ascii_letters + string.digits), nelem), dtype="category", ) ) diff --git a/python/cudf/cudf/tests/test_column.py b/python/cudf/cudf/tests/test_column.py index 4aa7fb27c9b..732dbeaab34 100644 --- a/python/cudf/cudf/tests/test_column.py +++ b/python/cudf/cudf/tests/test_column.py @@ -37,6 +37,7 @@ def pandas_input(request): def random_ints(dtype, size): dtype_min = np.iinfo(dtype).min dtype_max = np.iinfo(dtype).max + rng = np.random.default_rng(seed=0) return rng.integers(dtype_min, dtype_max, size=size, dtype=dtype) try: diff --git a/python/cudf/cudf/tests/test_concat.py b/python/cudf/cudf/tests/test_concat.py index 8da589ba45b..8acb296e4e9 100644 --- a/python/cudf/cudf/tests/test_concat.py +++ b/python/cudf/cudf/tests/test_concat.py @@ -203,10 +203,9 @@ def test_concat_misordered_columns(): @pytest.mark.parametrize("axis", [1, "columns"]) def test_concat_columns(axis): - pdf1 = pd.DataFrame(np.random.randint(10, size=(5, 3)), columns=[1, 2, 3]) - pdf2 = pd.DataFrame( - np.random.randint(10, size=(5, 4)), columns=[4, 5, 6, 7] - ) + rng = np.random.default_rng(seed=0) + pdf1 = pd.DataFrame(rng.integers(10, size=(5, 3)), columns=[1, 2, 3]) + pdf2 = pd.DataFrame(rng.integers(10, size=(5, 4)), columns=[4, 5, 6, 7]) gdf1 = cudf.from_pandas(pdf1) gdf2 = cudf.from_pandas(pdf2) @@ -1398,11 +1397,12 @@ def test_concat_single_object(ignore_index, typ): ], ) def test_concat_decimal_dataframe(ltype, rtype): + rng = np.random.default_rng(seed=0) gdf1 = cudf.DataFrame( - {"id": np.random.randint(0, 10, 3), "val": ["22.3", "59.5", "81.1"]} + {"id": rng.integers(0, 10, 3), "val": ["22.3", "59.5", "81.1"]} ) gdf2 = cudf.DataFrame( - {"id": np.random.randint(0, 10, 3), "val": ["2.35", "5.59", "8.14"]} + {"id": rng.integers(0, 10, 3), "val": ["2.35", "5.59", "8.14"]} ) gdf1["val"] = gdf1["val"].astype(ltype) diff --git a/python/cudf/cudf/tests/test_copying.py b/python/cudf/cudf/tests/test_copying.py index 9b6f82ec705..2d883916d58 100644 --- a/python/cudf/cudf/tests/test_copying.py +++ b/python/cudf/cudf/tests/test_copying.py @@ -16,8 +16,9 @@ @pytest.mark.parametrize("dtype", NUMERIC_TYPES + OTHER_TYPES) def test_repeat(dtype): + rng = np.random.default_rng(seed=0) arr = np.random.rand(10) * 10 - repeats = np.random.randint(10, size=10) + repeats = rng.integers(10, size=10) psr = pd.Series(arr).astype(dtype) gsr = cudf.from_pandas(psr) @@ -25,18 +26,20 @@ def test_repeat(dtype): def test_repeat_index(): + rng = np.random.default_rng(seed=0) arrays = [[1, 1, 2, 2], ["red", "blue", "red", "blue"]] psr = pd.MultiIndex.from_arrays(arrays, names=("number", "color")) gsr = cudf.from_pandas(psr) - repeats = np.random.randint(10, size=4) + repeats = rng.integers(10, size=4) assert_eq(psr.repeat(repeats), gsr.repeat(repeats)) def test_repeat_dataframe(): + rng = np.random.default_rng(seed=0) psr = pd.DataFrame({"a": [1, 1, 2, 2]}) gsr = cudf.from_pandas(psr) - repeats = np.random.randint(10, size=4) + repeats = rng.integers(10, size=4) # pd.DataFrame doesn't have repeat() so as a workaround, we are # comparing pd.Series.repeat() with cudf.DataFrame.repeat()['a'] diff --git a/python/cudf/cudf/tests/test_csv.py b/python/cudf/cudf/tests/test_csv.py index b6efc8ebd88..d371ddff09d 100644 --- a/python/cudf/cudf/tests/test_csv.py +++ b/python/cudf/cudf/tests/test_csv.py @@ -1764,11 +1764,11 @@ def test_csv_writer_multiindex(tmpdir): pdf_df_fname = tmpdir.join("pdf_df_3.csv") gdf_df_fname = tmpdir.join("gdf_df_3.csv") - np.random.seed(0) + rng = np.random.default_rng(seed=0) gdf = cudf.DataFrame( { - "a": np.random.randint(0, 5, 20), - "b": np.random.randint(0, 5, 20), + "a": rng.integers(0, 5, 20), + "b": rng.integers(0, 5, 20), "c": range(20), "d": np.random.random(20), } diff --git a/python/cudf/cudf/tests/test_dataframe.py b/python/cudf/cudf/tests/test_dataframe.py index 6f88d942746..831c491b6bc 100644 --- a/python/cudf/cudf/tests/test_dataframe.py +++ b/python/cudf/cudf/tests/test_dataframe.py @@ -1534,14 +1534,12 @@ def test_dataframe_hash_values_xxhash64(): @pytest.mark.parametrize("nparts", [1, 2, 8, 13]) @pytest.mark.parametrize("nkeys", [1, 2]) def test_dataframe_hash_partition(nrows, nparts, nkeys): - np.random.seed(123) - gdf = cudf.DataFrame() - keycols = [] - for i in range(nkeys): - keyname = f"key{i}" - gdf[keyname] = np.random.randint(0, 7 - i, nrows) - keycols.append(keyname) - gdf["val1"] = np.random.randint(0, nrows * 2, nrows) + rng = np.random.default_rng(seed=0) + gdf = cudf.DataFrame( + {f"key{i}": rng.integers(0, 7 - i, nrows) for i in range(nkeys)} + ) + keycols = gdf.columns.to_list() + gdf["val1"] = rng.integers(0, nrows * 2, nrows) got = gdf.partition_by_hash(keycols, nparts=nparts) # Must return a list @@ -1787,13 +1785,14 @@ def test_concat_with_axis(): check_index_type=True, ) + rng = np.random.default_rng(seed=0) # concat groupby multi index gdf1 = cudf.DataFrame( { - "x": np.random.randint(0, 10, 10), - "y": np.random.randint(0, 10, 10), - "z": np.random.randint(0, 10, 10), - "v": np.random.randint(0, 10, 10), + "x": rng.integers(0, 10, 10), + "y": rng.integers(0, 10, 10), + "z": rng.integers(0, 10, 10), + "v": rng.integers(0, 10, 10), } ) gdf2 = gdf1[5:] @@ -1833,14 +1832,14 @@ def test_concat_with_axis(): @pytest.mark.parametrize("nrows", [0, 3, 10, 100, 1000]) def test_nonmatching_index_setitem(nrows): - np.random.seed(0) + rng = np.random.default_rng(seed=0) gdf = cudf.DataFrame() - gdf["a"] = np.random.randint(2147483647, size=nrows) - gdf["b"] = np.random.randint(2147483647, size=nrows) + gdf["a"] = rng.integers(2147483647, size=nrows) + gdf["b"] = rng.integers(2147483647, size=nrows) gdf = gdf.set_index("b") - test_values = np.random.randint(2147483647, size=nrows) + test_values = rng.integers(2147483647, size=nrows) gdf["c"] = test_values assert len(test_values) == len(gdf["c"]) gdf_series = cudf.Series(test_values, index=gdf.index, name="c") @@ -1974,10 +1973,11 @@ def test_index_in_dataframe_constructor(): @pytest.mark.parametrize("nelem", [0, 2, 3, 100, 1000]) @pytest.mark.parametrize("data_type", dtypes) def test_from_arrow(nelem, data_type): + rng = np.random.default_rng(seed=0) df = pd.DataFrame( { - "a": np.random.randint(0, 1000, nelem).astype(data_type), - "b": np.random.randint(0, 1000, nelem).astype(data_type), + "a": rng.integers(0, 1000, nelem).astype(data_type), + "b": rng.integers(0, 1000, nelem).astype(data_type), } ) padf = pa.Table.from_pandas( @@ -2012,10 +2012,11 @@ def test_from_arrow_chunked_categories(): @pytest.mark.parametrize("nelem", [0, 2, 3, 100, 1000]) @pytest.mark.parametrize("data_type", dtypes) def test_to_arrow(nelem, data_type): + rng = np.random.default_rng(seed=0) df = pd.DataFrame( { - "a": np.random.randint(0, 1000, nelem).astype(data_type), - "b": np.random.randint(0, 1000, nelem).astype(data_type), + "a": rng.integers(0, 1000, nelem).astype(data_type), + "b": rng.integers(0, 1000, nelem).astype(data_type), } ) gdf = cudf.DataFrame.from_pandas(df) @@ -2119,17 +2120,16 @@ def test_to_arrow_missing_categorical(): @pytest.mark.parametrize("data_type", dtypes) def test_from_scalar_typing(data_type): + rng = np.random.default_rng(seed=0) if data_type == "datetime64[ms]": scalar = ( - np.dtype("int64") - .type(np.random.randint(0, 5)) - .astype("datetime64[ms]") + np.dtype("int64").type(rng.integers(0, 5)).astype("datetime64[ms]") ) elif data_type.startswith("datetime64"): scalar = np.datetime64(datetime.date.today()).astype("datetime64[ms]") data_type = "datetime64[ms]" else: - scalar = np.dtype(data_type).type(np.random.randint(0, 5)) + scalar = np.dtype(data_type).type(rng.integers(0, 5)) gdf = cudf.DataFrame() gdf["a"] = [1, 2, 3, 4, 5] @@ -2140,7 +2140,8 @@ def test_from_scalar_typing(data_type): @pytest.mark.parametrize("data_type", NUMERIC_TYPES) def test_from_python_array(data_type): - np_arr = np.random.randint(0, 100, 10).astype(data_type) + rng = np.random.default_rng(seed=0) + np_arr = rng.integers(0, 100, 10).astype(data_type) data = memoryview(np_arr) data = arr.array(data.format, data) @@ -2228,13 +2229,11 @@ def test_dataframe_transpose(nulls, num_cols, num_rows, dtype): for i in range(num_cols): colname = string.ascii_lowercase[i] data = pd.Series( - np.random.randint(0, 26, num_rows).astype(np_dtype), + rng.integers(0, 26, num_rows).astype(np_dtype), dtype=dtype, ) if nulls == "some": - idx = np.random.choice( - num_rows, size=int(num_rows / 2), replace=False - ) + idx = rng.choice(num_rows, size=int(num_rows / 2), replace=False) if len(idx): data[idx] = null_rep elif nulls == "all": @@ -2729,9 +2728,10 @@ def test_quantile(q, numeric_only): [cudf.Decimal32Dtype, cudf.Decimal64Dtype, cudf.Decimal128Dtype], ) def test_decimal_quantile(q, interpolation, decimal_type): + rng = np.random.default_rng(seed=0) data = ["244.8", "32.24", "2.22", "98.14", "453.23", "5.45"] gdf = cudf.DataFrame( - {"id": np.random.randint(0, 10, size=len(data)), "val": data} + {"id": rng.integers(0, 10, size=len(data)), "val": data} ) gdf["id"] = gdf["id"].astype("float64") gdf["val"] = gdf["val"].astype(decimal_type(7, 2)) @@ -2844,8 +2844,7 @@ def test_cuda_array_interface(dtype): @pytest.mark.parametrize("data_type", dtypes) def test_from_arrow_chunked_arrays(nelem, nchunks, data_type): np_list_data = [ - np.random.randint(0, 100, nelem).astype(data_type) - for i in range(nchunks) + rng.integers(0, 100, nelem).astype(data_type) for i in range(nchunks) ] pa_chunk_array = pa.chunked_array(np_list_data) @@ -2855,8 +2854,7 @@ def test_from_arrow_chunked_arrays(nelem, nchunks, data_type): assert_eq(expect, got) np_list_data2 = [ - np.random.randint(0, 100, nelem).astype(data_type) - for i in range(nchunks) + rng.integers(0, 100, nelem).astype(data_type) for i in range(nchunks) ] pa_chunk_array2 = pa.chunked_array(np_list_data2) pa_table = pa.Table.from_arrays( @@ -2885,7 +2883,8 @@ def query_GPU_memory(note=""): colNames = ["col" + str(iCol) for iCol in range(nCols)] pandasDF = pd.DataFrame(data=dataNumpy, columns=colNames, dtype=np.float32) cudaDF = cudf.core.DataFrame.from_pandas(pandasDF) - boolmask = cudf.Series(np.random.randint(1, 2, len(cudaDF)).astype("bool")) + rng = np.random.default_rng(seed=0) + boolmask = cudf.Series(rng.integers(1, 2, len(cudaDF)).astype("bool")) memory_used = query_GPU_memory() cudaDF = cudaDF[boolmask] @@ -2903,7 +2902,8 @@ def query_GPU_memory(note=""): def test_boolmask(pdf, gdf): - boolmask = np.random.randint(0, 2, len(pdf)) > 0 + rng = np.random.default_rng(seed=0) + boolmask = rng.integers(0, 2, len(pdf)) > 0 gdf = gdf[boolmask] pdf = pdf[boolmask] assert_eq(pdf, gdf) @@ -2922,12 +2922,11 @@ def test_boolmask(pdf, gdf): ], ) def test_dataframe_boolmask(mask_shape): - pdf = pd.DataFrame() - for col in "abc": - pdf[col] = np.random.randint(0, 10, 3) - pdf_mask = pd.DataFrame() - for col in mask_shape[1]: - pdf_mask[col] = np.random.randint(0, 2, mask_shape[0]) > 0 + rng = np.random.default_rng(seed=0) + pdf = pd.DataFrame({col: rng.integers(0, 10, 3) for col in "abc"}) + pdf_mask = pd.DataFrame( + {col: rng.integers(0, 2, mask_shape[0]) > 0 for col in mask_shape[1]} + ) gdf = cudf.DataFrame.from_pandas(pdf) gdf_mask = cudf.DataFrame.from_pandas(pdf_mask) gdf = gdf[gdf_mask] @@ -3052,10 +3051,11 @@ def test_series_rename(): @pytest.mark.parametrize("data_type", dtypes) @pytest.mark.parametrize("nelem", [0, 100]) def test_head_tail(nelem, data_type): + rng = np.random.default_rng(seed=0) pdf = pd.DataFrame( { - "a": np.random.randint(0, 1000, nelem).astype(data_type), - "b": np.random.randint(0, 1000, nelem).astype(data_type), + "a": rng.integers(0, 1000, nelem).astype(data_type), + "b": rng.integers(0, 1000, nelem).astype(data_type), } ) gdf = cudf.from_pandas(pdf) @@ -3308,15 +3308,15 @@ def test_set_index_verify_integrity(data, index, verify_integrity): @pytest.mark.parametrize("drop", [True, False]) @pytest.mark.parametrize("nelem", [10, 200, 1333]) def test_set_index_multi(drop, nelem): - np.random.seed(0) + rng = np.random.default_rng(seed=0) a = np.arange(nelem) np.random.shuffle(a) df = pd.DataFrame( { "a": a, - "b": np.random.randint(0, 4, size=nelem), - "c": np.random.uniform(low=0, high=4, size=nelem), - "d": np.random.choice(["green", "black", "white"], nelem), + "b": rng.integers(0, 4, size=nelem), + "c": rng.uniform(low=0, high=4, size=nelem), + "d": rng.choice(["green", "black", "white"], nelem), } ) df["e"] = df["d"].astype("category") @@ -3898,9 +3898,9 @@ def test_dataframe_describe_exclude(): data_length = 10000 df = cudf.DataFrame() - df["x"] = np.random.normal(10, 1, data_length) + df["x"] = rng.normal(10, 1, data_length) df["x"] = df.x.astype("int64") - df["y"] = np.random.normal(10, 1, data_length) + df["y"] = rng.normal(10, 1, data_length) pdf = df.to_pandas() gdf_results = df.describe(exclude=["float"]) @@ -3914,9 +3914,9 @@ def test_dataframe_describe_include(): data_length = 10000 df = cudf.DataFrame() - df["x"] = np.random.normal(10, 1, data_length) + df["x"] = rng.normal(10, 1, data_length) df["x"] = df.x.astype("int64") - df["y"] = np.random.normal(10, 1, data_length) + df["y"] = rng.normal(10, 1, data_length) pdf = df.to_pandas() gdf_results = df.describe(include=["int"]) pdf_results = pdf.describe(include=["int"]) @@ -3929,8 +3929,8 @@ def test_dataframe_describe_default(): data_length = 10000 df = cudf.DataFrame() - df["x"] = np.random.normal(10, 1, data_length) - df["y"] = np.random.normal(10, 1, data_length) + df["x"] = rng.normal(10, 1, data_length) + df["y"] = rng.normal(10, 1, data_length) pdf = df.to_pandas() gdf_results = df.describe() pdf_results = pdf.describe() @@ -3943,10 +3943,10 @@ def test_series_describe_include_all(): data_length = 10000 df = cudf.DataFrame() - df["x"] = np.random.normal(10, 1, data_length) + df["x"] = rng.normal(10, 1, data_length) df["x"] = df.x.astype("int64") - df["y"] = np.random.normal(10, 1, data_length) - df["animal"] = np.random.choice(["dog", "cat", "bird"], data_length) + df["y"] = rng.normal(10, 1, data_length) + df["animal"] = rng.choice(["dog", "cat", "bird"], data_length) pdf = df.to_pandas() gdf_results = df.describe(include="all") @@ -3967,8 +3967,8 @@ def test_dataframe_describe_percentiles(): sample_percentiles = [0.0, 0.1, 0.33, 0.84, 0.4, 0.99] df = cudf.DataFrame() - df["x"] = np.random.normal(10, 1, data_length) - df["y"] = np.random.normal(10, 1, data_length) + df["x"] = rng.normal(10, 1, data_length) + df["y"] = rng.normal(10, 1, data_length) pdf = df.to_pandas() gdf_results = df.describe(percentiles=sample_percentiles) pdf_results = pdf.describe(percentiles=sample_percentiles) @@ -4101,7 +4101,7 @@ def test_dataframe_round(decimals): gdf = cudf.DataFrame( { "floats": np.arange(0.5, 10.5, 1), - "ints": np.random.normal(-100, 100, 10), + "ints": rng.normal(-100, 100, 10), "floats_with_na": np.array( [ 14.123, @@ -4117,9 +4117,9 @@ def test_dataframe_round(decimals): ] ), "floats_same": np.repeat([-0.6459412758761901], 10), - "bools": np.random.choice([True, None, False], 10), - "strings": np.random.choice(["abc", "xyz", None], 10), - "struct": np.random.choice([{"abc": 1}, {"xyz": 2}, None], 10), + "bools": rng.choice([True, None, False], 10), + "strings": rng.choice(["abc", "xyz", None], 10), + "struct": rng.choice([{"abc": 1}, {"xyz": 2}, None], 10), "list": [[1], [2], None, [4], [3]] * 2, } ) @@ -5814,7 +5814,7 @@ def test_memory_usage_string(): df = pd.DataFrame( { "A": np.arange(rows, dtype="int32"), - "B": np.random.choice(["apple", "banana", "orange"], rows), + "B": rng.choice(["apple", "banana", "orange"], rows), } ) gdf = cudf.from_pandas(df) @@ -5840,7 +5840,7 @@ def test_memory_usage_cat(): df = pd.DataFrame( { "A": np.arange(rows, dtype="int32"), - "B": np.random.choice(["apple", "banana", "orange"], rows), + "B": rng.choice(["apple", "banana", "orange"], rows), } ) df["B"] = df.B.astype("category") @@ -5873,10 +5873,10 @@ def test_memory_usage_multi(rows): df = pd.DataFrame( { "A": np.arange(rows, dtype="int32"), - "B": np.random.choice( + "B": rng.choice( np.arange(rows, dtype="int64"), rows, replace=False ), - "C": np.random.choice( + "C": rng.choice( np.arange(rows, dtype="float64"), rows, replace=False ), } @@ -10161,7 +10161,7 @@ def df_eval(request): } ) int_max = 10 - rng = cupy.random.default_rng(0) + rng = cupy.random.default_rng(seed=0) return cudf.DataFrame( { "a": rng.integers(N, size=int_max), diff --git a/python/cudf/cudf/tests/test_dataframe_copy.py b/python/cudf/cudf/tests/test_dataframe_copy.py index 45bd31ef58e..3aedbf8365b 100644 --- a/python/cudf/cudf/tests/test_dataframe_copy.py +++ b/python/cudf/cudf/tests/test_dataframe_copy.py @@ -93,11 +93,15 @@ def test_dataframe_deep_copy_and_insert(copy_parameters): @pytest.mark.parametrize("ncols", [0, 1, 10]) @pytest.mark.parametrize("data_type", ALL_TYPES) def test_cudf_dataframe_copy(copy_fn, ncols, data_type): - pdf = pd.DataFrame() - for i in range(ncols): - pdf[chr(i + ord("a"))] = pd.Series( - np.random.randint(0, 1000, 20) - ).astype(data_type) + rng = np.random.default_rng(seed=0) + pdf = pd.DataFrame( + { + chr(i + ord("a")): pd.Series(rng.integers(0, 1000, 20)).astype( + data_type + ) + for i in range(ncols) + } + ) df = DataFrame.from_pandas(pdf) copy_df = copy_fn(df) assert_eq(df, copy_df) @@ -116,18 +120,20 @@ def test_cudf_dataframe_copy(copy_fn, ncols, data_type): @pytest.mark.parametrize("ncols", [0, 1, 10]) @pytest.mark.parametrize("data_type", ALL_TYPES) def test_cudf_dataframe_copy_then_insert(copy_fn, ncols, data_type): - pdf = pd.DataFrame() - for i in range(ncols): - pdf[chr(i + ord("a"))] = pd.Series( - np.random.randint(0, 1000, 20) - ).astype(data_type) + rng = np.random.default_rng(seed=0) + pdf = pd.DataFrame( + { + chr(i + ord("a")): pd.Series(rng.integers(0, 1000, 20)).astype( + data_type + ) + for i in range(ncols) + } + ) df = DataFrame.from_pandas(pdf) copy_df = copy_fn(df) copy_pdf = copy_fn(pdf) - copy_df["aa"] = pd.Series(np.random.randint(0, 1000, 20)).astype(data_type) - copy_pdf["aa"] = pd.Series(np.random.randint(0, 1000, 20)).astype( - data_type - ) + copy_df["aa"] = pd.Series(rng.integers(0, 1000, 20)).astype(data_type) + copy_pdf["aa"] = pd.Series(rng.integers(0, 1000, 20)).astype(data_type) assert not copy_pdf.to_string().split() == pdf.to_string().split() assert not copy_df.to_string().split() == df.to_string().split() diff --git a/python/cudf/cudf/tests/test_datetime.py b/python/cudf/cudf/tests/test_datetime.py index 4a2345fc009..e09a9a386a7 100644 --- a/python/cudf/cudf/tests/test_datetime.py +++ b/python/cudf/cudf/tests/test_datetime.py @@ -432,11 +432,12 @@ def test_datetime_to_arrow(dtype): ) @pytest.mark.parametrize("nulls", ["none", "some"]) def test_datetime_unique(data, nulls): + rng = np.random.default_rng(seed=0) psr = data.copy() if len(data) > 0: if nulls == "some": - p = np.random.randint(0, len(data), 2) + p = rng.integers(0, len(data), 2) psr[p] = None gsr = cudf.from_pandas(psr) @@ -461,10 +462,11 @@ def test_datetime_unique(data, nulls): @pytest.mark.parametrize("nulls", ["none", "some"]) def test_datetime_nunique(data, nulls): psr = data.copy() + rng = np.random.default_rng(seed=0) if len(data) > 0: if nulls == "some": - p = np.random.randint(0, len(data), 2) + p = rng.integers(0, len(data), 2) psr[p] = None gsr = cudf.from_pandas(psr) diff --git a/python/cudf/cudf/tests/test_dlpack.py b/python/cudf/cudf/tests/test_dlpack.py index ebcc35784ee..20c24bd7564 100644 --- a/python/cudf/cudf/tests/test_dlpack.py +++ b/python/cudf/cudf/tests/test_dlpack.py @@ -42,9 +42,10 @@ def data_1d(request): nelems = request.param[0] dtype = request.param[1] nulls = request.param[2] - a = np.random.randint(10, size=nelems).astype(dtype) + rng = np.random.default_rng(seed=0) + a = rng.integers(10, size=nelems).astype(dtype) if nulls == "some" and a.size != 0 and np.issubdtype(dtype, np.floating): - idx = np.random.choice(a.size, size=int(a.size * 0.2), replace=False) + idx = rng.choice(a.size, size=int(a.size * 0.2), replace=False) a[idx] = np.nan return a @@ -55,9 +56,10 @@ def data_2d(request): nrows = request.param[1] dtype = request.param[2] nulls = request.param[3] - a = np.random.randint(10, size=(nrows, ncols)).astype(dtype) + rng = np.random.default_rng(seed=0) + a = rng.integers(10, size=(nrows, ncols)).astype(dtype) if nulls == "some" and a.size != 0 and np.issubdtype(dtype, np.floating): - idx = np.random.choice(a.size, size=int(a.size * 0.2), replace=False) + idx = rng.choice(a.size, size=int(a.size * 0.2), replace=False) a.ravel()[idx] = np.nan return np.ascontiguousarray(a) diff --git a/python/cudf/cudf/tests/test_dropna.py b/python/cudf/cudf/tests/test_dropna.py index 5b1ee0ffac6..eeac78dbebc 100644 --- a/python/cudf/cudf/tests/test_dropna.py +++ b/python/cudf/cudf/tests/test_dropna.py @@ -22,13 +22,13 @@ @pytest.mark.parametrize("inplace", [True, False]) def test_dropna_series(data, nulls, inplace): psr = pd.Series(data) - + rng = np.random.default_rng(seed=0) if len(data) > 0: if nulls == "one": - p = np.random.randint(0, 4) + p = rng.integers(0, 4) psr[p] = None elif nulls == "some": - p1, p2 = np.random.randint(0, 4, (2,)) + p1, p2 = rng.integers(0, 4, (2,)) psr[p1] = None psr[p2] = None elif nulls == "all": diff --git a/python/cudf/cudf/tests/test_duplicates.py b/python/cudf/cudf/tests/test_duplicates.py index 0b4ed52ba96..dcff4f2f07a 100644 --- a/python/cudf/cudf/tests/test_duplicates.py +++ b/python/cudf/cudf/tests/test_duplicates.py @@ -585,7 +585,8 @@ def test_drop_duplicates_multi_index(): ] idx = pd.MultiIndex.from_tuples(list(zip(*arrays)), names=["a", "b"]) - pdf = pd.DataFrame(np.random.randint(0, 2, (8, 4)), index=idx) + rng = np.random.default_rng(seed=0) + pdf = pd.DataFrame(rng.integers(0, 2, (8, 4)), index=idx) gdf = cudf.DataFrame.from_pandas(pdf) expected = pdf.drop_duplicates() diff --git a/python/cudf/cudf/tests/test_factorize.py b/python/cudf/cudf/tests/test_factorize.py index 47f9180dcb1..cd558cc1415 100644 --- a/python/cudf/cudf/tests/test_factorize.py +++ b/python/cudf/cudf/tests/test_factorize.py @@ -13,10 +13,10 @@ @pytest.mark.parametrize("ncats,nelem", [(2, 2), (2, 10), (10, 100)]) def test_factorize_series_obj(ncats, nelem): df = DataFrame() - np.random.seed(0) + rng = np.random.default_rng(seed=0) # initialize data frame - df["cats"] = arr = np.random.randint(2, size=10, dtype=np.int32) + df["cats"] = arr = rng.integers(2, size=10, dtype=np.int32) uvals, labels = df["cats"].factorize() np.testing.assert_array_equal(labels.to_numpy(), sorted(set(arr))) @@ -31,10 +31,10 @@ def test_factorize_series_obj(ncats, nelem): @pytest.mark.parametrize("ncats,nelem", [(2, 2), (2, 10), (10, 100)]) def test_factorize_index_obj(ncats, nelem): df = DataFrame() - np.random.seed(0) + rng = np.random.default_rng(seed=0) # initialize data frame - df["cats"] = arr = np.random.randint(2, size=10, dtype=np.int32) + df["cats"] = arr = rng.integers(2, size=10, dtype=np.int32) df = df.set_index("cats") uvals, labels = df.index.factorize() diff --git a/python/cudf/cudf/tests/test_feather.py b/python/cudf/cudf/tests/test_feather.py index 7e5523bb8c7..f93bd2c5d32 100644 --- a/python/cudf/cudf/tests/test_feather.py +++ b/python/cudf/cudf/tests/test_feather.py @@ -15,13 +15,14 @@ @pytest.fixture(params=[0, 1, 10, 100]) def pdf(request): + rng = np.random.default_rng(seed=0) types = NUMERIC_TYPES + ["bool"] nrows = request.param # Create a pandas dataframe with random data of mixed types test_pdf = pd.DataFrame( { - f"col_{typ}": np.random.randint(0, nrows, nrows).astype(typ) + f"col_{typ}": rng.integers(0, nrows, nrows).astype(typ) for typ in types } ) @@ -30,7 +31,7 @@ def pdf(request): test_pdf.index.name = "index" # Create non-numeric categorical data otherwise may get typecasted - data = [ascii_letters[np.random.randint(0, 52)] for i in range(nrows)] + data = [ascii_letters[rng.integers(0, 52)] for i in range(nrows)] test_pdf["col_category"] = pd.Series(data, dtype="category") # Feather can't handle indexes properly diff --git a/python/cudf/cudf/tests/test_groupby.py b/python/cudf/cudf/tests/test_groupby.py index 14ba9894fd3..75eeb72a3af 100644 --- a/python/cudf/cudf/tests/test_groupby.py +++ b/python/cudf/cudf/tests/test_groupby.py @@ -77,21 +77,21 @@ def make_frame( extra_vals=(), with_datetime=False, ): - np.random.seed(seed) + rng = np.random.default_rng(seed=seed) df = dataframe_class() - df["x"] = np.random.randint(0, 5, nelem) - df["y"] = np.random.randint(0, 3, nelem) + df["x"] = rng.integers(0, 5, nelem) + df["y"] = rng.integers(0, 3, nelem) for lvl in extra_levels: - df[lvl] = np.random.randint(0, 2, nelem) + df[lvl] = rng.integers(0, 2, nelem) df["val"] = np.random.random(nelem) for val in extra_vals: df[val] = np.random.random(nelem) if with_datetime: - df["datetime"] = np.random.randint( + df["datetime"] = rng.integers( _now, _tomorrow, nelem, dtype=np.int64 ).astype("datetime64[ns]") @@ -285,13 +285,16 @@ def test_groupby_cats(): def test_groupby_iterate_groups(): - np.random.seed(0) - df = DataFrame() + rng = np.random.default_rng(seed=0) nelem = 20 - df["key1"] = np.random.randint(0, 3, nelem) - df["key2"] = np.random.randint(0, 2, nelem) - df["val1"] = np.random.random(nelem) - df["val2"] = np.random.random(nelem) + df = DataFrame( + { + "key1": rng.integers(0, 3, nelem), + "key2": rng.integers(0, 2, nelem), + "val1": np.random.random(nelem), + "val2": np.random.random(nelem), + } + ) def assert_values_equal(arr): np.testing.assert_array_equal(arr[0], arr) @@ -307,13 +310,16 @@ def assert_values_equal(arr): reason="Fails in older versions of pandas", ) def test_groupby_apply(): - np.random.seed(0) - df = DataFrame() + rng = np.random.default_rng(seed=0) nelem = 20 - df["key1"] = np.random.randint(0, 3, nelem) - df["key2"] = np.random.randint(0, 2, nelem) - df["val1"] = np.random.random(nelem) - df["val2"] = np.random.random(nelem) + df = DataFrame( + { + "key1": rng.integers(0, 3, nelem), + "key2": rng.integers(0, 2, nelem), + "val1": np.random.random(nelem), + "val2": np.random.random(nelem), + } + ) expect_grpby = df.to_pandas().groupby( ["key1", "key2"], as_index=False, group_keys=False @@ -351,13 +357,16 @@ def f3(df, k, L, m): reason="Fails in older versions of pandas", ) def test_groupby_apply_args(func, args): - np.random.seed(0) - df = DataFrame() + rng = np.random.default_rng(seed=0) nelem = 20 - df["key1"] = np.random.randint(0, 3, nelem) - df["key2"] = np.random.randint(0, 2, nelem) - df["val1"] = np.random.random(nelem) - df["val2"] = np.random.random(nelem) + df = DataFrame( + { + "key1": rng.integers(0, 3, nelem), + "key2": rng.integers(0, 2, nelem), + "val1": np.random.random(nelem), + "val2": np.random.random(nelem), + } + ) expect_grpby = df.to_pandas().groupby( ["key1", "key2"], as_index=False, group_keys=False @@ -1315,7 +1324,7 @@ def test_empty_groupby(func): def test_groupby_unsupported_columns(): np.random.seed(12) pd_cat = pd.Categorical( - pd.Series(np.random.choice(["a", "b", 1], 3), dtype="category") + pd.Series(rng.choice(["a", "b", 1], 3), dtype="category") ) pdf = pd.DataFrame( { @@ -1421,10 +1430,11 @@ def test_groupby_apply_basic_agg_single_column(): def test_groupby_multi_agg_single_groupby_series(): + rng = np.random.default_rng(seed=0) pdf = pd.DataFrame( { - "x": np.random.randint(0, 5, size=10000), - "y": np.random.normal(size=10000), + "x": rng.integers(0, 5, size=10000), + "y": rng.normal(size=10000), } ) gdf = cudf.from_pandas(pdf) @@ -1435,12 +1445,13 @@ def test_groupby_multi_agg_single_groupby_series(): def test_groupby_multi_agg_multi_groupby(): + rng = np.random.default_rng(seed=0) pdf = pd.DataFrame( { - "a": np.random.randint(0, 5, 10), - "b": np.random.randint(0, 5, 10), - "c": np.random.randint(0, 5, 10), - "d": np.random.randint(0, 5, 10), + "a": rng.integers(0, 5, 10), + "b": rng.integers(0, 5, 10), + "c": rng.integers(0, 5, 10), + "d": rng.integers(0, 5, 10), } ) gdf = cudf.from_pandas(pdf) @@ -1450,6 +1461,7 @@ def test_groupby_multi_agg_multi_groupby(): def test_groupby_datetime_multi_agg_multi_groupby(): + rng = np.random.default_rng(seed=0) pdf = pd.DataFrame( { "a": pd.date_range( @@ -1457,9 +1469,9 @@ def test_groupby_datetime_multi_agg_multi_groupby(): datetime.datetime.now() + datetime.timedelta(9), freq="D", ), - "b": np.random.randint(0, 5, 10), - "c": np.random.randint(0, 5, 10), - "d": np.random.randint(0, 5, 10), + "b": rng.integers(0, 5, 10), + "c": rng.integers(0, 5, 10), + "d": rng.integers(0, 5, 10), } ) gdf = cudf.from_pandas(pdf) diff --git a/python/cudf/cudf/tests/test_index.py b/python/cudf/cudf/tests/test_index.py index 3f483219423..40dbf7a1813 100644 --- a/python/cudf/cudf/tests/test_index.py +++ b/python/cudf/cudf/tests/test_index.py @@ -2645,8 +2645,10 @@ def test_isin_multiindex(data, values, level, err): ) +rng = np.random.default_rng(seed=0) + range_data = [ - range(np.random.randint(0, 100)), + range(rng.integers(0, 100)), range(9, 12, 2), range(20, 30), range(100, 1000, 10), @@ -2831,7 +2833,7 @@ def test_rangeindex_append_return_rangeindex(): index_data = [ - range(np.random.randint(0, 100)), + range(rng.integers(0, 100)), range(0, 10, -2), range(0, -10, 2), range(0, -10, -2), diff --git a/python/cudf/cudf/tests/test_indexing.py b/python/cudf/cudf/tests/test_indexing.py index 00ae99466bb..305d679ba2f 100644 --- a/python/cudf/cudf/tests/test_indexing.py +++ b/python/cudf/cudf/tests/test_indexing.py @@ -212,12 +212,17 @@ def test_dataframe_column_name_indexing(): df[1].to_numpy(), np.asarray(range(10), dtype=np.int32) ) + rng = np.random.default_rng(seed=0) pdf = pd.DataFrame() nelem = 10 - pdf["key1"] = np.random.randint(0, 5, nelem) - pdf["key2"] = np.random.randint(0, 3, nelem) - pdf[1] = np.arange(1, 1 + nelem) - pdf[2] = np.random.random(nelem) + pdf = pd.DataFrame( + { + "key1": rng.integers(0, 5, nelem), + "key2": rng.integers(0, 3, nelem), + 1: np.arange(1, 1 + nelem), + 2: np.random.random(nelem), + } + ) df = cudf.from_pandas(pdf) assert_eq(df[df.columns], df) @@ -239,15 +244,12 @@ def test_dataframe_column_name_indexing(): def test_dataframe_slicing(): + rng = np.random.default_rng(seed=0) df = cudf.DataFrame() size = 123 - df["a"] = ha = np.random.randint(low=0, high=100, size=size).astype( - np.int32 - ) + df["a"] = ha = rng.integers(low=0, high=100, size=size).astype(np.int32) df["b"] = hb = np.random.random(size).astype(np.float32) - df["c"] = hc = np.random.randint(low=0, high=100, size=size).astype( - np.int64 - ) + df["c"] = hc = rng.integers(low=0, high=100, size=size).astype(np.int64) df["d"] = hd = np.random.random(size).astype(np.float64) # Row slice first 10 @@ -287,9 +289,10 @@ def test_dataframe_slicing(): @pytest.mark.parametrize("scalar", [0, 20, 100]) def test_dataframe_loc(scalar, step): size = 123 + rng = np.random.default_rng(seed=0) pdf = pd.DataFrame( { - "a": np.random.randint(low=0, high=100, size=size), + "a": rng.integers(low=0, high=100, size=size), "b": np.random.random(size).astype(np.float32), "c": np.random.random(size).astype(np.float64), "d": np.random.random(size).astype(np.float64), @@ -392,11 +395,10 @@ def test_dataframe_loc_mask(mask, arg): def test_dataframe_loc_outbound(): + rng = np.random.default_rng(seed=0) df = cudf.DataFrame() size = 10 - df["a"] = ha = np.random.randint(low=0, high=100, size=size).astype( - np.int32 - ) + df["a"] = ha = rng.integers(low=0, high=100, size=size).astype(np.int32) df["b"] = hb = np.random.random(size).astype(np.float32) pdf = pd.DataFrame() @@ -625,11 +627,10 @@ def test_series_iloc(nelem): @pytest.mark.parametrize("nelem", [2, 5, 20, 100]) def test_dataframe_iloc(nelem): + rng = np.random.default_rng(seed=0) gdf = cudf.DataFrame() - gdf["a"] = ha = np.random.randint(low=0, high=100, size=nelem).astype( - np.int32 - ) + gdf["a"] = ha = rng.integers(low=0, high=100, size=nelem).astype(np.int32) gdf["b"] = hb = np.random.random(nelem).astype(np.float32) pdf = pd.DataFrame() @@ -679,11 +680,10 @@ def test_dataframe_iloc(nelem): def test_dataframe_iloc_tuple(): + rng = np.random.default_rng(seed=0) gdf = cudf.DataFrame() nelem = 123 - gdf["a"] = ha = np.random.randint(low=0, high=100, size=nelem).astype( - np.int32 - ) + gdf["a"] = ha = rng.integers(low=0, high=100, size=nelem).astype(np.int32) gdf["b"] = hb = np.random.random(nelem).astype(np.float32) pdf = pd.DataFrame() @@ -695,11 +695,10 @@ def test_dataframe_iloc_tuple(): def test_dataframe_iloc_index_error(): + rng = np.random.default_rng(seed=0) gdf = cudf.DataFrame() nelem = 123 - gdf["a"] = ha = np.random.randint(low=0, high=100, size=nelem).astype( - np.int32 - ) + gdf["a"] = ha = rng.integers(low=0, high=100, size=nelem).astype(np.int32) gdf["b"] = hb = np.random.random(nelem).astype(np.float32) pdf = pd.DataFrame() @@ -714,14 +713,16 @@ def test_dataframe_iloc_index_error(): @pytest.mark.parametrize("ntake", [0, 1, 10, 123, 122, 200]) def test_dataframe_take(ntake): - np.random.seed(0) - df = cudf.DataFrame() - + rng = np.random.default_rng(seed=0) nelem = 123 - df["ii"] = np.random.randint(0, 20, nelem) - df["ff"] = np.random.random(nelem) + df = cudf.DataFrame( + { + "ii": rng.integers(0, 20, nelem), + "ff": np.random.random(nelem), + } + ) - take_indices = np.random.randint(0, len(df), ntake) + take_indices = rng.integers(0, len(df), ntake) actual = df.take(take_indices) expected = df.to_pandas().take(take_indices) @@ -733,7 +734,7 @@ def test_dataframe_take(ntake): @pytest.mark.parametrize("ntake", [1, 2, 8, 9]) def test_dataframe_take_with_multiindex(ntake): - np.random.seed(0) + rng = np.random.default_rng(seed=0) df = cudf.DataFrame( index=cudf.MultiIndex( levels=[["lama", "cow", "falcon"], ["speed", "weight", "length"]], @@ -742,10 +743,10 @@ def test_dataframe_take_with_multiindex(ntake): ) nelem = 9 - df["ii"] = np.random.randint(0, 20, nelem) + df["ii"] = rng.integers(0, 20, nelem) df["ff"] = np.random.random(nelem) - take_indices = np.random.randint(0, len(df), ntake) + take_indices = rng.integers(0, len(df), ntake) actual = df.take(take_indices) expected = df.to_pandas().take(take_indices) @@ -755,13 +756,13 @@ def test_dataframe_take_with_multiindex(ntake): @pytest.mark.parametrize("ntake", [0, 1, 10, 123, 122, 200]) def test_series_take(ntake): - np.random.seed(0) + rng = np.random.default_rng(seed=0) nelem = 123 - psr = pd.Series(np.random.randint(0, 20, nelem)) + psr = pd.Series(rng.integers(0, 20, nelem)) gsr = cudf.Series(psr) - take_indices = np.random.randint(0, len(gsr), ntake) + take_indices = rng.integers(0, len(gsr), ntake) actual = gsr.take(take_indices) expected = psr.take(take_indices) @@ -841,14 +842,15 @@ def test_empty_boolean_mask(dtype): ) @pytest.mark.parametrize("nulls", ["one", "some", "all", "none"]) def test_series_apply_boolean_mask(data, mask, nulls): + rng = np.random.default_rng(seed=0) psr = pd.Series(data) if len(data) > 0: if nulls == "one": - p = np.random.randint(0, 4) + p = rng.integers(0, 4) psr[p] = None elif nulls == "some": - p1, p2 = np.random.randint(0, 4, (2,)) + p1, p2 = rng.integers(0, 4, (2,)) psr[p1] = None psr[p2] = None elif nulls == "all": @@ -1816,7 +1818,7 @@ def test_loc_timestamp_issue_8585(index_type): ) end = pd.Timestamp(datetime.strptime("2021-03-12 11:00", "%Y-%m-%d %H:%M")) timestamps = pd.date_range(start, end, periods=12) - value = np.random.normal(size=12) + value = rng.normal(size=12) df = pd.DataFrame(value, index=timestamps, columns=["value"]) cdf = cudf.from_pandas(df) if index_type == "single": @@ -1861,7 +1863,7 @@ def test_loc_multiindex_timestamp_issue_8585(index_type): index = pd.MultiIndex.from_product( [timestamps, labels], names=["timestamp", "label"] ) - value = np.random.normal(size=12) + value = rng.normal(size=12) df = pd.DataFrame(value, index=index, columns=["value"]) cdf = cudf.from_pandas(df) start = pd.Timestamp( diff --git a/python/cudf/cudf/tests/test_joining.py b/python/cudf/cudf/tests/test_joining.py index b1ce69e58ef..32a90b25791 100644 --- a/python/cudf/cudf/tests/test_joining.py +++ b/python/cudf/cudf/tests/test_joining.py @@ -22,7 +22,7 @@ def make_params(): - np.random.seed(0) + rng = np.random.default_rng(seed=0) hows = _JOIN_TYPES @@ -39,8 +39,8 @@ def make_params(): yield (aa, bb, how) # Test large random integer inputs - aa = np.random.randint(0, 50, 100) - bb = np.random.randint(0, 50, 100) + aa = rng.integers(0, 50, 100) + bb = rng.integers(0, 50, 100) for how in hows: yield (aa, bb, how) @@ -164,7 +164,7 @@ def _check_series(expect, got): def test_dataframe_join_suffix(): np.random.seed(0) - df = cudf.DataFrame(np.random.randint(0, 5, (5, 3)), columns=list("abc")) + df = cudf.DataFrame(rng.integers(0, 5, (5, 3)), columns=list("abc")) left = df.set_index("a") right = df.set_index("c") @@ -286,14 +286,14 @@ def test_dataframe_merge_on(on): # Make cuDF df_left = cudf.DataFrame() nelem = 500 - df_left["key1"] = np.random.randint(0, 40, nelem) - df_left["key2"] = np.random.randint(0, 50, nelem) + df_left["key1"] = rng.integers(0, 40, nelem) + df_left["key2"] = rng.integers(0, 50, nelem) df_left["left_val"] = np.arange(nelem) df_right = cudf.DataFrame() nelem = 500 - df_right["key1"] = np.random.randint(0, 30, nelem) - df_right["key2"] = np.random.randint(0, 50, nelem) + df_right["key1"] = rng.integers(0, 30, nelem) + df_right["key2"] = rng.integers(0, 50, nelem) df_right["right_val"] = np.arange(nelem) # Make pandas DF @@ -352,14 +352,14 @@ def test_dataframe_merge_on_unknown_column(): # Make cuDF df_left = cudf.DataFrame() nelem = 500 - df_left["key1"] = np.random.randint(0, 40, nelem) - df_left["key2"] = np.random.randint(0, 50, nelem) + df_left["key1"] = rng.integers(0, 40, nelem) + df_left["key2"] = rng.integers(0, 50, nelem) df_left["left_val"] = np.arange(nelem) df_right = cudf.DataFrame() nelem = 500 - df_right["key1"] = np.random.randint(0, 30, nelem) - df_right["key2"] = np.random.randint(0, 50, nelem) + df_right["key1"] = rng.integers(0, 30, nelem) + df_right["key2"] = rng.integers(0, 50, nelem) df_right["right_val"] = np.arange(nelem) with pytest.raises(KeyError) as raises: @@ -373,14 +373,14 @@ def test_dataframe_merge_no_common_column(): # Make cuDF df_left = cudf.DataFrame() nelem = 500 - df_left["key1"] = np.random.randint(0, 40, nelem) - df_left["key2"] = np.random.randint(0, 50, nelem) + df_left["key1"] = rng.integers(0, 40, nelem) + df_left["key2"] = rng.integers(0, 50, nelem) df_left["left_val"] = np.arange(nelem) df_right = cudf.DataFrame() nelem = 500 - df_right["key3"] = np.random.randint(0, 30, nelem) - df_right["key4"] = np.random.randint(0, 50, nelem) + df_right["key3"] = rng.integers(0, 30, nelem) + df_right["key4"] = rng.integers(0, 50, nelem) df_right["right_val"] = np.arange(nelem) with pytest.raises(ValueError) as raises: @@ -465,9 +465,9 @@ def test_dataframe_pairs_of_triples(pairs, max, rows, how): pdf_left = pd.DataFrame() pdf_right = pd.DataFrame() for left_column in pairs[0]: - pdf_left[left_column] = np.random.randint(0, max, rows) + pdf_left[left_column] = rng.integers(0, max, rows) for right_column in pairs[1]: - pdf_right[right_column] = np.random.randint(0, max, rows) + pdf_right[right_column] = rng.integers(0, max, rows) gdf_left = cudf.from_pandas(pdf_left) gdf_right = cudf.from_pandas(pdf_right) if not set(pdf_left.columns).intersection(pdf_right.columns): @@ -510,9 +510,9 @@ def test_safe_merging_with_left_empty(): pdf_left = pd.DataFrame() pdf_right = pd.DataFrame() for left_column in pairs[0]: - pdf_left[left_column] = np.random.randint(0, 10, 0) + pdf_left[left_column] = rng.integers(0, 10, 0) for right_column in pairs[1]: - pdf_right[right_column] = np.random.randint(0, 10, 5) + pdf_right[right_column] = rng.integers(0, 10, 5) gdf_left = cudf.from_pandas(pdf_left) gdf_right = cudf.from_pandas(pdf_right) diff --git a/python/cudf/cudf/tests/test_json.py b/python/cudf/cudf/tests/test_json.py index c81c2d1d94b..9a967c54202 100644 --- a/python/cudf/cudf/tests/test_json.py +++ b/python/cudf/cudf/tests/test_json.py @@ -38,7 +38,7 @@ def pdf(request): # Create a pandas dataframe with random data of mixed types test_pdf = pd.DataFrame( { - f"col_{typ}": np.random.randint(0, nrows, nrows).astype(typ) + f"col_{typ}": rng.integers(0, nrows, nrows).astype(typ) for typ in types } ) diff --git a/python/cudf/cudf/tests/test_multiindex.py b/python/cudf/cudf/tests/test_multiindex.py index c41be3e4428..65e898d5769 100644 --- a/python/cudf/cudf/tests/test_multiindex.py +++ b/python/cudf/cudf/tests/test_multiindex.py @@ -523,8 +523,8 @@ def test_multiindex_from_product(arrays): def test_multiindex_index_and_columns(): gdf = cudf.DataFrame() - gdf["x"] = np.random.randint(0, 5, 5) - gdf["y"] = np.random.randint(0, 5, 5) + gdf["x"] = rng.integers(0, 5, 5) + gdf["y"] = rng.integers(0, 5, 5) pdf = gdf.to_pandas() mi = cudf.MultiIndex( levels=[[0, 1, 2], [3, 4]], @@ -546,7 +546,7 @@ def test_multiindex_multiple_groupby(): { "a": [4, 17, 4, 9, 5], "b": [1, 4, 4, 3, 2], - "x": np.random.normal(size=5), + "x": rng.normal(size=5), } ) gdf = cudf.DataFrame.from_pandas(pdf) @@ -568,9 +568,9 @@ def test_multiindex_multiple_groupby(): def test_multi_column(func): pdf = pd.DataFrame( { - "x": np.random.randint(0, 5, size=1000), - "y": np.random.randint(0, 10, size=1000), - "z": np.random.normal(size=1000), + "x": rng.integers(0, 5, size=1000), + "y": rng.integers(0, 10, size=1000), + "z": rng.normal(size=1000), } ) gdf = cudf.DataFrame.from_pandas(pdf) diff --git a/python/cudf/cudf/tests/test_orc.py b/python/cudf/cudf/tests/test_orc.py index 1dd732c7191..e7ca0c67148 100644 --- a/python/cudf/cudf/tests/test_orc.py +++ b/python/cudf/cudf/tests/test_orc.py @@ -999,12 +999,12 @@ def generate_list_struct_buff(size=100_000): [ [ [ - rd.choice([None, np.random.randint(1, 3)]) - for _ in range(np.random.randint(1, 3)) + rd.choice([None, rng.integers(1, 3)]) + for _ in range(rng.integers(1, 3)) ] - for _ in range(np.random.randint(0, 3)) + for _ in range(rng.integers(0, 3)) ] - for _ in range(np.random.randint(0, 3)) + for _ in range(rng.integers(0, 3)) ], ] ) @@ -1012,8 +1012,8 @@ def generate_list_struct_buff(size=100_000): ] lvl1_list = [ [ - rd.choice([None, np.random.randint(0, 3)]) - for _ in range(np.random.randint(1, 4)) + rd.choice([None, rng.integers(0, 3)]) + for _ in range(rng.integers(1, 4)) ] for _ in range(size) ] @@ -1021,7 +1021,7 @@ def generate_list_struct_buff(size=100_000): rd.choice( [ None, - {"a": np.random.randint(0, 3), "b": np.random.randint(0, 3)}, + {"a": rng.integers(0, 3), "b": rng.integers(0, 3)}, ] ) for _ in range(size) @@ -1030,11 +1030,11 @@ def generate_list_struct_buff(size=100_000): rd.choice( [ None, - {"a": rd.choice([None, np.random.randint(0, 3)])}, + {"a": rd.choice([None, rng.integers(0, 3)])}, { "lvl1_struct": { - "c": rd.choice([None, np.random.randint(0, 3)]), - "d": np.random.randint(0, 3), + "c": rd.choice([None, rng.integers(0, 3)]), + "d": rng.integers(0, 3), }, }, ] @@ -1044,7 +1044,7 @@ def generate_list_struct_buff(size=100_000): list_nests_struct = [ [ {"a": rd.choice(lvl1_struct), "b": rd.choice(lvl1_struct)} - for _ in range(np.random.randint(1, 4)) + for _ in range(rng.integers(1, 4)) ] for _ in range(size) ] @@ -1146,7 +1146,7 @@ def gen_map_buff(size): None, { rd.choice(al): rd.choice( - [None, np.random.randint(1, 1500)] + [None, rng.integers(1, 1500)] ), }, ] @@ -1167,7 +1167,7 @@ def gen_map_buff(size): None, [ rd.choice( - [None, np.random.randint(1, 1500)] + [None, rng.integers(1, 1500)] ) for _ in range(5) ], @@ -1194,10 +1194,10 @@ def gen_map_buff(size): None, { "a": rd.choice( - [None, np.random.randint(1, 1500)] + [None, rng.integers(1, 1500)] ), "b": rd.choice( - [None, np.random.randint(1, 1500)] + [None, rng.integers(1, 1500)] ), }, ] diff --git a/python/cudf/cudf/tests/test_parquet.py b/python/cudf/cudf/tests/test_parquet.py index 7f1b0b1cd46..55c20ef4f8d 100644 --- a/python/cudf/cudf/tests/test_parquet.py +++ b/python/cudf/cudf/tests/test_parquet.py @@ -72,7 +72,7 @@ def simple_pdf(request): # Create a pandas dataframe with random data of mixed types test_pdf = pd.DataFrame( { - f"col_{typ}": np.random.randint(0, nrows, nrows).astype(typ) + f"col_{typ}": rng.integers(0, nrows, nrows).astype(typ) for typ in types }, # Need to ensure that this index is not a RangeIndex to get the @@ -114,7 +114,7 @@ def build_pdf(num_columns, day_resolution_timestamps): # Create a pandas dataframe with random data of mixed types test_pdf = pd.DataFrame( { - f"col_{typ}": np.random.randint(0, nrows, nrows).astype(typ) + f"col_{typ}": rng.integers(0, nrows, nrows).astype(typ) for typ in types }, # Need to ensure that this index is not a RangeIndex to get the @@ -142,7 +142,7 @@ def build_pdf(num_columns, day_resolution_timestamps): }, ]: data = [ - np.random.randint(0, (0x7FFFFFFFFFFFFFFF / t["nsDivisor"])) + rng.integers(0, (0x7FFFFFFFFFFFFFFF / t["nsDivisor"])) for i in range(nrows) ] if day_resolution_timestamps: @@ -152,11 +152,11 @@ def build_pdf(num_columns, day_resolution_timestamps): ) # Create non-numeric categorical data otherwise parquet may typecast it - data = [ascii_letters[np.random.randint(0, 52)] for i in range(nrows)] + data = [ascii_letters[rng.integers(0, 52)] for i in range(nrows)] test_pdf["col_category"] = pd.Series(data, dtype="category") # Create non-numeric str data - data = [ascii_letters[np.random.randint(0, 52)] for i in range(nrows)] + data = [ascii_letters[rng.integers(0, 52)] for i in range(nrows)] test_pdf["col_str"] = pd.Series(data, dtype="str") return test_pdf @@ -1917,8 +1917,8 @@ def test_parquet_partitioned(tmpdir_factory, cols, filename): pdf = pd.DataFrame( { "a": np.arange(0, stop=size, dtype="int64"), - "b": np.random.choice(list("abcd"), size=size), - "c": np.random.choice(np.arange(4), size=size), + "b": rng.choice(list("abcd"), size=size), + "c": rng.choice(np.arange(4), size=size), } ) pdf.to_parquet(pdf_dir, index=False, partition_cols=cols) @@ -1961,8 +1961,8 @@ def test_parquet_partitioned_notimplemented(tmpdir_factory, kwargs): pdf = pd.DataFrame( { "a": np.arange(0, stop=size, dtype="int64"), - "b": np.random.choice(list("abcd"), size=size), - "c": np.random.choice(np.arange(4), size=size), + "b": rng.choice(list("abcd"), size=size), + "c": rng.choice(np.arange(4), size=size), } ) pdf.to_parquet(pdf_dir, index=False, partition_cols=["b"]) @@ -2139,7 +2139,7 @@ def test_parquet_write_to_dataset(tmpdir_factory, cols, store_schema): gdf = cudf.DataFrame( { "a": np.arange(0, stop=size), - "b": np.random.choice(np.arange(4), size=size), + "b": rng.choice(np.arange(4), size=size), } ) gdf.to_parquet(dir1, partition_cols=cols, store_schema=store_schema) @@ -3217,8 +3217,8 @@ def test_parquet_writer_zstd(): expected = cudf.DataFrame( { "a": np.arange(0, stop=size, dtype="float64"), - "b": np.random.choice(list("abcd"), size=size), - "c": np.random.choice(np.arange(4), size=size), + "b": rng.choice(list("abcd"), size=size), + "c": rng.choice(np.arange(4), size=size), } ) diff --git a/python/cudf/cudf/tests/test_query.py b/python/cudf/cudf/tests/test_query.py index b12209fd3b9..84f735bf5b7 100644 --- a/python/cudf/cudf/tests/test_query.py +++ b/python/cudf/cudf/tests/test_query.py @@ -123,7 +123,7 @@ def test_query_local_dict(): def test_query_splitted_combine(): np.random.seed(0) df = pd.DataFrame( - {"x": np.random.randint(0, 5, size=10), "y": np.random.normal(size=10)} + {"x": rng.integers(0, 5, size=10), "y": rng.normal(size=10)} ) gdf = DataFrame.from_pandas(df) diff --git a/python/cudf/cudf/tests/test_reductions.py b/python/cudf/cudf/tests/test_reductions.py index f276f394cd0..2cf6a9517a7 100644 --- a/python/cudf/cudf/tests/test_reductions.py +++ b/python/cudf/cudf/tests/test_reductions.py @@ -79,7 +79,7 @@ def test_product(dtype, nelem): data = np.ones(nelem, dtype=dtype) # Set at most 30 items to [0..2) to keep the value within 2^32 for _ in range(30): - data[np.random.randint(low=0, high=nelem, size=1)] = ( + data[rng.integers(low=0, high=nelem, size=1)] = ( np.random.uniform() * 2 ) else: @@ -256,7 +256,7 @@ def test_sum_boolean(): def test_date_minmax(): - np_data = np.random.normal(size=10**3) + np_data = rng.normal(size=10**3) gdf_data = Series(np_data) np_casted = np_data.astype("datetime64[ms]") diff --git a/python/cudf/cudf/tests/test_repr.py b/python/cudf/cudf/tests/test_repr.py index 95e19fae501..a892fe62b8b 100644 --- a/python/cudf/cudf/tests/test_repr.py +++ b/python/cudf/cudf/tests/test_repr.py @@ -26,8 +26,8 @@ @pytest.mark.parametrize("nrows", [0, 5, 10]) def test_null_series(nrows, dtype): size = 5 - sr = cudf.Series(np.random.randint(1, 9, size)).astype(dtype) - sr[np.random.choice([False, True], size=size)] = None + sr = cudf.Series(rng.integers(1, 9, size)).astype(dtype) + sr[rng.choice([False, True], size=size)] = None if dtype != "category" and cudf.dtype(dtype).kind in {"u", "i"}: ps = pd.Series( sr._column.data_array_view(mode="read").copy_to_host(), @@ -63,8 +63,8 @@ def test_null_dataframe(ncols): size = 20 gdf = cudf.DataFrame() for idx, dtype in enumerate(dtype_categories): - sr = cudf.Series(np.random.randint(0, 128, size)).astype(dtype) - sr[np.random.choice([False, True], size=size)] = None + sr = cudf.Series(rng.integers(0, 128, size)).astype(dtype) + sr[rng.choice([False, True], size=size)] = None gdf[dtype] = sr pdf = gdf.to_pandas() pd.options.display.max_columns = int(ncols) @@ -77,7 +77,7 @@ def test_null_dataframe(ncols): @pytest.mark.parametrize("nrows", [None, 0, 1, 2, 9, 10, 11, 19, 20, 21]) def test_full_series(nrows, dtype): size = 20 - ps = pd.Series(np.random.randint(0, 100, size)).astype(dtype) + ps = pd.Series(rng.integers(0, 100, size)).astype(dtype) sr = cudf.from_pandas(ps) pd.options.display.max_rows = nrows assert repr(ps) == repr(sr) @@ -90,7 +90,7 @@ def test_full_series(nrows, dtype): @pytest.mark.parametrize("dtype", repr_categories) def test_full_dataframe_20(dtype, size, nrows, ncols): pdf = pd.DataFrame( - {idx: np.random.randint(0, 100, size) for idx in range(size)} + {idx: rng.integers(0, 100, size) for idx in range(size)} ).astype(dtype) gdf = cudf.from_pandas(pdf) @@ -180,9 +180,9 @@ def test_mixed_series(mixed_pdf, mixed_gdf): def test_MI(): gdf = cudf.DataFrame( { - "a": np.random.randint(0, 4, 10), - "b": np.random.randint(0, 4, 10), - "c": np.random.randint(0, 4, 10), + "a": rng.integers(0, 4, 10), + "b": rng.integers(0, 4, 10), + "c": rng.integers(0, 4, 10), } ) levels = [["a", "b", "c", "d"], ["w", "x", "y", "z"], ["m", "n"]] @@ -225,7 +225,7 @@ def test_groupby_MI(nrows, ncols): def test_generic_index(length, dtype): psr = pd.Series( range(length), - index=np.random.randint(0, high=100, size=length).astype(dtype), + index=rng.integers(0, high=100, size=length).astype(dtype), dtype="float64" if length == 0 else None, ) gsr = cudf.Series.from_pandas(psr) diff --git a/python/cudf/cudf/tests/test_resampling.py b/python/cudf/cudf/tests/test_resampling.py index a61477981f8..8a366ed9cd2 100644 --- a/python/cudf/cudf/tests/test_resampling.py +++ b/python/cudf/cudf/tests/test_resampling.py @@ -51,7 +51,7 @@ def test_series_upsample_simple(): @pytest.mark.parametrize("rule", ["2s", "10s"]) def test_series_resample_ffill(rule): rng = pd.date_range("1/1/2012", periods=10, freq="5s") - ts = pd.Series(np.random.randint(0, 500, len(rng)), index=rng) + ts = pd.Series(rng.integers(0, 500, len(rng)), index=rng) gts = cudf.from_pandas(ts) assert_resample_results_equal( ts.resample(rule).ffill(), gts.resample(rule).ffill() @@ -61,7 +61,7 @@ def test_series_resample_ffill(rule): @pytest.mark.parametrize("rule", ["2s", "10s"]) def test_series_resample_bfill(rule): rng = pd.date_range("1/1/2012", periods=10, freq="5s") - ts = pd.Series(np.random.randint(0, 500, len(rng)), index=rng) + ts = pd.Series(rng.integers(0, 500, len(rng)), index=rng) gts = cudf.from_pandas(ts) assert_resample_results_equal( ts.resample(rule).bfill(), gts.resample(rule).bfill() @@ -71,7 +71,7 @@ def test_series_resample_bfill(rule): @pytest.mark.parametrize("rule", ["2s", "10s"]) def test_series_resample_asfreq(rule): rng = pd.date_range("1/1/2012", periods=100, freq="5s") - ts = pd.Series(np.random.randint(0, 500, len(rng)), index=rng) + ts = pd.Series(rng.integers(0, 500, len(rng)), index=rng) gts = cudf.from_pandas(ts) assert_resample_results_equal( ts.resample(rule).asfreq(), gts.resample(rule).asfreq() diff --git a/python/cudf/cudf/tests/test_reshape.py b/python/cudf/cudf/tests/test_reshape.py index 4235affd4d1..779f23bb5ab 100644 --- a/python/cudf/cudf/tests/test_reshape.py +++ b/python/cudf/cudf/tests/test_reshape.py @@ -48,11 +48,9 @@ def test_melt(nulls, num_id_vars, num_value_vars, num_rows, dtype): id_vars = [] for i in range(num_id_vars): colname = "id" + str(i) - data = np.random.randint(0, 26, num_rows).astype(dtype) + data = rng.integers(0, 26, num_rows).astype(dtype) if nulls == "some": - idx = np.random.choice( - num_rows, size=int(num_rows / 2), replace=False - ) + idx = rng.choice(num_rows, size=int(num_rows / 2), replace=False) data[idx] = np.nan elif nulls == "all": data[:] = np.nan @@ -62,11 +60,9 @@ def test_melt(nulls, num_id_vars, num_value_vars, num_rows, dtype): value_vars = [] for i in range(num_value_vars): colname = "val" + str(i) - data = np.random.randint(0, 26, num_rows).astype(dtype) + data = rng.integers(0, 26, num_rows).astype(dtype) if nulls == "some": - idx = np.random.choice( - num_rows, size=int(num_rows / 2), replace=False - ) + idx = rng.choice(num_rows, size=int(num_rows / 2), replace=False) data[idx] = np.nan elif nulls == "all": data[:] = np.nan @@ -132,11 +128,9 @@ def test_df_stack(nulls, num_cols, num_rows, dtype): pdf = pd.DataFrame() for i in range(num_cols): colname = str(i) - data = np.random.randint(0, 26, num_rows).astype(dtype) + data = rng.integers(0, 26, num_rows).astype(dtype) if nulls == "some": - idx = np.random.choice( - num_rows, size=int(num_rows / 2), replace=False - ) + idx = rng.choice(num_rows, size=int(num_rows / 2), replace=False) data[idx] = np.nan pdf[colname] = data @@ -301,12 +295,10 @@ def test_interleave_columns(nulls, num_cols, num_rows, dtype): pdf = pd.DataFrame(dtype=dtype) for i in range(num_cols): colname = str(i) - data = pd.Series(np.random.randint(0, 26, num_rows)).astype(dtype) + data = pd.Series(rng.integers(0, 26, num_rows)).astype(dtype) if nulls == "some": - idx = np.random.choice( - num_rows, size=int(num_rows / 2), replace=False - ) + idx = rng.choice(num_rows, size=int(num_rows / 2), replace=False) data[idx] = np.nan pdf[colname] = data @@ -337,14 +329,10 @@ def test_tile(nulls, num_cols, num_rows, dtype, count): pdf = pd.DataFrame(dtype=dtype) for i in range(num_cols): colname = str(i) - data = pd.Series(np.random.randint(num_cols, 26, num_rows)).astype( - dtype - ) + data = pd.Series(rng.integers(num_cols, 26, num_rows)).astype(dtype) if nulls == "some": - idx = np.random.choice( - num_rows, size=int(num_rows / 2), replace=False - ) + idx = rng.choice(num_rows, size=int(num_rows / 2), replace=False) data[idx] = np.nan pdf[colname] = data diff --git a/python/cudf/cudf/tests/test_serialize.py b/python/cudf/cudf/tests/test_serialize.py index 0b892a51895..542007ac34e 100644 --- a/python/cudf/cudf/tests/test_serialize.py +++ b/python/cudf/cudf/tests/test_serialize.py @@ -204,7 +204,7 @@ def test_serialize_multi_index(): { "a": [4, 17, 4, 9, 5], "b": [1, 4, 4, 3, 2], - "x": np.random.normal(size=5), + "x": rng.normal(size=5), } ) gdf = cudf.DataFrame.from_pandas(pdf) @@ -230,8 +230,8 @@ def test_serialize_masked_series(): def test_serialize_groupby_df(): df = cudf.DataFrame() - df["key_1"] = np.random.randint(0, 20, 100) - df["key_2"] = np.random.randint(0, 20, 100) + df["key_1"] = rng.integers(0, 20, 100) + df["key_2"] = rng.integers(0, 20, 100) df["val"] = np.arange(100, dtype=np.float32) gb = df.groupby(["key_1", "key_2"], sort=True) outgb = gb.deserialize(*gb.serialize()) @@ -243,7 +243,7 @@ def test_serialize_groupby_df(): def test_serialize_groupby_external(): df = cudf.DataFrame() df["val"] = np.arange(100, dtype=np.float32) - gb = df.groupby(cudf.Series(np.random.randint(0, 20, 100))) + gb = df.groupby(cudf.Series(rng.integers(0, 20, 100))) outgb = gb.deserialize(*gb.serialize()) expect = gb.mean() got = outgb.mean() @@ -262,7 +262,7 @@ def test_serialize_groupby_level(): def test_serialize_groupby_sr(): - sr = cudf.Series(np.random.randint(0, 20, 100)) + sr = cudf.Series(rng.integers(0, 20, 100)) gb = sr.groupby(sr // 2) outgb = gb.deserialize(*gb.serialize()) got = gb.mean() @@ -273,7 +273,7 @@ def test_serialize_groupby_sr(): def test_serialize_datetime(): # Make frame with datetime column df = pd.DataFrame( - {"x": np.random.randint(0, 5, size=20), "y": np.random.normal(size=20)} + {"x": rng.integers(0, 5, size=20), "y": rng.normal(size=20)} ) ts = np.arange(0, len(df), dtype=np.dtype("datetime64[ms]")) df["timestamp"] = ts @@ -287,7 +287,7 @@ def test_serialize_datetime(): def test_serialize_string(): # Make frame with string column df = pd.DataFrame( - {"x": np.random.randint(0, 5, size=5), "y": np.random.normal(size=5)} + {"x": rng.integers(0, 5, size=5), "y": rng.normal(size=5)} ) str_data = ["a", "bc", "def", "ghij", "klmno"] df["timestamp"] = str_data diff --git a/python/cudf/cudf/tests/test_series.py b/python/cudf/cudf/tests/test_series.py index a24002dc38e..9fb492c4e25 100644 --- a/python/cudf/cudf/tests/test_series.py +++ b/python/cudf/cudf/tests/test_series.py @@ -522,10 +522,10 @@ def test_series_datetime_value_counts(data, nulls, normalize, dropna): if len(data) > 0: if nulls == "one": - p = np.random.randint(0, len(data)) + p = rng.integers(0, len(data)) psr[p] = None elif nulls == "some": - p = np.random.randint(0, len(data), 2) + p = rng.integers(0, len(data), 2) psr[p] = None gsr = cudf.from_pandas(psr) @@ -549,7 +549,7 @@ def test_categorical_value_counts(dropna, normalize, num_elements): np.random.seed(12) pd_cat = pd.Categorical( pd.Series( - np.random.choice(list(ascii_letters + digits), num_elements), + rng.choice(list(ascii_letters + digits), num_elements), dtype="category", ) ) @@ -587,7 +587,7 @@ def test_categorical_value_counts(dropna, normalize, num_elements): @pytest.mark.parametrize("normalize", [True, False]) def test_series_value_counts(dropna, normalize): for size in [10**x for x in range(5)]: - arr = np.random.randint(low=-1, high=10, size=size) + arr = rng.integers(low=-1, high=10, size=size) mask = arr != -1 sr = cudf.Series.from_masked_array( arr, cudf.Series(mask)._column.as_mask() @@ -714,8 +714,8 @@ def test_series_mode(gs, dropna): @pytest.mark.parametrize( "arr", [ - np.random.normal(-100, 100, 1000), - np.random.randint(-50, 50, 1000), + rng.normal(-100, 100, 1000), + rng.integers(-50, 50, 1000), np.zeros(100), np.repeat([-0.6459412758761901], 100), np.repeat(np.nan, 100), @@ -734,9 +734,9 @@ def test_series_round(arr, decimals): # with nulls, maintaining existing null mask arr = arr.astype("float64") # for pandas nulls - arr.ravel()[ - np.random.choice(arr.shape[0], arr.shape[0] // 2, replace=False) - ] = np.nan + arr.ravel()[rng.choice(arr.shape[0], arr.shape[0] // 2, replace=False)] = ( + np.nan + ) pser = pd.Series(arr) ser = cudf.Series(arr) @@ -1726,7 +1726,7 @@ def test_series_truncate_datetimeindex(): [], [0, 12, 14], [0, 14, 12, 12, 3, 10, 12, 14], - np.random.randint(-100, 100, 200), + rng.integers(-100, 100, 200), pd.Series([0.0, 1.0, None, 10.0]), [None, None, None, None], [np.nan, None, -1, 2, 3], @@ -1735,7 +1735,7 @@ def test_series_truncate_datetimeindex(): @pytest.mark.parametrize( "values", [ - np.random.randint(-100, 100, 10), + rng.integers(-100, 100, 10), [], [np.nan, None, -1, 2, 3], [1.0, 12.0, None, None, 120], @@ -1746,7 +1746,7 @@ def test_series_truncate_datetimeindex(): ], ) def test_isin_numeric(data, values): - index = np.random.randint(0, 100, len(data)) + index = rng.integers(0, 100, len(data)) psr = pd.Series(data, index=index) gsr = cudf.Series.from_pandas(psr, nan_as_null=False) @@ -1943,8 +1943,8 @@ def test_diff_many_dtypes(data): @pytest.mark.parametrize("dtype", NUMERIC_TYPES + ["bool"]) @pytest.mark.parametrize("series_bins", [True, False]) def test_series_digitize(num_rows, num_bins, right, dtype, series_bins): - data = np.random.randint(0, 100, num_rows).astype(dtype) - bins = np.unique(np.sort(np.random.randint(2, 95, num_bins).astype(dtype))) + data = rng.integers(0, 100, num_rows).astype(dtype) + bins = np.unique(np.sort(rng.integers(2, 95, num_bins).astype(dtype))) s = cudf.Series(data) if series_bins: s_bins = cudf.Series(bins) @@ -1957,7 +1957,7 @@ def test_series_digitize(num_rows, num_bins, right, dtype, series_bins): def test_series_digitize_invalid_bins(): - s = cudf.Series(np.random.randint(0, 30, 80), dtype="int32") + s = cudf.Series(rng.integers(0, 30, 80), dtype="int32") bins = cudf.Series([2, None, None, 50, 90], dtype="int32") with pytest.raises( @@ -2038,7 +2038,7 @@ def test_default_float_bitwidth_construction(default_float_bitwidth, data): def test_series_ordered_dedup(): # part of https://github.com/rapidsai/cudf/issues/11486 - sr = cudf.Series(np.random.randint(0, 100, 1000)) + sr = cudf.Series(rng.integers(0, 100, 1000)) # pandas unique() preserves order expect = pd.Series(sr.to_pandas().unique()) got = cudf.Series._from_column(sr._column.unique()) diff --git a/python/cudf/cudf/tests/test_sorting.py b/python/cudf/cudf/tests/test_sorting.py index 2cf2259d9ec..09b83ff37b7 100644 --- a/python/cudf/cudf/tests/test_sorting.py +++ b/python/cudf/cudf/tests/test_sorting.py @@ -222,7 +222,7 @@ def test_dataframe_multi_column( for i in range(5): colname = string.ascii_lowercase[i] - data = np.random.randint(0, 26, num_rows).astype(dtype) + data = rng.integers(0, 26, num_rows).astype(dtype) pdf[colname] = data gdf = DataFrame.from_pandas(pdf) @@ -250,11 +250,11 @@ def test_dataframe_multi_column_nulls( for i in range(3): colname = string.ascii_lowercase[i] - data = np.random.randint(0, 26, num_rows).astype(dtype) + data = rng.integers(0, 26, num_rows).astype(dtype) if nulls == "some": idx = np.array([], dtype="int64") if num_rows > 0: - idx = np.random.choice( + idx = rng.choice( num_rows, size=int(num_rows / 4), replace=False ) data[idx] = np.nan @@ -310,9 +310,9 @@ def test_dataframe_scatter_by_map(map_size, nelem, keep): strlist = ["dog", "cat", "fish", "bird", "pig", "fox", "cow", "goat"] np.random.seed(0) df = DataFrame() - df["a"] = np.random.choice(strlist[:map_size], nelem) + df["a"] = rng.choice(strlist[:map_size], nelem) df["b"] = np.random.uniform(low=0, high=map_size, size=nelem) - df["c"] = np.random.randint(map_size, size=nelem) + df["c"] = rng.integers(map_size, size=nelem) df["d"] = df["a"].astype("category") def _check_scatter_by_map(dfs, col): diff --git a/python/cudf/cudf/tests/test_stats.py b/python/cudf/cudf/tests/test_stats.py index f952cea07f8..5a01d81b012 100644 --- a/python/cudf/cudf/tests/test_stats.py +++ b/python/cudf/cudf/tests/test_stats.py @@ -85,7 +85,7 @@ def test_series_std(ddof): def test_series_unique(): for size in [10**x for x in range(5)]: - arr = np.random.randint(low=-1, high=10, size=size) + arr = rng.integers(low=-1, high=10, size=size) mask = arr != -1 sr = cudf.Series(arr) sr[~mask] = None @@ -129,7 +129,7 @@ def test_series_nunique(nan_as_null, dropna): def test_series_scale(): - arr = pd.Series(np.random.randint(low=-10, high=10, size=100)) + arr = pd.Series(rng.integers(low=-10, high=10, size=100)) sr = cudf.Series(arr) vmin = arr.min() @@ -229,8 +229,8 @@ def test_misc_quantiles(data, q): @pytest.mark.parametrize( "data", [ - {"data": np.random.normal(-100, 100, 1000)}, - {"data": np.random.randint(-50, 50, 1000)}, + {"data": rng.normal(-100, 100, 1000)}, + {"data": rng.integers(-50, 50, 1000)}, {"data": (np.zeros(100))}, {"data": np.repeat(np.nan, 100)}, {"data": np.array([1.123, 2.343, np.nan, 0.0])}, @@ -280,8 +280,8 @@ def test_kurt_skew_error(op): @pytest.mark.parametrize( "data", [ - cudf.Series(np.random.normal(-100, 100, 1000)), - cudf.Series(np.random.randint(-50, 50, 1000)), + cudf.Series(rng.normal(-100, 100, 1000)), + cudf.Series(rng.integers(-50, 50, 1000)), cudf.Series(np.zeros(100)), cudf.Series(np.repeat(np.nan, 100)), cudf.Series(np.array([1.123, 2.343, np.nan, 0.0])), @@ -344,8 +344,8 @@ def test_series_median(dtype, num_na): @pytest.mark.parametrize( "data", [ - np.random.normal(-100, 100, 1000), - np.random.randint(-50, 50, 1000), + rng.normal(-100, 100, 1000), + rng.integers(-50, 50, 1000), np.zeros(100), np.array([1.123, 2.343, np.nan, 0.0]), np.array([-2, 3.75, 6, None, None, None, -8.5, None, 4.2]), @@ -379,8 +379,8 @@ def test_series_pct_change(data, periods, fill_method): @pytest.mark.parametrize( "data1", [ - np.random.normal(-100, 100, 1000), - np.random.randint(-50, 50, 1000), + rng.normal(-100, 100, 1000), + rng.integers(-50, 50, 1000), np.zeros(100), np.repeat(np.nan, 100), np.array([1.123, 2.343, np.nan, 0.0]), @@ -393,8 +393,8 @@ def test_series_pct_change(data, periods, fill_method): @pytest.mark.parametrize( "data2", [ - np.random.normal(-100, 100, 1000), - np.random.randint(-50, 50, 1000), + rng.normal(-100, 100, 1000), + rng.integers(-50, 50, 1000), np.zeros(100), np.repeat(np.nan, 100), np.array([1.123, 2.343, np.nan, 0.0]), @@ -423,8 +423,8 @@ def test_cov1d(data1, data2): @pytest.mark.parametrize( "data1", [ - np.random.normal(-100, 100, 1000), - np.random.randint(-50, 50, 1000), + rng.normal(-100, 100, 1000), + rng.integers(-50, 50, 1000), np.zeros(100), np.repeat(np.nan, 100), np.array([1.123, 2.343, np.nan, 0.0]), @@ -437,8 +437,8 @@ def test_cov1d(data1, data2): @pytest.mark.parametrize( "data2", [ - np.random.normal(-100, 100, 1000), - np.random.randint(-50, 50, 1000), + rng.normal(-100, 100, 1000), + rng.integers(-50, 50, 1000), np.zeros(100), np.repeat(np.nan, 100), np.array([1.123, 2.343, np.nan, 0.0]), diff --git a/python/cudf/cudf/tests/test_string.py b/python/cudf/cudf/tests/test_string.py index cc88cc79769..b806b9258a2 100644 --- a/python/cudf/cudf/tests/test_string.py +++ b/python/cudf/cudf/tests/test_string.py @@ -132,9 +132,9 @@ def test_string_get_item(ps_gs, item): np.array([False] * 5), cupy.asarray(np.array([True] * 5)), cupy.asarray(np.array([False] * 5)), - np.random.randint(0, 2, 5).astype("bool").tolist(), - np.random.randint(0, 2, 5).astype("bool"), - cupy.asarray(np.random.randint(0, 2, 5).astype("bool")), + rng.integers(0, 2, 5).astype("bool").tolist(), + rng.integers(0, 2, 5).astype("bool"), + cupy.asarray(rng.integers(0, 2, 5).astype("bool")), ], ) def test_string_bool_mask(ps_gs, item): diff --git a/python/cudf/cudf/tests/test_unique.py b/python/cudf/cudf/tests/test_unique.py index 699b3340521..6a1366770b3 100644 --- a/python/cudf/cudf/tests/test_unique.py +++ b/python/cudf/cudf/tests/test_unique.py @@ -14,7 +14,7 @@ def df(): df = cudf.DataFrame() np.random.seed(0) - arr = np.random.randint(2, size=10, dtype=np.int64) + arr = rng.integers(2, size=10, dtype=np.int64) df["foo"] = arr df["bar"] = cudf.Series([pd.Timestamp(x) for x in arr]) diff --git a/python/dask_cudf/dask_cudf/tests/test_join.py b/python/dask_cudf/dask_cudf/tests/test_join.py index 3e078c47cdd..43fadbecd0a 100644 --- a/python/dask_cudf/dask_cudf/tests/test_join.py +++ b/python/dask_cudf/dask_cudf/tests/test_join.py @@ -257,6 +257,7 @@ def test_merge_should_fail(): left.merge(right, how="left", on=["c"]) # Same column names + df2["b"] = np.random.randint(0, 12, 12) right = dask_cudf.from_cudf(df2, 1).groupby("a").b.min().to_frame() diff --git a/python/dask_cudf/dask_cudf/tests/test_reductions.py b/python/dask_cudf/dask_cudf/tests/test_reductions.py index d03e92319be..4351b672151 100644 --- a/python/dask_cudf/dask_cudf/tests/test_reductions.py +++ b/python/dask_cudf/dask_cudf/tests/test_reductions.py @@ -13,11 +13,11 @@ def _make_random_frame(nelem, npartitions=2): - np.random.seed(0) + rng = np.random.default_rng(seed=0) df = pd.DataFrame( { - "x": np.random.randint(0, 5, size=nelem), - "y": np.random.normal(size=nelem) + 1, + "x": rng.integers(0, 5, size=nelem), + "y": rng.normal(loc=1.0, scale=1.0, size=nelem), } ) gdf = cudf.DataFrame.from_pandas(df) diff --git a/python/dask_cudf/dask_cudf/tests/test_sort.py b/python/dask_cudf/dask_cudf/tests/test_sort.py index 9bbbbc79561..02c815427f3 100644 --- a/python/dask_cudf/dask_cudf/tests/test_sort.py +++ b/python/dask_cudf/dask_cudf/tests/test_sort.py @@ -28,7 +28,7 @@ @pytest.mark.parametrize("nelem", [10, 500]) @pytest.mark.parametrize("nparts", [1, 10]) def test_sort_values(nelem, nparts, by, ascending): - np.random.seed(0) + _ = np.random.default_rng(seed=0) df = cudf.DataFrame() df["a"] = np.ascontiguousarray(np.arange(nelem)[::-1]) df["b"] = np.arange(100, nelem + 100) @@ -82,7 +82,7 @@ def test_sort_repartition(): ], ) def test_sort_values_with_nulls(data, by, ascending, na_position): - np.random.seed(0) + _ = np.random.default_rng(seed=0) cp.random.seed(0) df = cudf.DataFrame(data) ddf = dd.from_pandas(df, npartitions=5) diff --git a/python/dask_cudf/dask_cudf/tests/utils.py b/python/dask_cudf/dask_cudf/tests/utils.py index cc0c6899804..1744b08cd8d 100644 --- a/python/dask_cudf/dask_cudf/tests/utils.py +++ b/python/dask_cudf/dask_cudf/tests/utils.py @@ -19,8 +19,9 @@ def _make_random_frame(nelem, npartitions=2, include_na=False): + rng = np.random.default_rng() df = pd.DataFrame( - {"x": np.random.random(size=nelem), "y": np.random.random(size=nelem)} + {"x": rng.random(size=nelem), "y": rng.random(size=nelem)} ) if include_na: From 828706e413be44921acef381a2f9a07c17965afc Mon Sep 17 00:00:00 2001 From: galipremsagar Date: Mon, 7 Oct 2024 18:24:09 +0000 Subject: [PATCH 04/21] Switch numpy random calls to latest API --- python/cudf/benchmarks/API/bench_functions.py | 7 +- .../cudf/benchmarks/API/bench_multiindex.py | 12 +- python/cudf/cudf/core/dataframe.py | 8 +- python/cudf/cudf/testing/_utils.py | 24 ++-- python/cudf/cudf/tests/test_array_function.py | 12 +- .../test_avro_reader_fastavro_integration.py | 4 +- python/cudf/cudf/tests/test_binops.py | 42 ++++--- python/cudf/cudf/tests/test_categorical.py | 4 +- python/cudf/cudf/tests/test_column.py | 4 +- python/cudf/cudf/tests/test_concat.py | 3 +- python/cudf/cudf/tests/test_copying.py | 5 +- python/cudf/cudf/tests/test_csv.py | 2 +- python/cudf/cudf/tests/test_dataframe.py | 80 +++++++------ python/cudf/cudf/tests/test_datetime.py | 24 ++-- python/cudf/cudf/tests/test_duplicates.py | 10 +- python/cudf/cudf/tests/test_groupby.py | 31 ++--- python/cudf/cudf/tests/test_indexing.py | 33 +++--- python/cudf/cudf/tests/test_joining.py | 16 +-- python/cudf/cudf/tests/test_json.py | 1 + python/cudf/cudf/tests/test_monotonic.py | 3 +- python/cudf/cudf/tests/test_multiindex.py | 27 +++-- python/cudf/cudf/tests/test_orc.py | 7 +- python/cudf/cudf/tests/test_pack.py | 68 +++++------ python/cudf/cudf/tests/test_parquet.py | 6 + python/cudf/cudf/tests/test_pickling.py | 18 +-- python/cudf/cudf/tests/test_query.py | 10 +- python/cudf/cudf/tests/test_rank.py | 11 +- python/cudf/cudf/tests/test_reductions.py | 12 +- python/cudf/cudf/tests/test_repr.py | 6 + python/cudf/cudf/tests/test_resampling.py | 17 ++- python/cudf/cudf/tests/test_reshape.py | 13 ++- python/cudf/cudf/tests/test_serialize.py | 37 ++++-- python/cudf/cudf/tests/test_series.py | 7 +- python/cudf/cudf/tests/test_seriesmap.py | 4 +- python/cudf/cudf/tests/test_sorting.py | 63 +++++----- python/cudf/cudf/tests/test_sparse_df.py | 5 +- python/cudf/cudf/tests/test_stats.py | 18 +-- python/cudf/cudf/tests/test_string.py | 3 +- python/cudf/cudf/tests/test_transform.py | 4 +- python/cudf/cudf/tests/test_unaops.py | 13 ++- python/cudf/cudf/tests/test_unique.py | 2 +- python/cudf/cudf/utils/hash_vocab_utils.py | 12 +- .../data/repr_slow_down_test.ipynb | 2 +- .../cudf_pandas_tests/test_cudf_pandas.py | 4 +- .../cudf/cudf_pandas_tests/test_profiler.py | 8 +- .../tests/test_cuml.py | 2 +- .../tests/test_stumpy_distributed.py | 8 +- .../dask_cudf/io/tests/test_parquet.py | 8 +- .../dask_cudf/tests/test_accessor.py | 2 +- .../dask_cudf/dask_cudf/tests/test_binops.py | 13 +-- python/dask_cudf/dask_cudf/tests/test_core.py | 110 +++++++++--------- .../dask_cudf/tests/test_delayed_io.py | 37 +++--- .../dask_cudf/tests/test_dispatch.py | 6 +- .../dask_cudf/dask_cudf/tests/test_groupby.py | 51 ++++---- python/dask_cudf/dask_cudf/tests/test_join.py | 51 ++++---- 55 files changed, 552 insertions(+), 438 deletions(-) diff --git a/python/cudf/benchmarks/API/bench_functions.py b/python/cudf/benchmarks/API/bench_functions.py index 93109838900..f902111b0db 100644 --- a/python/cudf/benchmarks/API/bench_functions.py +++ b/python/cudf/benchmarks/API/bench_functions.py @@ -72,12 +72,13 @@ def bench_pivot_table_simple(benchmark, dataframe): @pytest_cases.parametrize("nr", NUM_ROWS) def bench_crosstab_simple(benchmark, nr): + rng = np.random.default_rng(seed=0) series_a = np.array(["foo", "bar"] * nr) series_b = np.array(["one", "two"] * nr) series_c = np.array(["dull", "shiny"] * nr) - np.random.shuffle(series_a) - np.random.shuffle(series_b) - np.random.shuffle(series_c) + rng.shuffle(series_a) + rng.shuffle(series_b) + rng.shuffle(series_c) series_a = cudf.Series(series_a) series_b = cudf.Series(series_b) series_c = cudf.Series(series_c) diff --git a/python/cudf/benchmarks/API/bench_multiindex.py b/python/cudf/benchmarks/API/bench_multiindex.py index 6268bcc4267..77004c3313e 100644 --- a/python/cudf/benchmarks/API/bench_multiindex.py +++ b/python/cudf/benchmarks/API/bench_multiindex.py @@ -1,4 +1,4 @@ -# Copyright (c) 2022, NVIDIA CORPORATION. +# Copyright (c) 2022-2024, NVIDIA CORPORATION. """Benchmarks of MultiIndex methods.""" @@ -11,16 +11,18 @@ @pytest.fixture def pidx(): num_elements = int(1e3) - a = np.random.randint(0, num_elements // 10, num_elements) - b = np.random.randint(0, num_elements // 10, num_elements) + rng = np.random.default_rng(seed=0) + a = rng.integers(0, num_elements // 10, num_elements) + b = rng.integers(0, num_elements // 10, num_elements) return pd.MultiIndex.from_arrays([a, b], names=("a", "b")) @pytest.fixture def midx(pidx): num_elements = int(1e3) - a = np.random.randint(0, num_elements // 10, num_elements) - b = np.random.randint(0, num_elements // 10, num_elements) + rng = np.random.default_rng(seed=0) + a = rng.integers(0, num_elements // 10, num_elements) + b = rng.integers(0, num_elements // 10, num_elements) df = cudf.DataFrame({"a": a, "b": b}) return cudf.MultiIndex.from_frame(df) diff --git a/python/cudf/cudf/core/dataframe.py b/python/cudf/cudf/core/dataframe.py index 16b0aa95c35..edad9bbdfc1 100644 --- a/python/cudf/cudf/core/dataframe.py +++ b/python/cudf/cudf/core/dataframe.py @@ -5118,11 +5118,11 @@ def info( useful for big DataFrames and fine-tune memory optimization: >>> import numpy as np - >>> random_strings_array = np.random.choice(['a', 'b', 'c'], 10 ** 6) + >>> random_strings_array = rng.choice(['a', 'b', 'c'], 10 ** 6) >>> df = cudf.DataFrame({ - ... 'column_1': np.random.choice(['a', 'b', 'c'], 10 ** 6), - ... 'column_2': np.random.choice(['a', 'b', 'c'], 10 ** 6), - ... 'column_3': np.random.choice(['a', 'b', 'c'], 10 ** 6) + ... 'column_1': rng.choice(['a', 'b', 'c'], 10 ** 6), + ... 'column_2': rng.choice(['a', 'b', 'c'], 10 ** 6), + ... 'column_3': rng.choice(['a', 'b', 'c'], 10 ** 6) ... }) >>> df.info(memory_usage='deep') diff --git a/python/cudf/cudf/testing/_utils.py b/python/cudf/cudf/testing/_utils.py index 8cb9efa873c..8a30b0ae6d6 100644 --- a/python/cudf/cudf/testing/_utils.py +++ b/python/cudf/cudf/testing/_utils.py @@ -92,7 +92,8 @@ def random_bitmask(size): number of bits """ sz = bitmask_allocation_size_bytes(size) - data = np.random.randint(0, 255, dtype="u1", size=sz) + rng = np.random.default_rng(seed=0) + data = rng.integers(0, 255, dtype="u1", size=sz) return data.view("i1") @@ -209,9 +210,10 @@ def _get_args_kwars_for_assert_exceptions(func_args_and_kwargs): def gen_rand(dtype, size, **kwargs): + rng = np.random.default_rng(seed=0) dtype = cudf.dtype(dtype) if dtype.kind == "f": - res = np.random.random(size=size).astype(dtype) + res = rng.random(size=size).astype(dtype) if kwargs.get("positive_only", False): return res else: @@ -219,25 +221,23 @@ def gen_rand(dtype, size, **kwargs): elif dtype == np.int8 or dtype == np.int16: low = kwargs.get("low", -32) high = kwargs.get("high", 32) - return np.random.randint(low=low, high=high, size=size).astype(dtype) + return rng.integers(low=low, high=high, size=size).astype(dtype) elif dtype.kind == "i": low = kwargs.get("low", -10000) high = kwargs.get("high", 10000) - return np.random.randint(low=low, high=high, size=size).astype(dtype) + return rng.integers(low=low, high=high, size=size).astype(dtype) elif dtype == np.uint8 or dtype == np.uint16: low = kwargs.get("low", 0) high = kwargs.get("high", 32) - return np.random.randint(low=low, high=high, size=size).astype(dtype) + return rng.integers(low=low, high=high, size=size).astype(dtype) elif dtype.kind == "u": low = kwargs.get("low", 0) high = kwargs.get("high", 128) - return np.random.randint(low=low, high=high, size=size).astype(dtype) + return rng.integers(low=low, high=high, size=size).astype(dtype) elif dtype.kind == "b": low = kwargs.get("low", 0) high = kwargs.get("high", 2) - return np.random.randint(low=low, high=high, size=size).astype( - np.bool_ - ) + return rng.integers(low=low, high=high, size=size).astype(np.bool_) elif dtype.kind == "M": low = kwargs.get("low", 0) time_unit, _ = np.datetime_data(dtype) @@ -246,14 +246,14 @@ def gen_rand(dtype, size, **kwargs): int(1e18) / _unit_to_nanoseconds_conversion[time_unit], ) return pd.to_datetime( - np.random.randint(low=low, high=high, size=size), unit=time_unit + rng.integers(low=low, high=high, size=size), unit=time_unit ) elif dtype.kind in ("O", "U"): low = kwargs.get("low", 10) high = kwargs.get("high", 11) - nchars = np.random.randint(low=low, high=high, size=1)[0] + nchars = rng.integers(low=low, high=high, size=1)[0] char_options = np.array(list(string.ascii_letters + string.digits)) - all_chars = "".join(np.random.choice(char_options, nchars * size)) + all_chars = "".join(rng.choice(char_options, nchars * size)) return np.array( [all_chars[nchars * i : nchars * (i + 1)] for i in range(size)] ) diff --git a/python/cudf/cudf/tests/test_array_function.py b/python/cudf/cudf/tests/test_array_function.py index 979c936a182..af9a6c7e696 100644 --- a/python/cudf/cudf/tests/test_array_function.py +++ b/python/cudf/cudf/tests/test_array_function.py @@ -33,7 +33,7 @@ def __array_function__(self, *args, **kwargs): missing_arrfunc_reason = "NEP-18 support is not available in NumPy" -np.random.seed(0) +rng = np.random.default_rng(seed=0) @pytest.mark.skipif(missing_arrfunc_cond, reason=missing_arrfunc_reason) @@ -49,7 +49,7 @@ def __array_function__(self, *args, **kwargs): ], ) def test_array_func_cudf_series(func): - np_ar = np.random.random(100) + np_ar = rng.random(100) cudf_ser = cudf.Series(np_ar) expect = func(np_ar) got = func(cudf_ser) @@ -74,7 +74,7 @@ def test_array_func_cudf_series(func): ], ) def test_array_func_cudf_dataframe(func): - pd_df = pd.DataFrame(np.random.uniform(size=(100, 10))) + pd_df = pd.DataFrame(rng.uniform(size=(100, 10))) cudf_df = cudf.from_pandas(pd_df) expect = func(pd_df) got = func(cudf_df) @@ -91,7 +91,7 @@ def test_array_func_cudf_dataframe(func): ], ) def test_array_func_missing_cudf_dataframe(func): - pd_df = pd.DataFrame(np.random.uniform(size=(100, 10))) + pd_df = pd.DataFrame(rng.uniform(size=(100, 10))) cudf_df = cudf.from_pandas(pd_df) with pytest.raises(TypeError): func(cudf_df) @@ -105,7 +105,7 @@ def test_array_func_missing_cudf_dataframe(func): ], ) def test_array_func_cudf_index(func): - np_ar = np.random.random(100) + np_ar = rng.random(100) cudf_index = cudf.Index(cudf.Series(np_ar)) expect = func(np_ar) got = func(cudf_index) @@ -125,7 +125,7 @@ def test_array_func_cudf_index(func): ], ) def test_array_func_missing_cudf_index(func): - np_ar = np.random.random(100) + np_ar = rng.random(100) cudf_index = cudf.Index(cudf.Series(np_ar)) with pytest.raises(TypeError): func(cudf_index) diff --git a/python/cudf/cudf/tests/test_avro_reader_fastavro_integration.py b/python/cudf/cudf/tests/test_avro_reader_fastavro_integration.py index 5acdf36de80..17ef033ea9e 100644 --- a/python/cudf/cudf/tests/test_avro_reader_fastavro_integration.py +++ b/python/cudf/cudf/tests/test_avro_reader_fastavro_integration.py @@ -600,12 +600,12 @@ def test_avro_reader_multiblock( else: assert dtype in ("float32", "float64") avro_type = "float" if dtype == "float32" else "double" - np.random.seed(0) + rng = np.random.default_rng(seed=0) # We don't use rand_dataframe() here, because it increases the # execution time of each test by a factor of 10 or more (it appears # to use a very costly approach to generating random data). # See also: https://github.com/rapidsai/cudf/issues/13128 - values = np.random.rand(total_rows).astype(dtype) + values = rng.random(total_rows).astype(dtype) bytes_per_row = values.dtype.itemsize # The sync_interval is the number of bytes between sync blocks. We know diff --git a/python/cudf/cudf/tests/test_binops.py b/python/cudf/cudf/tests/test_binops.py index c1f4d9ac7e5..474d64130eb 100644 --- a/python/cudf/cudf/tests/test_binops.py +++ b/python/cudf/cudf/tests/test_binops.py @@ -2,7 +2,6 @@ import decimal import operator -import random import warnings from itertools import combinations_with_replacement, product @@ -204,7 +203,8 @@ def test_series_binop(binop, obj_class): @pytest.mark.parametrize("binop", _binops) def test_series_binop_concurrent(binop): def func(index): - arr = np.random.random(100) * 10 + rng = np.random.default_rng(seed=0) + arr = rng.random(100) * 10 sr = Series(arr) result = binop(sr.astype("int32"), sr) @@ -223,8 +223,9 @@ def func(index): @pytest.mark.parametrize("obj_class", ["Series", "Index"]) @pytest.mark.parametrize("nelem,binop", list(product([1, 2, 100], _binops))) def test_series_binop_scalar(nelem, binop, obj_class, use_cudf_scalar): - arr = np.random.random(nelem) - rhs = random.choice(arr).item() + rng = np.random.default_rng(seed=0) + arr = rng.random(nelem) + rhs = rng.choice(arr).item() sr = Series(arr) if obj_class == "Index": @@ -247,10 +248,11 @@ def test_series_binop_scalar(nelem, binop, obj_class, use_cudf_scalar): "lhs_dtype,rhs_dtype", list(product(_int_types, _int_types)) ) def test_series_bitwise_binop(binop, obj_class, lhs_dtype, rhs_dtype): - arr1 = (np.random.random(100) * 100).astype(lhs_dtype) + rng = np.random.default_rng(seed=0) + arr1 = (rng.random(100) * 100).astype(lhs_dtype) sr1 = Series(arr1) - arr2 = (np.random.random(100) * 100).astype(rhs_dtype) + arr2 = (rng.random(100) * 100).astype(rhs_dtype) sr2 = Series(arr2) if obj_class == "Index": @@ -272,8 +274,10 @@ def test_series_bitwise_binop(binop, obj_class, lhs_dtype, rhs_dtype): ) def test_series_compare(cmpop, obj_class, dtype): rng = np.random.default_rng(seed=0) - sr1 = Series(rng.integers(0, 100, 100).astype(dtype)) - sr2 = Series(rng.integers(0, 100, 100).astype(dtype)) + arr1 = rng.integers(0, 100, 100).astype(dtype) + arr2 = rng.integers(0, 100, 100).astype(dtype) + sr1 = Series(arr1) + sr2 = Series(arr2) if obj_class == "Index": sr1 = Index(sr1) @@ -465,9 +469,9 @@ def test_series_compare_scalar( @pytest.mark.parametrize("nelem", [1, 7, 8, 9, 32, 64, 128]) @pytest.mark.parametrize("lhs_nulls,rhs_nulls", list(product(_nulls, _nulls))) def test_validity_add(nelem, lhs_nulls, rhs_nulls): - np.random.seed(0) + rng = np.random.default_rng(seed=0) # LHS - lhs_data = np.random.random(nelem) + lhs_data = rng.random(nelem) if lhs_nulls == "some": lhs_mask = utils.random_bitmask(nelem) lhs_bitmask = utils.expand_bits_to_bytes(lhs_mask)[:nelem] @@ -478,7 +482,7 @@ def test_validity_add(nelem, lhs_nulls, rhs_nulls): else: lhs = Series(lhs_data) # RHS - rhs_data = np.random.random(nelem) + rhs_data = rng.random(nelem) if rhs_nulls == "some": rhs_mask = utils.random_bitmask(nelem) rhs_bitmask = utils.expand_bits_to_bytes(rhs_mask)[:nelem] @@ -525,8 +529,9 @@ def test_validity_add(nelem, lhs_nulls, rhs_nulls): ) def test_series_binop_mixed_dtype(binop, lhs_dtype, rhs_dtype, obj_class): nelem = 10 - lhs = (np.random.random(nelem) * nelem).astype(lhs_dtype) - rhs = (np.random.random(nelem) * nelem).astype(rhs_dtype) + rng = np.random.default_rng(seed=0) + lhs = (rng.random(nelem) * nelem).astype(lhs_dtype) + rhs = (rng.random(nelem) * nelem).astype(rhs_dtype) sr1 = Series(lhs) sr2 = Series(rhs) @@ -550,8 +555,9 @@ def test_series_binop_mixed_dtype(binop, lhs_dtype, rhs_dtype, obj_class): ) def test_series_cmpop_mixed_dtype(cmpop, lhs_dtype, rhs_dtype, obj_class): nelem = 5 - lhs = (np.random.random(nelem) * nelem).astype(lhs_dtype) - rhs = (np.random.random(nelem) * nelem).astype(rhs_dtype) + rng = np.random.default_rng(seed=0) + lhs = (rng.random(nelem) * nelem).astype(lhs_dtype) + rhs = (rng.random(nelem) * nelem).astype(rhs_dtype) sr1 = Series(lhs) sr2 = Series(rhs) @@ -574,7 +580,6 @@ def test_series_cmpop_mixed_dtype(cmpop, lhs_dtype, rhs_dtype, obj_class): ) def test_series_reflected_ops_scalar(func, dtype, obj_class): # create random series - np.random.seed(12) random_series = utils.gen_rand(dtype, 100, low=10) # gpu series @@ -631,7 +636,6 @@ def test_series_reflected_ops_cudf_scalar(funcs, dtype, obj_class): cpu_func, gpu_func = funcs # create random series - np.random.seed(12) random_series = utils.gen_rand(dtype, 100, low=10) # gpu series @@ -774,6 +778,7 @@ def test_df_different_index_shape(df2, binop): @pytest.mark.parametrize("op", [operator.eq, operator.ne]) def test_boolean_scalar_binop(op): + rng = np.random.default_rng(seed=0) psr = pd.Series(rng.choice([True, False], 10)) gsr = cudf.from_pandas(psr) assert_eq(op(psr, True), op(gsr, True)) @@ -923,6 +928,7 @@ def test_operator_func_dataframe(func, nulls, fill_value, other): num_cols = 3 def gen_df(): + rng = np.random.default_rng(seed=0) pdf = pd.DataFrame() from string import ascii_lowercase @@ -954,7 +960,7 @@ def gen_df(): @pytest.mark.parametrize("nulls", _nulls) @pytest.mark.parametrize("other", ["df", "scalar"]) def test_logical_operator_func_dataframe(func, nulls, other): - np.random.seed(0) + rng = np.random.default_rng(seed=0) num_rows = 100 num_cols = 3 diff --git a/python/cudf/cudf/tests/test_categorical.py b/python/cudf/cudf/tests/test_categorical.py index aa43453fcb8..7d6c6c7d7b0 100644 --- a/python/cudf/cudf/tests/test_categorical.py +++ b/python/cudf/cudf/tests/test_categorical.py @@ -252,7 +252,7 @@ def test_cat_series_binop_error(): @pytest.mark.parametrize("num_elements", [10, 100, 1000]) def test_categorical_unique(num_elements): # create categorical series - np.random.seed(12) + rng = np.random.default_rng(seed=0) pd_cat = pd.Categorical( pd.Series( rng.choice( @@ -279,7 +279,7 @@ def test_categorical_unique(num_elements): @pytest.mark.parametrize("nelem", [20, 50, 100]) def test_categorical_unique_count(nelem): # create categorical series - np.random.seed(12) + rng = np.random.default_rng(seed=0) pd_cat = pd.Categorical( pd.Series( rng.choice(list(string.ascii_letters + string.digits), nelem), diff --git a/python/cudf/cudf/tests/test_column.py b/python/cudf/cudf/tests/test_column.py index 732dbeaab34..6073c4e6434 100644 --- a/python/cudf/cudf/tests/test_column.py +++ b/python/cudf/cudf/tests/test_column.py @@ -155,7 +155,9 @@ def test_column_slicing(pandas_input, offset, size): [cudf.Decimal128Dtype, cudf.Decimal64Dtype, cudf.Decimal32Dtype], ) def test_decimal_column_slicing(offset, size, precision, scale, decimal_type): - col = cudf.core.column.as_column(pd.Series(np.random.rand(1000))) + col = cudf.core.column.as_column( + pd.Series(np.random.default_rng(seed=0).random(1000)) + ) col = col.astype(decimal_type(precision, scale)) column_slicing_test(col, offset, size, True) diff --git a/python/cudf/cudf/tests/test_concat.py b/python/cudf/cudf/tests/test_concat.py index 8acb296e4e9..ab0f1767cd6 100644 --- a/python/cudf/cudf/tests/test_concat.py +++ b/python/cudf/cudf/tests/test_concat.py @@ -30,6 +30,7 @@ def _hide_concat_empty_dtype_warning(): def make_frames(index=None, nulls="none"): + rng = np.random.default_rng(seed=0) df = pd.DataFrame( { "x": range(10), @@ -51,7 +52,7 @@ def make_frames(index=None, nulls="none"): df2.y = np.full_like(df2.y, np.nan) if nulls == "some": mask = np.arange(10) - np.random.shuffle(mask) + rng.shuffle(mask) mask = mask[:5] df.loc[mask, "y"] = np.nan df2.loc[mask, "y"] = np.nan diff --git a/python/cudf/cudf/tests/test_copying.py b/python/cudf/cudf/tests/test_copying.py index 2d883916d58..f33cfe268a3 100644 --- a/python/cudf/cudf/tests/test_copying.py +++ b/python/cudf/cudf/tests/test_copying.py @@ -17,7 +17,7 @@ @pytest.mark.parametrize("dtype", NUMERIC_TYPES + OTHER_TYPES) def test_repeat(dtype): rng = np.random.default_rng(seed=0) - arr = np.random.rand(10) * 10 + arr = rng.random(10) * 10 repeats = rng.integers(10, size=10) psr = pd.Series(arr).astype(dtype) gsr = cudf.from_pandas(psr) @@ -48,7 +48,8 @@ def test_repeat_dataframe(): @pytest.mark.parametrize("dtype", NUMERIC_TYPES) def test_repeat_scalar(dtype): - arr = np.random.rand(10) * 10 + rng = np.random.default_rng(seed=0) + arr = rng.random(10) * 10 repeats = 10 psr = pd.Series(arr).astype(dtype) gsr = cudf.from_pandas(psr) diff --git a/python/cudf/cudf/tests/test_csv.py b/python/cudf/cudf/tests/test_csv.py index d371ddff09d..8800275bf67 100644 --- a/python/cudf/cudf/tests/test_csv.py +++ b/python/cudf/cudf/tests/test_csv.py @@ -1770,7 +1770,7 @@ def test_csv_writer_multiindex(tmpdir): "a": rng.integers(0, 5, 20), "b": rng.integers(0, 5, 20), "c": range(20), - "d": np.random.random(20), + "d": rng.random(20), } ) gdg = gdf.groupby(["a", "b"]).mean() diff --git a/python/cudf/cudf/tests/test_dataframe.py b/python/cudf/cudf/tests/test_dataframe.py index 831c491b6bc..13260e1cb90 100644 --- a/python/cudf/cudf/tests/test_dataframe.py +++ b/python/cudf/cudf/tests/test_dataframe.py @@ -63,6 +63,9 @@ pytest_xfail = pytest.mark.skipif +rng = np.random.default_rng(seed=0) + + @contextmanager def _hide_ufunc_warnings(eval_str): # pandas raises warnings for some inputs to the following ufuncs: @@ -428,7 +431,7 @@ def test_series_init_none(): def test_dataframe_basic(): - np.random.seed(0) + rng = np.random.default_rng(seed=0) df = cudf.DataFrame() # Populate with cuda memory @@ -437,7 +440,7 @@ def test_dataframe_basic(): assert len(df) == 10 # Populate with numpy array - rnd_vals = np.random.random(10) + rnd_vals = rng.random(10) df["vals"] = rnd_vals np.testing.assert_equal(df["vals"].to_numpy(), rnd_vals) assert len(df) == 10 @@ -1239,7 +1242,7 @@ def test_empty_dataframe_to_cupy(): df = cudf.DataFrame() nelem = 123 for k in "abc": - df[k] = np.random.random(nelem) + df[k] = rng.random(nelem) # Check all columns in empty dataframe. mat = df.head(0).to_cupy() @@ -1251,7 +1254,7 @@ def test_dataframe_to_cupy(): nelem = 123 for k in "abcd": - df[k] = np.random.random(nelem) + df[k] = rng.random(nelem) # Check all columns mat = df.to_cupy() @@ -1280,7 +1283,7 @@ def test_dataframe_to_cupy_null_values(): refvalues = {} for k in "abcd": - df[k] = data = np.random.random(nelem) + df[k] = data = rng.random(nelem) bitmask = utils.random_bitmask(nelem) df[k] = df[k]._column.set_mask(bitmask) boolmask = np.asarray( @@ -1321,10 +1324,10 @@ def test_dataframe_append_empty(): def test_dataframe_setitem_from_masked_object(): - ary = np.random.randn(100) + ary = rng.standard_normal(100) mask = np.zeros(100, dtype=bool) mask[:20] = True - np.random.shuffle(mask) + rng.shuffle(mask) ary[mask] = np.nan test1_null = cudf.Series(ary, nan_as_null=True) @@ -1749,8 +1752,9 @@ def test_concat_with_axis(): assert_eq(concat_cdf_s, concat_s, check_index_type=True) + rng = np.random.default_rng(seed=0) # concat series and dataframes - s3 = pd.Series(np.random.random(5)) + s3 = pd.Series(rng.random(5)) cs3 = cudf.Series.from_pandas(s3) concat_cdf_all = cudf.concat([cdf1, cs3, cdf2], axis=1) @@ -2651,8 +2655,8 @@ def test_unaryops_df(pdf, unaryop, col_name, assign_col_name): def test_df_abs(pdf): - np.random.seed(0) - disturbance = pd.Series(np.random.rand(10)) + rng = np.random.default_rng(seed=0) + disturbance = pd.Series(rng.random(10)) pdf = pdf - 5 + disturbance d = pdf.apply(np.abs) g = cudf.from_pandas(pdf).abs() @@ -2706,7 +2710,7 @@ def test_quantile(q, numeric_only): ts = pd.date_range("2018-08-24", periods=5, freq="D") td = pd.to_timedelta(np.arange(5), unit="h") pdf = pd.DataFrame( - {"date": ts, "delta": td, "val": np.random.randn(len(ts))} + {"date": ts, "delta": td, "val": rng.standard_normal(len(ts))} ) gdf = cudf.DataFrame.from_pandas(pdf) @@ -2879,7 +2883,8 @@ def query_GPU_memory(note=""): cuda.current_context().deallocations.clear() nRows = int(1e8) nCols = 2 - dataNumpy = np.asfortranarray(np.random.rand(nRows, nCols)) + rng = np.random.default_rng(seed=0) + dataNumpy = np.asfortranarray(rng.random(nRows, nCols)) colNames = ["col" + str(iCol) for iCol in range(nCols)] pandasDF = pd.DataFrame(data=dataNumpy, columns=colNames, dtype=np.float32) cudaDF = cudf.core.DataFrame.from_pandas(pandasDF) @@ -2991,7 +2996,8 @@ def test_arrow_handle_no_index_name(pdf, gdf): def test_pandas_non_contiguious(): - arr1 = np.random.sample([5000, 10]) + rng = np.random.default_rng(seed=0) + arr1 = rng.random(size=(5000, 10)) assert arr1.flags["C_CONTIGUOUS"] is True df = pd.DataFrame(arr1) for col in df.columns: @@ -3310,7 +3316,7 @@ def test_set_index_verify_integrity(data, index, verify_integrity): def test_set_index_multi(drop, nelem): rng = np.random.default_rng(seed=0) a = np.arange(nelem) - np.random.shuffle(a) + rng.shuffle(a) df = pd.DataFrame( { "a": a, @@ -3894,7 +3900,7 @@ def test_select_dtype_datetime_with_frequency(): def test_dataframe_describe_exclude(): - np.random.seed(12) + rng = np.random.default_rng(seed=0) data_length = 10000 df = cudf.DataFrame() @@ -3910,7 +3916,7 @@ def test_dataframe_describe_exclude(): def test_dataframe_describe_include(): - np.random.seed(12) + rng = np.random.default_rng(seed=0) data_length = 10000 df = cudf.DataFrame() @@ -3925,7 +3931,7 @@ def test_dataframe_describe_include(): def test_dataframe_describe_default(): - np.random.seed(12) + rng = np.random.default_rng(seed=0) data_length = 10000 df = cudf.DataFrame() @@ -3939,7 +3945,7 @@ def test_dataframe_describe_default(): def test_series_describe_include_all(): - np.random.seed(12) + rng = np.random.default_rng(seed=0) data_length = 10000 df = cudf.DataFrame() @@ -3962,7 +3968,7 @@ def test_series_describe_include_all(): def test_dataframe_describe_percentiles(): - np.random.seed(12) + rng = np.random.default_rng(seed=0) data_length = 10000 sample_percentiles = [0.0, 0.1, 0.33, 0.84, 0.4, 0.99] @@ -6698,8 +6704,8 @@ def test_dataframe_init_1d_list(data, columns): (cupy.array([11, 123, -2342, 232]), ["z"], [0, 1, 1, 0]), (cupy.array([11, 123, -2342, 232]), ["z"], [1, 2, 3, 4]), (cupy.array([11, 123, -2342, 232]), ["z"], ["a", "z", "d", "e"]), - (np.random.randn(2, 4), ["a", "b", "c", "d"], ["a", "b"]), - (np.random.randn(2, 4), ["a", "b", "c", "d"], [1, 0]), + (rng.standard_normal(size=(2, 4)), ["a", "b", "c", "d"], ["a", "b"]), + (rng.standard_normal(size=(2, 4)), ["a", "b", "c", "d"], [1, 0]), (cupy.random.randn(2, 4), ["a", "b", "c", "d"], ["a", "b"]), (cupy.random.randn(2, 4), ["a", "b", "c", "d"], [1, 0]), ], @@ -6874,7 +6880,7 @@ def test_dataframe_info_basic(): """ ) df = pd.DataFrame( - np.random.randn(10, 10), + rng.standard_normal(size=(10, 10)), index=["a", "2", "3", "4", "5", "6", "7", "8", "100", "1111"], ) cudf.from_pandas(df).info(buf=buffer, verbose=True) @@ -9374,8 +9380,8 @@ def test_dataframe_roundtrip_arrow_struct_dtype(gdf): def test_dataframe_setitem_cupy_array(): - np.random.seed(0) - pdf = pd.DataFrame(np.random.randn(10, 2)) + rng = np.random.default_rng(seed=0) + pdf = pd.DataFrame(rng.standard_normal(size=(10, 2))) gdf = cudf.from_pandas(pdf) gpu_array = cupy.array([True, False] * 5) @@ -10529,11 +10535,12 @@ def test_dataframe_init_length_error(data, index): def test_dataframe_binop_with_mixed_date_types(): + rng = np.random.default_rng(seed=0) df = pd.DataFrame( - np.random.rand(2, 2), + rng.random(2, 2), columns=pd.Index(["2000-01-03", "2000-01-04"], dtype="datetime64[ns]"), ) - ser = pd.Series(np.random.rand(3), index=[0, 1, 2]) + ser = pd.Series(rng.random(3), index=[0, 1, 2]) gdf = cudf.from_pandas(df) gser = cudf.from_pandas(ser) expected = df - ser @@ -10542,9 +10549,10 @@ def test_dataframe_binop_with_mixed_date_types(): def test_dataframe_binop_with_mixed_string_types(): - df1 = pd.DataFrame(np.random.rand(3, 3), columns=pd.Index([0, 1, 2])) + rng = np.random.default_rng(seed=0) + df1 = pd.DataFrame(rng.random(size=(3, 3)), columns=pd.Index([0, 1, 2])) df2 = pd.DataFrame( - np.random.rand(6, 6), + rng.random(size=(6, 6)), columns=pd.Index([0, 1, 2, "VhDoHxRaqt", "X0NNHBIPfA", "5FbhPtS0D1"]), ) gdf1 = cudf.from_pandas(df1) @@ -10557,7 +10565,8 @@ def test_dataframe_binop_with_mixed_string_types(): def test_dataframe_binop_and_where(): - df = pd.DataFrame(np.random.rand(2, 2), columns=pd.Index([True, False])) + rng = np.random.default_rng(seed=0) + df = pd.DataFrame(rng.random(size=(2, 2)), columns=pd.Index([True, False])) gdf = cudf.from_pandas(df) expected = df > 1 @@ -10572,12 +10581,13 @@ def test_dataframe_binop_and_where(): def test_dataframe_binop_with_datetime_index(): + rng = np.random.default_rng(seed=0) df = pd.DataFrame( - np.random.rand(2, 2), + rng.random(size=(2, 2)), columns=pd.Index(["2000-01-03", "2000-01-04"], dtype="datetime64[ns]"), ) ser = pd.Series( - np.random.rand(2), + rng.random(2), index=pd.Index( [ "2000-01-04", @@ -10615,8 +10625,8 @@ def test_dataframe_dict_like_with_columns(columns, index): def test_dataframe_init_columns_named_multiindex(): - np.random.seed(0) - data = np.random.randn(2, 2) + rng = np.random.default_rng(seed=0) + data = rng.standard_normal(size=(2, 2)) columns = cudf.MultiIndex.from_tuples( [("A", "one"), ("A", "two")], names=["y", "z"] ) @@ -10627,8 +10637,8 @@ def test_dataframe_init_columns_named_multiindex(): def test_dataframe_init_columns_named_index(): - np.random.seed(0) - data = np.random.randn(2, 2) + rng = np.random.default_rng(seed=0) + data = rng.standard_normal(size=(2, 2)) columns = pd.Index(["a", "b"], name="custom_name") gdf = cudf.DataFrame(data, columns=columns) pdf = pd.DataFrame(data, columns=columns) diff --git a/python/cudf/cudf/tests/test_datetime.py b/python/cudf/cudf/tests/test_datetime.py index e09a9a386a7..14b53569860 100644 --- a/python/cudf/cudf/tests/test_datetime.py +++ b/python/cudf/cudf/tests/test_datetime.py @@ -216,17 +216,21 @@ def test_setitem_datetime(): def test_sort_datetime(): - df = pd.DataFrame() - df["date"] = np.array( - [ - np.datetime64("2016-11-20"), - np.datetime64("2020-11-20"), - np.datetime64("2019-11-20"), - np.datetime64("1918-11-20"), - np.datetime64("2118-11-20"), - ] + rng = np.random.default_rng(seed=0) + df = pd.DataFrame( + { + "data": np.array( + [ + np.datetime64("2016-11-20"), + np.datetime64("2020-11-20"), + np.datetime64("2019-11-20"), + np.datetime64("1918-11-20"), + np.datetime64("2118-11-20"), + ] + ), + "vals": rng.random(5), + } ) - df["vals"] = np.random.sample(len(df["date"])) gdf = cudf.from_pandas(df) diff --git a/python/cudf/cudf/tests/test_duplicates.py b/python/cudf/cudf/tests/test_duplicates.py index dcff4f2f07a..67dd7a8388b 100644 --- a/python/cudf/cudf/tests/test_duplicates.py +++ b/python/cudf/cudf/tests/test_duplicates.py @@ -368,9 +368,13 @@ def test_dataframe_drop_duplicates_method(): def test_datetime_drop_duplicates(): - date_df = cudf.DataFrame() - date_df["date"] = pd.date_range("11/20/2018", periods=6, freq="D") - date_df["value"] = np.random.sample(len(date_df)) + rng = np.random.default_rng(seed=0) + date_df = cudf.DataFrame( + { + "date": pd.date_range("11/20/2018", periods=6, freq="D"), + "value": rng.random(6), + } + ) df = concat([date_df, date_df[:4]]) assert_eq(df[:-4], df.drop_duplicates()) diff --git a/python/cudf/cudf/tests/test_groupby.py b/python/cudf/cudf/tests/test_groupby.py index 75eeb72a3af..6b9fad8e0b7 100644 --- a/python/cudf/cudf/tests/test_groupby.py +++ b/python/cudf/cudf/tests/test_groupby.py @@ -86,9 +86,9 @@ def make_frame( for lvl in extra_levels: df[lvl] = rng.integers(0, 2, nelem) - df["val"] = np.random.random(nelem) + df["val"] = rng.random(nelem) for val in extra_vals: - df[val] = np.random.random(nelem) + df[val] = rng.random(nelem) if with_datetime: df["datetime"] = rng.integers( @@ -266,9 +266,10 @@ def test_groupby_getitem_getattr(as_index): def test_groupby_cats(): - df = DataFrame() - df["cats"] = pd.Categorical(list("aabaacaab")) - df["vals"] = np.random.random(len(df)) + rng = np.random.default_rng(seed=0) + df = DataFrame( + {"cats": pd.Categorical(list("aabaacaab")), "vals": rng.random(9)} + ) cats = df["cats"].values_host vals = df["vals"].to_numpy() @@ -291,8 +292,8 @@ def test_groupby_iterate_groups(): { "key1": rng.integers(0, 3, nelem), "key2": rng.integers(0, 2, nelem), - "val1": np.random.random(nelem), - "val2": np.random.random(nelem), + "val1": rng.random(nelem), + "val2": rng.random(nelem), } ) @@ -316,8 +317,8 @@ def test_groupby_apply(): { "key1": rng.integers(0, 3, nelem), "key2": rng.integers(0, 2, nelem), - "val1": np.random.random(nelem), - "val2": np.random.random(nelem), + "val1": rng.random(nelem), + "val2": rng.random(nelem), } ) @@ -363,8 +364,8 @@ def test_groupby_apply_args(func, args): { "key1": rng.integers(0, 3, nelem), "key2": rng.integers(0, 2, nelem), - "val1": np.random.random(nelem), - "val2": np.random.random(nelem), + "val1": rng.random(nelem), + "val2": rng.random(nelem), } ) @@ -378,7 +379,6 @@ def test_groupby_apply_args(func, args): def test_groupby_apply_grouped(): - np.random.seed(0) df = DataFrame() nelem = 20 df["key1"] = range(nelem) @@ -1019,6 +1019,7 @@ def test_groupby_2keys_agg(nelem, func): # "func", ["min", "max", "idxmin", "idxmax", "count", "sum"], ) def test_groupby_agg_decimal(num_groups, nelem_per_group, func): + rng = np.random.default_rng(seed=0) # The number of digits after the decimal to use. decimal_digits = 2 # The number of digits before the decimal to use. @@ -1035,8 +1036,8 @@ def test_groupby_agg_decimal(num_groups, nelem_per_group, func): # https://github.com/pandas-dev/pandas/issues/40685). However, if that is # ever enabled, then this issue will crop up again so we may as well have # it fixed now. - x = np.unique((np.random.rand(nelem) * scale).round(decimal_digits)) - y = np.unique((np.random.rand(nelem) * scale).round(decimal_digits)) + x = np.unique((rng.random(nelem) * scale).round(decimal_digits)) + y = np.unique((rng.random(nelem) * scale).round(decimal_digits)) if x.size < y.size: total_elements = x.size @@ -1322,7 +1323,7 @@ def test_empty_groupby(func): def test_groupby_unsupported_columns(): - np.random.seed(12) + rng = np.random.default_rng(seed=0) pd_cat = pd.Categorical( pd.Series(rng.choice(["a", "b", 1], 3), dtype="category") ) diff --git a/python/cudf/cudf/tests/test_indexing.py b/python/cudf/cudf/tests/test_indexing.py index 305d679ba2f..3145c48c0cb 100644 --- a/python/cudf/cudf/tests/test_indexing.py +++ b/python/cudf/cudf/tests/test_indexing.py @@ -32,7 +32,8 @@ def pdf_gdf(): @pytest.fixture def pdf_gdf_multi(): - pdf = pd.DataFrame(np.random.rand(7, 5)) + rng = np.random.default_rng(seed=0) + pdf = pd.DataFrame(rng.random(size=(7, 5))) pdfIndex = pd.MultiIndex( [ ["a", "b", "c"], @@ -220,7 +221,7 @@ def test_dataframe_column_name_indexing(): "key1": rng.integers(0, 5, nelem), "key2": rng.integers(0, 3, nelem), 1: np.arange(1, 1 + nelem), - 2: np.random.random(nelem), + 2: rng.random(nelem), } ) df = cudf.from_pandas(pdf) @@ -248,9 +249,9 @@ def test_dataframe_slicing(): df = cudf.DataFrame() size = 123 df["a"] = ha = rng.integers(low=0, high=100, size=size).astype(np.int32) - df["b"] = hb = np.random.random(size).astype(np.float32) + df["b"] = hb = rng.random(size).astype(np.float32) df["c"] = hc = rng.integers(low=0, high=100, size=size).astype(np.int64) - df["d"] = hd = np.random.random(size).astype(np.float64) + df["d"] = hd = rng.random(size).astype(np.float64) # Row slice first 10 first_10 = df[:10] @@ -293,9 +294,9 @@ def test_dataframe_loc(scalar, step): pdf = pd.DataFrame( { "a": rng.integers(low=0, high=100, size=size), - "b": np.random.random(size).astype(np.float32), - "c": np.random.random(size).astype(np.float64), - "d": np.random.random(size).astype(np.float64), + "b": rng.random(size).astype(np.float32), + "c": rng.random(size).astype(np.float64), + "d": rng.random(size).astype(np.float64), } ) pdf.index.name = "index" @@ -399,7 +400,7 @@ def test_dataframe_loc_outbound(): df = cudf.DataFrame() size = 10 df["a"] = ha = rng.integers(low=0, high=100, size=size).astype(np.int32) - df["b"] = hb = np.random.random(size).astype(np.float32) + df["b"] = hb = rng.random(size).astype(np.float32) pdf = pd.DataFrame() pdf["a"] = ha @@ -592,8 +593,8 @@ def test_dataframe_series_loc_multiindex(obj): @pytest.mark.parametrize("nelem", [2, 5, 20, 100]) def test_series_iloc(nelem): # create random cudf.Series - np.random.seed(12) - ps = pd.Series(np.random.sample(nelem)) + rng = np.random.default_rng(seed=0) + ps = pd.Series(rng.sample(nelem)) # gpu cudf.Series gs = cudf.Series(ps) @@ -631,7 +632,7 @@ def test_dataframe_iloc(nelem): gdf = cudf.DataFrame() gdf["a"] = ha = rng.integers(low=0, high=100, size=nelem).astype(np.int32) - gdf["b"] = hb = np.random.random(nelem).astype(np.float32) + gdf["b"] = hb = rng.random(nelem).astype(np.float32) pdf = pd.DataFrame() pdf["a"] = ha @@ -684,7 +685,7 @@ def test_dataframe_iloc_tuple(): gdf = cudf.DataFrame() nelem = 123 gdf["a"] = ha = rng.integers(low=0, high=100, size=nelem).astype(np.int32) - gdf["b"] = hb = np.random.random(nelem).astype(np.float32) + gdf["b"] = hb = rng.random(nelem).astype(np.float32) pdf = pd.DataFrame() pdf["a"] = ha @@ -699,7 +700,7 @@ def test_dataframe_iloc_index_error(): gdf = cudf.DataFrame() nelem = 123 gdf["a"] = ha = rng.integers(low=0, high=100, size=nelem).astype(np.int32) - gdf["b"] = hb = np.random.random(nelem).astype(np.float32) + gdf["b"] = hb = rng.random(nelem).astype(np.float32) pdf = pd.DataFrame() pdf["a"] = ha @@ -718,7 +719,7 @@ def test_dataframe_take(ntake): df = cudf.DataFrame( { "ii": rng.integers(0, 20, nelem), - "ff": np.random.random(nelem), + "ff": rng.random(nelem), } ) @@ -744,7 +745,7 @@ def test_dataframe_take_with_multiindex(ntake): nelem = 9 df["ii"] = rng.integers(0, 20, nelem) - df["ff"] = np.random.random(nelem) + df["ff"] = rng.random(nelem) take_indices = rng.integers(0, len(df), ntake) @@ -1812,6 +1813,7 @@ def test_boolean_mask_columns_iloc_series(): @pytest.mark.parametrize("index_type", ["single", "slice"]) def test_loc_timestamp_issue_8585(index_type): + rng = np.random.default_rng(seed=0) # https://github.com/rapidsai/cudf/issues/8585 start = pd.Timestamp( datetime.strptime("2021-03-12 00:00", "%Y-%m-%d %H:%M") @@ -1853,6 +1855,7 @@ def test_loc_timestamp_issue_8585(index_type): ], ) def test_loc_multiindex_timestamp_issue_8585(index_type): + rng = np.random.default_rng(seed=0) # https://github.com/rapidsai/cudf/issues/8585 start = pd.Timestamp( datetime.strptime("2021-03-12 00:00", "%Y-%m-%d %H:%M") diff --git a/python/cudf/cudf/tests/test_joining.py b/python/cudf/cudf/tests/test_joining.py index 32a90b25791..f6941ce7fae 100644 --- a/python/cudf/cudf/tests/test_joining.py +++ b/python/cudf/cudf/tests/test_joining.py @@ -45,8 +45,8 @@ def make_params(): yield (aa, bb, how) # Test floating point inputs - aa = np.random.random(50) - bb = np.random.random(50) + aa = rng.random(50) + bb = rng.random(50) for how in hows: yield (aa, bb, how) @@ -162,7 +162,7 @@ def _check_series(expect, got): reason="bug in older version of pandas", ) def test_dataframe_join_suffix(): - np.random.seed(0) + rng = np.random.default_rng(seed=0) df = cudf.DataFrame(rng.integers(0, 5, (5, 3)), columns=list("abc")) @@ -281,7 +281,7 @@ def test_dataframe_join_mismatch_cats(how): @pytest.mark.parametrize("on", ["key1", ["key1", "key2"], None]) def test_dataframe_merge_on(on): - np.random.seed(0) + rng = np.random.default_rng(seed=0) # Make cuDF df_left = cudf.DataFrame() @@ -347,7 +347,7 @@ def test_dataframe_merge_on(on): def test_dataframe_merge_on_unknown_column(): - np.random.seed(0) + rng = np.random.default_rng(seed=0) # Make cuDF df_left = cudf.DataFrame() @@ -368,7 +368,7 @@ def test_dataframe_merge_on_unknown_column(): def test_dataframe_merge_no_common_column(): - np.random.seed(0) + rng = np.random.default_rng(seed=0) # Make cuDF df_left = cudf.DataFrame() @@ -460,7 +460,7 @@ def test_dataframe_merge_order(): @pytest.mark.parametrize("rows", [1, 5, 100]) @pytest.mark.parametrize("how", ["left", "inner", "outer"]) def test_dataframe_pairs_of_triples(pairs, max, rows, how): - np.random.seed(0) + rng = np.random.default_rng(seed=0) pdf_left = pd.DataFrame() pdf_right = pd.DataFrame() @@ -504,7 +504,7 @@ def test_dataframe_pairs_of_triples(pairs, max, rows, how): def test_safe_merging_with_left_empty(): - np.random.seed(0) + rng = np.random.default_rng(seed=0) pairs = ("bcd", "b") pdf_left = pd.DataFrame() diff --git a/python/cudf/cudf/tests/test_json.py b/python/cudf/cudf/tests/test_json.py index 9a967c54202..47976fc4bac 100644 --- a/python/cudf/cudf/tests/test_json.py +++ b/python/cudf/cudf/tests/test_json.py @@ -32,6 +32,7 @@ def make_numeric_dataframe(nrows, dtype): @pytest.fixture(params=[0, 1, 10, 100]) def pdf(request): + rng = np.random.default_rng(seed=0) types = NUMERIC_TYPES + DATETIME_TYPES + ["bool"] nrows = request.param diff --git a/python/cudf/cudf/tests/test_monotonic.py b/python/cudf/cudf/tests/test_monotonic.py index 790e84559a9..a34c89f55d3 100644 --- a/python/cudf/cudf/tests/test_monotonic.py +++ b/python/cudf/cudf/tests/test_monotonic.py @@ -164,7 +164,8 @@ def test_series(testlist): def test_multiindex(): - pdf = pd.DataFrame(np.random.rand(7, 5)) + rng = np.random.default_rng(seed=0) + pdf = pd.DataFrame(rng.random(size=(7, 5))) pdf.index = pd.MultiIndex( [ ["a", "b", "c"], diff --git a/python/cudf/cudf/tests/test_multiindex.py b/python/cudf/cudf/tests/test_multiindex.py index 65e898d5769..ad0e0858c43 100644 --- a/python/cudf/cudf/tests/test_multiindex.py +++ b/python/cudf/cudf/tests/test_multiindex.py @@ -153,7 +153,8 @@ def test_multiindex_swaplevel(): def test_string_index(): - pdf = pd.DataFrame(np.random.rand(5, 5)) + rng = np.random.default_rng(seed=0) + pdf = pd.DataFrame(rng.random(size=(5, 5))) gdf = cudf.from_pandas(pdf) stringIndex = ["a", "b", "c", "d", "e"] pdf.index = stringIndex @@ -176,7 +177,8 @@ def test_string_index(): def test_multiindex_row_shape(): - pdf = pd.DataFrame(np.random.rand(0, 5)) + rng = np.random.default_rng(seed=0) + pdf = pd.DataFrame(rng.random(size=(0, 5))) gdf = cudf.from_pandas(pdf) pdfIndex = pd.MultiIndex([["a", "b", "c"]], [[0]]) pdfIndex.names = ["alpha"] @@ -193,7 +195,8 @@ def test_multiindex_row_shape(): @pytest.fixture def pdf(): - return pd.DataFrame(np.random.rand(7, 5)) + rng = np.random.default_rng(seed=0) + return pd.DataFrame(rng.random(size=(7, 5))) @pytest.fixture @@ -271,7 +274,8 @@ def test_from_pandas_series(): def test_series_multiindex(pdfIndex): - ps = pd.Series(np.random.rand(7)) + rng = np.random.default_rng(seed=0) + ps = pd.Series(rng.random(7)) gs = cudf.from_pandas(ps) ps.index = pdfIndex gs.index = cudf.from_pandas(pdfIndex) @@ -439,7 +443,8 @@ def test_multiindex_loc_rows_1_1_key(pdf, gdf, pdfIndex): def test_multiindex_column_shape(): - pdf = pd.DataFrame(np.random.rand(5, 0)) + rng = np.random.default_rng(seed=0) + pdf = pd.DataFrame(rng.random(size=(5, 0))) gdf = cudf.from_pandas(pdf) pdfIndex = pd.MultiIndex([["a", "b", "c"]], [[0]]) pdfIndex.names = ["alpha"] @@ -522,9 +527,13 @@ def test_multiindex_from_product(arrays): def test_multiindex_index_and_columns(): - gdf = cudf.DataFrame() - gdf["x"] = rng.integers(0, 5, 5) - gdf["y"] = rng.integers(0, 5, 5) + rng = np.random.default_rng(seed=0) + gdf = cudf.DataFrame( + { + "x": rng.integers(0, 5, 5), + "y": rng.integers(0, 5, 5), + } + ) pdf = gdf.to_pandas() mi = cudf.MultiIndex( levels=[[0, 1, 2], [3, 4]], @@ -542,6 +551,7 @@ def test_multiindex_index_and_columns(): def test_multiindex_multiple_groupby(): + rng = np.random.default_rng(seed=0) pdf = pd.DataFrame( { "a": [4, 17, 4, 9, 5], @@ -566,6 +576,7 @@ def test_multiindex_multiple_groupby(): ], ) def test_multi_column(func): + rng = np.random.default_rng(seed=0) pdf = pd.DataFrame( { "x": rng.integers(0, 5, size=1000), diff --git a/python/cudf/cudf/tests/test_orc.py b/python/cudf/cudf/tests/test_orc.py index e7ca0c67148..a259209bed9 100644 --- a/python/cudf/cudf/tests/test_orc.py +++ b/python/cudf/cudf/tests/test_orc.py @@ -681,7 +681,6 @@ def test_orc_write_statistics(tmpdir, datadir, nrows, stats_freq): def test_orc_chunked_write_statistics(tmpdir, datadir, nrows, stats_freq): from pyarrow import orc - np.random.seed(0) supported_stat_types = supported_numpy_dtypes + ["str"] # Writing bool columns to multiple row groups is disabled # until #6763 is fixed @@ -845,7 +844,6 @@ def test_orc_reader_gmt_timestamps(datadir): def test_orc_bool_encode_fail(): - np.random.seed(0) buffer = BytesIO() # Generate a boolean column longer than a single row group @@ -927,7 +925,6 @@ def test_empty_string_columns(data): [cudf.Decimal32Dtype, cudf.Decimal64Dtype, cudf.Decimal128Dtype], ) def test_orc_writer_decimal(tmpdir, scale, decimal_type): - np.random.seed(0) fname = tmpdir / "decimal.orc" expected = cudf.DataFrame({"dec_val": gen_rand_series("i", 100)}) @@ -988,7 +985,7 @@ def test_orc_string_stream_offset_issue(): def generate_list_struct_buff(size=100_000): rd = random.Random(1) - np.random.seed(seed=1) + rng = np.random.default_rng(seed=0) buff = BytesIO() @@ -1135,7 +1132,7 @@ def gen_map_buff(size): from pyarrow import orc rd = random.Random(1) - np.random.seed(seed=1) + rng = np.random.default_rng(seed=0) buff = BytesIO() diff --git a/python/cudf/cudf/tests/test_pack.py b/python/cudf/cudf/tests/test_pack.py index ad78621c5fa..b474bbe9bd8 100644 --- a/python/cudf/cudf/tests/test_pack.py +++ b/python/cudf/cudf/tests/test_pack.py @@ -24,11 +24,11 @@ def test_sizeof_packed_dataframe(): - np.random.seed(0) + rng = np.random.default_rng(seed=0) df = DataFrame() nelem = 1000 df["keys"] = hkeys = np.arange(nelem, dtype=np.float64) - df["vals"] = hvals = np.random.random(nelem) + df["vals"] = hvals = rng.random(nelem) packed = pack(df) nbytes = hkeys.nbytes + hvals.nbytes @@ -67,46 +67,46 @@ def assert_packed_frame_equality(df): def test_packed_dataframe_equality_numeric(): - np.random.seed(0) + rng = np.random.default_rng(seed=0) df = DataFrame() nelem = 10 df["keys"] = np.arange(nelem, dtype=np.float64) - df["vals"] = np.random.random(nelem) + df["vals"] = rng.random(nelem) check_packed_equality(df) def test_packed_dataframe_equality_categorical(): - np.random.seed(0) + rng = np.random.default_rng(seed=0) df = DataFrame() df["keys"] = pd.Categorical( ["a", "a", "a", "b", "a", "b", "a", "b", "a", "c"] ) - df["vals"] = np.random.random(len(df)) + df["vals"] = rng.random(len(df)) check_packed_equality(df) def test_packed_dataframe_equality_list(): - np.random.seed(0) + rng = np.random.default_rng(seed=0) df = DataFrame() df["keys"] = Series(list([i, i + 1, i + 2] for i in range(10))) - df["vals"] = np.random.random(len(df)) + df["vals"] = rng.random(len(df)) check_packed_equality(df) def test_packed_dataframe_equality_struct(): - np.random.seed(0) + rng = np.random.default_rng(seed=0) df = DataFrame() df["keys"] = Series( list({"0": i, "1": i + 1, "2": i + 2} for i in range(10)) ) - df["vals"] = np.random.random(len(df)) + df["vals"] = rng.random(len(df)) check_packed_equality(df) @@ -135,46 +135,46 @@ def assert_packed_frame_unique_pointers(df): def test_packed_dataframe_unique_pointers_numeric(): - np.random.seed(0) + rng = np.random.default_rng(seed=0) df = DataFrame() nelem = 10 df["keys"] = np.arange(nelem, dtype=np.float64) - df["vals"] = np.random.random(nelem) + df["vals"] = rng.random(nelem) check_packed_unique_pointers(df) def test_packed_dataframe_unique_pointers_categorical(): - np.random.seed(0) + rng = np.random.default_rng(seed=0) df = DataFrame() df["keys"] = pd.Categorical( ["a", "a", "a", "b", "a", "b", "a", "b", "a", "c"] ) - df["vals"] = np.random.random(len(df)) + df["vals"] = rng.random(len(df)) check_packed_unique_pointers(df) def test_packed_dataframe_unique_pointers_list(): - np.random.seed(0) + rng = np.random.default_rng(seed=0) df = DataFrame() df["keys"] = Series(list([i, i + 1, i + 2] for i in range(10))) - df["vals"] = np.random.random(len(df)) + df["vals"] = rng.random(len(df)) check_packed_unique_pointers(df) def test_packed_dataframe_unique_pointers_struct(): - np.random.seed(0) + rng = np.random.default_rng(seed=0) df = DataFrame() df["keys"] = Series( list({"0": i, "1": i + 1, "2": i + 2} for i in range(10)) ) - df["vals"] = np.random.random(len(df)) + df["vals"] = rng.random(len(df)) check_packed_unique_pointers(df) @@ -208,46 +208,46 @@ def assert_packed_frame_picklable(df): def test_pickle_packed_dataframe_numeric(): - np.random.seed(0) + rng = np.random.default_rng(seed=0) df = DataFrame() nelem = 10 df["keys"] = np.arange(nelem, dtype=np.float64) - df["vals"] = np.random.random(nelem) + df["vals"] = rng.random(nelem) check_packed_pickled_equality(df) def test_pickle_packed_dataframe_categorical(): - np.random.seed(0) + rng = np.random.default_rng(seed=0) df = DataFrame() df["keys"] = pd.Categorical( ["a", "a", "a", "b", "a", "b", "a", "b", "a", "c"] ) - df["vals"] = np.random.random(len(df)) + df["vals"] = rng.random(len(df)) check_packed_pickled_equality(df) def test_pickle_packed_dataframe_list(): - np.random.seed(0) + rng = np.random.default_rng(seed=0) df = DataFrame() df["keys"] = Series(list([i, i + 1, i + 2] for i in range(10))) - df["vals"] = np.random.random(len(df)) + df["vals"] = rng.random(len(df)) check_packed_pickled_equality(df) def test_pickle_packed_dataframe_struct(): - np.random.seed(0) + rng = np.random.default_rng(seed=0) df = DataFrame() df["keys"] = Series( list({"0": i, "1": i + 1, "2": i + 2} for i in range(10)) ) - df["vals"] = np.random.random(len(df)) + df["vals"] = rng.random(len(df)) check_packed_pickled_equality(df) @@ -273,45 +273,45 @@ def assert_packed_frame_serializable(df): def test_serialize_packed_dataframe_numeric(): - np.random.seed(0) + rng = np.random.default_rng(seed=0) df = DataFrame() nelem = 10 df["keys"] = np.arange(nelem, dtype=np.float64) - df["vals"] = np.random.random(nelem) + df["vals"] = rng.random(nelem) check_packed_serialized_equality(df) def test_serialize_packed_dataframe_categorical(): - np.random.seed(0) + rng = np.random.default_rng(seed=0) df = DataFrame() df["keys"] = pd.Categorical( ["a", "a", "a", "b", "a", "b", "a", "b", "a", "c"] ) - df["vals"] = np.random.random(len(df)) + df["vals"] = rng.random(len(df)) check_packed_serialized_equality(df) def test_serialize_packed_dataframe_list(): - np.random.seed(0) + rng = np.random.default_rng(seed=0) df = DataFrame() df["keys"] = Series(list([i, i + 1, i + 2] for i in range(10))) - df["vals"] = np.random.random(len(df)) + df["vals"] = rng.random(len(df)) check_packed_serialized_equality(df) def test_serialize_packed_dataframe_struct(): - np.random.seed(0) + rng = np.random.default_rng(seed=0) df = DataFrame() df["keys"] = Series( list({"0": i, "1": i + 1, "2": i + 2} for i in range(10)) ) - df["vals"] = np.random.random(len(df)) + df["vals"] = rng.random(len(df)) check_packed_serialized_equality(df) diff --git a/python/cudf/cudf/tests/test_parquet.py b/python/cudf/cudf/tests/test_parquet.py index 55c20ef4f8d..6d3ff918673 100644 --- a/python/cudf/cudf/tests/test_parquet.py +++ b/python/cudf/cudf/tests/test_parquet.py @@ -53,6 +53,7 @@ def datadir(datadir): @pytest.fixture(params=[1, 5, 10, 100000]) def simple_pdf(request): + rng = np.random.default_rng(seed=0) types = [ "bool", "int8", @@ -92,6 +93,7 @@ def simple_gdf(simple_pdf): def build_pdf(num_columns, day_resolution_timestamps): + rng = np.random.default_rng(seed=0) types = [ "bool", "int8", @@ -1909,6 +1911,7 @@ def test_parquet_writer_dictionary_setting(use_dict, max_dict_size): @pytest.mark.parametrize("filename", ["myfile.parquet", None]) @pytest.mark.parametrize("cols", [["b"], ["c", "b"]]) def test_parquet_partitioned(tmpdir_factory, cols, filename): + rng = np.random.default_rng(seed=0) # Checks that write_to_dataset is wrapping to_parquet # as expected gdf_dir = str(tmpdir_factory.mktemp("gdf_dir")) @@ -1954,6 +1957,7 @@ def test_parquet_partitioned(tmpdir_factory, cols, filename): @pytest.mark.parametrize("kwargs", [{"nrows": 1}, {"skip_rows": 1}]) def test_parquet_partitioned_notimplemented(tmpdir_factory, kwargs): + rng = np.random.default_rng(seed=0) # Checks that write_to_dataset is wrapping to_parquet # as expected pdf_dir = str(tmpdir_factory.mktemp("pdf_dir")) @@ -2127,6 +2131,7 @@ def test_parquet_writer_chunked_partitioned_context(tmpdir_factory): @pytest.mark.parametrize("cols", [None, ["b"]]) @pytest.mark.parametrize("store_schema", [True, False]) def test_parquet_write_to_dataset(tmpdir_factory, cols, store_schema): + rng = np.random.default_rng(seed=0) dir1 = tmpdir_factory.mktemp("dir1") dir2 = tmpdir_factory.mktemp("dir2") if cols is None: @@ -3214,6 +3219,7 @@ def test_parquet_nested_struct_list(): def test_parquet_writer_zstd(): size = 12345 + rng = np.random.default_rng(seed=0) expected = cudf.DataFrame( { "a": np.arange(0, stop=size, dtype="float64"), diff --git a/python/cudf/cudf/tests/test_pickling.py b/python/cudf/cudf/tests/test_pickling.py index 0f13a9e173a..2f10a5dfd74 100644 --- a/python/cudf/cudf/tests/test_pickling.py +++ b/python/cudf/cudf/tests/test_pickling.py @@ -40,33 +40,33 @@ def assert_frame_picklable(df): def test_pickle_dataframe_numeric(): - np.random.seed(0) + rng = np.random.default_rng(seed=0) df = DataFrame() nelem = 10 df["keys"] = np.arange(nelem, dtype=np.float64) - df["vals"] = np.random.random(nelem) + df["vals"] = rng.random(nelem) check_serialization(df) def test_pickle_dataframe_categorical(): - np.random.seed(0) + rng = np.random.default_rng(seed=0) df = DataFrame() df["keys"] = pd.Categorical( ["a", "a", "a", "b", "a", "b", "a", "b", "a", "c"] ) - df["vals"] = np.random.random(len(df)) + df["vals"] = rng.random(len(df)) check_serialization(df) def test_memory_usage_dataframe(): - np.random.seed(0) + rng = np.random.default_rng(seed=0) df = DataFrame() nelem = 1000 df["keys"] = hkeys = np.arange(nelem, dtype=np.float64) - df["vals"] = hvals = np.random.random(nelem) + df["vals"] = hvals = rng.random(nelem) nbytes = hkeys.nbytes + hvals.nbytes sizeof = df.memory_usage().sum() @@ -98,11 +98,11 @@ def test_pickle_buffer(): @pytest.mark.parametrize("named", [True, False]) def test_pickle_series(named): - np.random.seed(0) + rng = np.random.default_rng(seed=0) if named: - ser = Series(np.random.random(10), name="a") + ser = Series(rng.random(10), name="a") else: - ser = Series(np.random.random(10)) + ser = Series(rng.random(10)) pickled = pickle.dumps(ser) out = pickle.loads(pickled) diff --git a/python/cudf/cudf/tests/test_query.py b/python/cudf/cudf/tests/test_query.py index 84f735bf5b7..7685d09203e 100644 --- a/python/cudf/cudf/tests/test_query.py +++ b/python/cudf/cudf/tests/test_query.py @@ -45,10 +45,10 @@ def test_query(data, fn, nulls): # prepare nelem, seed = data expect_fn, query_expr = fn - np.random.seed(seed) + rng = np.random.default_rng(seed=0) pdf = pd.DataFrame() pdf["a"] = np.arange(nelem) - pdf["b"] = np.random.random(nelem) * nelem + pdf["b"] = rng.random(nelem) * nelem if nulls: pdf.loc[::2, "a"] = None gdf = cudf.from_pandas(pdf) @@ -71,10 +71,10 @@ def test_query_ref_env(data, fn): # prepare nelem, seed = data expect_fn, query_expr = fn - np.random.seed(seed) + rng = np.random.default_rng(seed=0) df = DataFrame() df["a"] = aa = np.arange(nelem) - df["b"] = bb = np.random.random(nelem) * nelem + df["b"] = bb = rng.random(nelem) * nelem c = 2.3 d = 1.2 # udt @@ -121,7 +121,7 @@ def test_query_local_dict(): def test_query_splitted_combine(): - np.random.seed(0) + rng = np.random.default_rng(seed=0) df = pd.DataFrame( {"x": rng.integers(0, 5, size=10), "y": rng.normal(size=10)} ) diff --git a/python/cudf/cudf/tests/test_rank.py b/python/cudf/cudf/tests/test_rank.py index 4c1d8ce92ae..4e33f91b09b 100644 --- a/python/cudf/cudf/tests/test_rank.py +++ b/python/cudf/cudf/tests/test_rank.py @@ -125,9 +125,11 @@ def test_rank_error_arguments(pdf): ) +rng = np.random.default_rng(seed=0) + sort_group_args = [ np.full((3,), np.nan), - 100 * np.random.random(10), + 100 * rng.random(10), np.full((3,), np.inf), np.full((3,), -np.inf), ] @@ -145,12 +147,9 @@ def test_rank_error_arguments(pdf): ), ) def test_series_rank_combinations(elem, dtype): - np.random.seed(0) aa = np.fromiter(chain.from_iterable(elem), np.float64).astype(dtype) - gdf = DataFrame() - df = pd.DataFrame() - gdf["a"] = aa - df["a"] = aa + gdf = DataFrame({"a": aa}) + df = pd.DataFrame({"a": aa}) ranked_gs = gdf["a"].rank(method="first") ranked_ps = df["a"].rank(method="first") # Check diff --git a/python/cudf/cudf/tests/test_reductions.py b/python/cudf/cudf/tests/test_reductions.py index 2cf6a9517a7..7513bef69da 100644 --- a/python/cudf/cudf/tests/test_reductions.py +++ b/python/cudf/cudf/tests/test_reductions.py @@ -62,7 +62,6 @@ def test_sum_string(): ) @pytest.mark.parametrize("nelem", params_sizes) def test_sum_decimal(dtype, nelem): - np.random.seed(0) data = [str(x) for x in gen_rand("int64", nelem) / 100] expected = pd.Series([Decimal(x) for x in data]).sum() @@ -73,15 +72,13 @@ def test_sum_decimal(dtype, nelem): @pytest.mark.parametrize("dtype,nelem", params) def test_product(dtype, nelem): - np.random.seed(0) + rng = np.random.default_rng(seed=0) dtype = cudf.dtype(dtype).type if cudf.dtype(dtype).kind in {"u", "i"}: data = np.ones(nelem, dtype=dtype) # Set at most 30 items to [0..2) to keep the value within 2^32 for _ in range(30): - data[rng.integers(low=0, high=nelem, size=1)] = ( - np.random.uniform() * 2 - ) + data[rng.integers(low=0, high=nelem, size=1)] = rng.uniform() * 2 else: data = gen_rand(dtype, nelem) @@ -104,7 +101,6 @@ def test_product(dtype, nelem): ], ) def test_product_decimal(dtype): - np.random.seed(0) data = [str(x) for x in gen_rand("int8", 3) / 10] expected = pd.Series([Decimal(x) for x in data]).product() @@ -153,7 +149,6 @@ def test_sum_of_squares(dtype, nelem): ], ) def test_sum_of_squares_decimal(dtype): - np.random.seed(0) data = [str(x) for x in gen_rand("int8", 3) / 10] expected = pd.Series([Decimal(x) for x in data]).pow(2).sum() @@ -186,7 +181,6 @@ def test_min(dtype, nelem): ) @pytest.mark.parametrize("nelem", params_sizes) def test_min_decimal(dtype, nelem): - np.random.seed(0) data = [str(x) for x in gen_rand("int64", nelem) / 100] expected = pd.Series([Decimal(x) for x in data]).min() @@ -219,7 +213,6 @@ def test_max(dtype, nelem): ) @pytest.mark.parametrize("nelem", params_sizes) def test_max_decimal(dtype, nelem): - np.random.seed(0) data = [str(x) for x in gen_rand("int64", nelem) / 100] expected = pd.Series([Decimal(x) for x in data]).max() @@ -256,6 +249,7 @@ def test_sum_boolean(): def test_date_minmax(): + rng = np.random.default_rng(seed=0) np_data = rng.normal(size=10**3) gdf_data = Series(np_data) diff --git a/python/cudf/cudf/tests/test_repr.py b/python/cudf/cudf/tests/test_repr.py index a892fe62b8b..bf0c97adb00 100644 --- a/python/cudf/cudf/tests/test_repr.py +++ b/python/cudf/cudf/tests/test_repr.py @@ -25,6 +25,7 @@ @pytest.mark.parametrize("dtype", repr_categories) @pytest.mark.parametrize("nrows", [0, 5, 10]) def test_null_series(nrows, dtype): + rng = np.random.default_rng(seed=0) size = 5 sr = cudf.Series(rng.integers(1, 9, size)).astype(dtype) sr[rng.choice([False, True], size=size)] = None @@ -60,6 +61,7 @@ def test_null_series(nrows, dtype): @pytest.mark.parametrize("ncols", [1, 2, 3, 4, 5, 10]) def test_null_dataframe(ncols): + rng = np.random.default_rng(seed=0) size = 20 gdf = cudf.DataFrame() for idx, dtype in enumerate(dtype_categories): @@ -77,6 +79,7 @@ def test_null_dataframe(ncols): @pytest.mark.parametrize("nrows", [None, 0, 1, 2, 9, 10, 11, 19, 20, 21]) def test_full_series(nrows, dtype): size = 20 + rng = np.random.default_rng(seed=0) ps = pd.Series(rng.integers(0, 100, size)).astype(dtype) sr = cudf.from_pandas(ps) pd.options.display.max_rows = nrows @@ -89,6 +92,7 @@ def test_full_series(nrows, dtype): @pytest.mark.parametrize("size", [20, 21]) @pytest.mark.parametrize("dtype", repr_categories) def test_full_dataframe_20(dtype, size, nrows, ncols): + rng = np.random.default_rng(seed=0) pdf = pd.DataFrame( {idx: rng.integers(0, 100, size) for idx in range(size)} ).astype(dtype) @@ -178,6 +182,7 @@ def test_mixed_series(mixed_pdf, mixed_gdf): def test_MI(): + rng = np.random.default_rng(seed=0) gdf = cudf.DataFrame( { "a": rng.integers(0, 4, 10), @@ -223,6 +228,7 @@ def test_groupby_MI(nrows, ncols): @pytest.mark.parametrize("dtype", utils.NUMERIC_TYPES) @pytest.mark.parametrize("length", [0, 1, 10, 100, 1000]) def test_generic_index(length, dtype): + rng = np.random.default_rng(seed=0) psr = pd.Series( range(length), index=rng.integers(0, high=100, size=length).astype(dtype), diff --git a/python/cudf/cudf/tests/test_resampling.py b/python/cudf/cudf/tests/test_resampling.py index 8a366ed9cd2..4ac4484bf82 100644 --- a/python/cudf/cudf/tests/test_resampling.py +++ b/python/cudf/cudf/tests/test_resampling.py @@ -79,8 +79,9 @@ def test_series_resample_asfreq(rule): def test_dataframe_resample_aggregation_simple(): + rng = np.random.default_rng(seed=0) pdf = pd.DataFrame( - np.random.randn(1000, 3), + rng.standard_normal(size=(1000, 3)), index=pd.date_range("1/1/2012", freq="s", periods=1000), columns=["A", "B", "C"], ) @@ -91,8 +92,9 @@ def test_dataframe_resample_aggregation_simple(): def test_dataframe_resample_multiagg(): + rng = np.random.default_rng(seed=0) pdf = pd.DataFrame( - np.random.randn(1000, 3), + rng.standard_normal(size=(1000, 3)), index=pd.date_range("1/1/2012", freq="s", periods=1000), columns=["A", "B", "C"], ) @@ -104,10 +106,11 @@ def test_dataframe_resample_multiagg(): def test_dataframe_resample_on(): + rng = np.random.default_rng(seed=0) # test resampling on a specified column pdf = pd.DataFrame( { - "x": np.random.randn(1000), + "x": rng.standard_normal(size=(1000)), "y": pd.date_range("1/1/2012", freq="s", periods=1000), } ) @@ -119,15 +122,16 @@ def test_dataframe_resample_on(): def test_dataframe_resample_level(): + rng = np.random.default_rng(seed=0) # test resampling on a specific level of a MultIndex pdf = pd.DataFrame( { - "x": np.random.randn(1000), + "x": rng.standard_normal(size=1000), "y": pd.date_range("1/1/2012", freq="s", periods=1000), } ) pdi = pd.MultiIndex.from_frame(pdf) - pdf = pd.DataFrame({"a": np.random.randn(1000)}, index=pdi) + pdf = pd.DataFrame({"a": rng.standard_normal(size=1000)}, index=pdi) gdf = cudf.from_pandas(pdf) assert_resample_results_equal( pdf.resample("3min", level="y").mean(), @@ -153,11 +157,12 @@ def test_dataframe_resample_level(): reason="Fails in older versions of pandas", ) def test_resampling_frequency_conversion(in_freq, sampling_freq, out_freq): + rng = np.random.default_rng(seed=0) # test that we cast to the appropriate frequency # when resampling: pdf = pd.DataFrame( { - "x": np.random.randn(100), + "x": rng.standard_normal(size=100), "y": pd.date_range("1/1/2012", freq=in_freq, periods=100), } ) diff --git a/python/cudf/cudf/tests/test_reshape.py b/python/cudf/cudf/tests/test_reshape.py index 779f23bb5ab..1ddf517e041 100644 --- a/python/cudf/cudf/tests/test_reshape.py +++ b/python/cudf/cudf/tests/test_reshape.py @@ -35,6 +35,9 @@ pytest_xfail = pytest.mark.skipif +rng = np.random.default_rng(seed=0) + + @pytest.mark.parametrize("num_id_vars", [0, 1, 2]) @pytest.mark.parametrize("num_value_vars", [0, 1, 2]) @pytest.mark.parametrize("num_rows", [1, 2, 100]) @@ -266,7 +269,7 @@ def test_df_stack_multiindex_column_axis_pd_example(level): names=["exp", "animal", "hair_length"], ) - df = pd.DataFrame(np.random.randn(4, 4), columns=columns) + df = pd.DataFrame(rng.standard_normal(size=(4, 4)), columns=columns) with expect_warning_if(PANDAS_GE_220, FutureWarning): expect = df.stack(level=level, future_stack=False) @@ -709,8 +712,8 @@ def test_pivot_duplicate_error(): "A": ["one", "one", "two", "three"] * 6, "B": ["A", "B", "C"] * 8, "C": ["foo", "foo", "foo", "bar", "bar", "bar"] * 4, - "D": np.random.randn(24), - "E": np.random.randn(24), + "D": rng.standard_normal(size=24), + "E": rng.standard_normal(size=24), } ], ) @@ -747,8 +750,8 @@ def test_pivot_table_simple(data, aggfunc, fill_value): "A": ["one", "one", "two", "three"] * 6, "B": ["A", "B", "C"] * 8, "C": ["foo", "foo", "foo", "bar", "bar", "bar"] * 4, - "D": np.random.randn(24), - "E": np.random.randn(24), + "D": rng.standard_normal(size=24), + "E": rng.standard_normal(size=24), } ], ) diff --git a/python/cudf/cudf/tests/test_serialize.py b/python/cudf/cudf/tests/test_serialize.py index 542007ac34e..68f2aaf9cab 100644 --- a/python/cudf/cudf/tests/test_serialize.py +++ b/python/cudf/cudf/tests/test_serialize.py @@ -170,11 +170,15 @@ def test_serialize_dataframe(): def test_serialize_dataframe_with_index(): - df = cudf.DataFrame() - df["a"] = np.arange(100) - df["b"] = np.random.random(100) - df["c"] = pd.Categorical( - ["a", "b", "c", "_", "_"] * 20, categories=["a", "b", "c"] + rng = np.random.default_rng(seed=0) + df = cudf.DataFrame( + { + "a": np.arange(100), + "b": rng.random(100), + "c": pd.Categorical( + ["a", "b", "c", "_", "_"] * 20, categories=["a", "b", "c"] + ), + } ) df = df.sort_values("b") outdf = cudf.DataFrame.deserialize(*df.serialize()) @@ -200,6 +204,7 @@ def test_serialize_generic_index(): def test_serialize_multi_index(): + rng = np.random.default_rng(seed=0) pdf = pd.DataFrame( { "a": [4, 17, 4, 9, 5], @@ -218,7 +223,8 @@ def test_serialize_multi_index(): def test_serialize_masked_series(): nelem = 50 - data = np.random.random(nelem) + rng = np.random.default_rng(seed=0) + data = rng.random(nelem) mask = utils.random_bitmask(nelem) bitmask = utils.expand_bits_to_bytes(mask)[:nelem] null_count = utils.count_zero(bitmask) @@ -229,10 +235,14 @@ def test_serialize_masked_series(): def test_serialize_groupby_df(): - df = cudf.DataFrame() - df["key_1"] = rng.integers(0, 20, 100) - df["key_2"] = rng.integers(0, 20, 100) - df["val"] = np.arange(100, dtype=np.float32) + rng = np.random.default_rng(seed=0) + df = cudf.DataFrame( + { + "key_1": rng.integers(0, 20, 100), + "key_2": rng.integers(0, 20, 100), + "val": np.arange(100, dtype=np.float32), + } + ) gb = df.groupby(["key_1", "key_2"], sort=True) outgb = gb.deserialize(*gb.serialize()) expect = gb.mean() @@ -241,8 +251,8 @@ def test_serialize_groupby_df(): def test_serialize_groupby_external(): - df = cudf.DataFrame() - df["val"] = np.arange(100, dtype=np.float32) + rng = np.random.default_rng(seed=0) + df = cudf.DataFrame({"val": np.arange(100, dtype=np.float32)}) gb = df.groupby(cudf.Series(rng.integers(0, 20, 100))) outgb = gb.deserialize(*gb.serialize()) expect = gb.mean() @@ -262,6 +272,7 @@ def test_serialize_groupby_level(): def test_serialize_groupby_sr(): + rng = np.random.default_rng(seed=0) sr = cudf.Series(rng.integers(0, 20, 100)) gb = sr.groupby(sr // 2) outgb = gb.deserialize(*gb.serialize()) @@ -271,6 +282,7 @@ def test_serialize_groupby_sr(): def test_serialize_datetime(): + rng = np.random.default_rng(seed=0) # Make frame with datetime column df = pd.DataFrame( {"x": rng.integers(0, 5, size=20), "y": rng.normal(size=20)} @@ -285,6 +297,7 @@ def test_serialize_datetime(): def test_serialize_string(): + rng = np.random.default_rng(seed=0) # Make frame with string column df = pd.DataFrame( {"x": rng.integers(0, 5, size=5), "y": rng.normal(size=5)} diff --git a/python/cudf/cudf/tests/test_series.py b/python/cudf/cudf/tests/test_series.py index 9fb492c4e25..e7e45c574cc 100644 --- a/python/cudf/cudf/tests/test_series.py +++ b/python/cudf/cudf/tests/test_series.py @@ -27,6 +27,8 @@ gen_rand, ) +rng = np.random.default_rng(seed=0) + def _series_na_data(): return [ @@ -546,7 +548,7 @@ def test_series_datetime_value_counts(data, nulls, normalize, dropna): @pytest.mark.parametrize("num_elements", [10, 100, 1000]) def test_categorical_value_counts(dropna, normalize, num_elements): # create categorical series - np.random.seed(12) + rng = np.random.default_rng(seed=0) pd_cat = pd.Categorical( pd.Series( rng.choice(list(ascii_letters + digits), num_elements), @@ -1943,6 +1945,7 @@ def test_diff_many_dtypes(data): @pytest.mark.parametrize("dtype", NUMERIC_TYPES + ["bool"]) @pytest.mark.parametrize("series_bins", [True, False]) def test_series_digitize(num_rows, num_bins, right, dtype, series_bins): + rng = np.random.default_rng(seed=0) data = rng.integers(0, 100, num_rows).astype(dtype) bins = np.unique(np.sort(rng.integers(2, 95, num_bins).astype(dtype))) s = cudf.Series(data) @@ -1957,6 +1960,7 @@ def test_series_digitize(num_rows, num_bins, right, dtype, series_bins): def test_series_digitize_invalid_bins(): + rng = np.random.default_rng(seed=0) s = cudf.Series(rng.integers(0, 30, 80), dtype="int32") bins = cudf.Series([2, None, None, 50, 90], dtype="int32") @@ -2038,6 +2042,7 @@ def test_default_float_bitwidth_construction(default_float_bitwidth, data): def test_series_ordered_dedup(): # part of https://github.com/rapidsai/cudf/issues/11486 + rng = np.random.default_rng(seed=0) sr = cudf.Series(rng.integers(0, 100, 1000)) # pandas unique() preserves order expect = pd.Series(sr.to_pandas().unique()) diff --git a/python/cudf/cudf/tests/test_seriesmap.py b/python/cudf/cudf/tests/test_seriesmap.py index 3d8b6a79d2a..db1de7d0cf4 100644 --- a/python/cudf/cudf/tests/test_seriesmap.py +++ b/python/cudf/cudf/tests/test_seriesmap.py @@ -47,8 +47,8 @@ def test_series_map_callable_numeric_basic(): @pytest.mark.parametrize("nelem", list(product([2, 10, 100, 1000]))) def test_series_map_callable_numeric_random(nelem): # Generate data - np.random.seed(0) - data = np.random.random(nelem) * 100 + rng = np.random.default_rng(seed=0) + data = rng.random(nelem) * 100 sr = Series(data) pdsr = pd.Series(data) diff --git a/python/cudf/cudf/tests/test_sorting.py b/python/cudf/cudf/tests/test_sorting.py index 09b83ff37b7..7e5ce713c7e 100644 --- a/python/cudf/cudf/tests/test_sorting.py +++ b/python/cudf/cudf/tests/test_sorting.py @@ -34,10 +34,10 @@ "nelem,dtype", list(product(sort_nelem_args, sort_dtype_args)) ) def test_dataframe_sort_values(nelem, dtype): - np.random.seed(0) + rng = np.random.default_rng(seed=0) df = DataFrame() - df["a"] = aa = (100 * np.random.random(nelem)).astype(dtype) - df["b"] = bb = (100 * np.random.random(nelem)).astype(dtype) + df["a"] = aa = (100 * rng.random(nelem)).astype(dtype) + df["b"] = bb = (100 * rng.random(nelem)).astype(dtype) sorted_df = df.sort_values(by="a") # Check sorted_index = np.argsort(aa, kind="mergesort") @@ -85,9 +85,9 @@ def test_series_sort_values_ignore_index(ignore_index): "nelem,sliceobj", list(product([10, 100], sort_slice_args)) ) def test_dataframe_sort_values_sliced(nelem, sliceobj): - np.random.seed(0) + rng = np.random.default_rng(seed=0) df = pd.DataFrame() - df["a"] = np.random.random(nelem) + df["a"] = rng.random(nelem) expect = df[sliceobj]["a"].sort_values() gdf = DataFrame.from_pandas(df) @@ -100,8 +100,8 @@ def test_dataframe_sort_values_sliced(nelem, sliceobj): list(product(sort_nelem_args, sort_dtype_args, [True, False])), ) def test_series_argsort(nelem, dtype, asc): - np.random.seed(0) - sr = Series((100 * np.random.random(nelem)).astype(dtype)) + rng = np.random.default_rng(seed=0) + sr = Series((100 * rng.random(nelem)).astype(dtype)) res = sr.argsort(ascending=asc) if asc: @@ -116,8 +116,8 @@ def test_series_argsort(nelem, dtype, asc): "nelem,asc", list(product(sort_nelem_args, [True, False])) ) def test_series_sort_index(nelem, asc): - np.random.seed(0) - sr = Series(100 * np.random.random(nelem)) + rng = np.random.default_rng(seed=0) + sr = Series(100 * rng.random(nelem)) psr = sr.to_pandas() expected = psr.sort_index(ascending=asc) @@ -167,9 +167,9 @@ def test_series_nsmallest(data, n): @pytest.mark.parametrize("op", ["nsmallest", "nlargest"]) @pytest.mark.parametrize("columns", ["a", ["b", "a"]]) def test_dataframe_nlargest_nsmallest(nelem, n, op, columns): - np.random.seed(0) - aa = np.random.random(nelem) - bb = np.random.random(nelem) + rng = np.random.default_rng(seed=0) + aa = rng.random(nelem) + bb = rng.random(nelem) df = DataFrame({"a": aa, "b": bb}) pdf = df.to_pandas() @@ -181,10 +181,10 @@ def test_dataframe_nlargest_nsmallest(nelem, n, op, columns): ) def test_dataframe_nlargest_sliced(counts, sliceobj): nelem, n = counts - np.random.seed(0) + rng = np.random.default_rng(seed=0) df = pd.DataFrame() - df["a"] = np.random.random(nelem) - df["b"] = np.random.random(nelem) + df["a"] = rng.random(nelem) + df["b"] = rng.random(nelem) expect = df[sliceobj].nlargest(n, "a") gdf = DataFrame.from_pandas(df) @@ -197,10 +197,10 @@ def test_dataframe_nlargest_sliced(counts, sliceobj): ) def test_dataframe_nsmallest_sliced(counts, sliceobj): nelem, n = counts - np.random.seed(0) + rng = np.random.default_rng(seed=0) df = pd.DataFrame() - df["a"] = np.random.random(nelem) - df["b"] = np.random.random(nelem) + df["a"] = rng.random(nelem) + df["b"] = rng.random(nelem) expect = df[sliceobj].nsmallest(n, "a") gdf = DataFrame.from_pandas(df) @@ -216,7 +216,7 @@ def test_dataframe_nsmallest_sliced(counts, sliceobj): def test_dataframe_multi_column( num_cols, num_rows, dtype, ascending, na_position ): - np.random.seed(0) + rng = np.random.default_rng(seed=0) by = list(string.ascii_lowercase[:num_cols]) pdf = pd.DataFrame() @@ -244,7 +244,7 @@ def test_dataframe_multi_column( def test_dataframe_multi_column_nulls( num_cols, num_rows, dtype, nulls, ascending, na_position ): - np.random.seed(0) + rng = np.random.default_rng(seed=0) by = list(string.ascii_lowercase[:num_cols]) pdf = pd.DataFrame() @@ -295,8 +295,8 @@ def test_dataframe_multi_column_nulls_multiple_ascending( @pytest.mark.parametrize("nelem", [1, 100]) def test_series_nlargest_nelem(nelem): - np.random.seed(0) - elems = np.random.random(nelem) + rng = np.random.default_rng(seed=0) + elems = rng.random(nelem) gds = Series(elems).nlargest(nelem) pds = pd.Series(elems).nlargest(nelem) @@ -308,11 +308,14 @@ def test_series_nlargest_nelem(nelem): @pytest.mark.parametrize("keep", [True, False]) def test_dataframe_scatter_by_map(map_size, nelem, keep): strlist = ["dog", "cat", "fish", "bird", "pig", "fox", "cow", "goat"] - np.random.seed(0) - df = DataFrame() - df["a"] = rng.choice(strlist[:map_size], nelem) - df["b"] = np.random.uniform(low=0, high=map_size, size=nelem) - df["c"] = rng.integers(map_size, size=nelem) + rng = np.random.default_rng(seed=0) + df = DataFrame( + { + "a": rng.choice(strlist[:map_size], nelem), + "b": rng.uniform(low=0, high=map_size, size=nelem), + "c": rng.integers(map_size, size=nelem), + } + ) df["d"] = df["a"].astype("category") def _check_scatter_by_map(dfs, col): @@ -381,10 +384,10 @@ def _check_scatter_by_map(dfs, col): "kind", ["quicksort", "mergesort", "heapsort", "stable"] ) def test_dataframe_sort_values_kind(nelem, dtype, kind): - np.random.seed(0) + rng = np.random.default_rng(seed=0) df = DataFrame() - df["a"] = aa = (100 * np.random.random(nelem)).astype(dtype) - df["b"] = bb = (100 * np.random.random(nelem)).astype(dtype) + df["a"] = aa = (100 * rng.random(nelem)).astype(dtype) + df["b"] = bb = (100 * rng.random(nelem)).astype(dtype) with expect_warning_if(kind != "quicksort", UserWarning): sorted_df = df.sort_values(by="a", kind=kind) # Check diff --git a/python/cudf/cudf/tests/test_sparse_df.py b/python/cudf/cudf/tests/test_sparse_df.py index 3248e7f72c0..8b68ae6480b 100644 --- a/python/cudf/cudf/tests/test_sparse_df.py +++ b/python/cudf/cudf/tests/test_sparse_df.py @@ -1,4 +1,4 @@ -# Copyright (c) 2018-2023, NVIDIA CORPORATION. +# Copyright (c) 2018-2024, NVIDIA CORPORATION. import numpy as np @@ -6,7 +6,8 @@ def test_to_dense_array(): - data = np.random.random(8) + rng = np.random.default_rng(seed=0) + data = rng.random(8) mask = np.asarray([0b11010110]).astype(np.byte) sr = Series.from_masked_array(data=data, mask=mask, null_count=3) diff --git a/python/cudf/cudf/tests/test_stats.py b/python/cudf/cudf/tests/test_stats.py index 5a01d81b012..a4ff042e37c 100644 --- a/python/cudf/cudf/tests/test_stats.py +++ b/python/cudf/cudf/tests/test_stats.py @@ -19,13 +19,15 @@ interpolation_methods = ["linear", "lower", "higher", "midpoint", "nearest"] +rng = np.random.default_rng(seed=0) + @pytest.mark.parametrize("method", methods) @pytest.mark.parametrize("dtype", params_dtypes) @pytest.mark.parametrize("skipna", [True, False]) def test_series_reductions(method, dtype, skipna): - np.random.seed(0) - arr = np.random.random(100) + rng = np.random.default_rng(seed=0) + arr = rng.random(100) if np.issubdtype(dtype, np.integer): arr *= 100 mask = arr > 10 @@ -56,8 +58,8 @@ def call_test(sr, skipna): def test_series_reductions_concurrency(method): e = ThreadPoolExecutor(10) - np.random.seed(0) - srs = [cudf.Series(np.random.random(10000)) for _ in range(1)] + rng = np.random.default_rng(seed=0) + srs = [cudf.Series(rng.random(10000)) for _ in range(1)] def call_test(sr): fn = getattr(sr, method) @@ -74,8 +76,8 @@ def f(sr): @pytest.mark.parametrize("ddof", range(3)) def test_series_std(ddof): - np.random.seed(0) - arr = np.random.random(100) - 0.5 + rng = np.random.default_rng(seed=0) + arr = rng.random(100) - 0.5 sr = cudf.Series(arr) pd = sr.to_pandas() got = sr.std(ddof=ddof) @@ -311,8 +313,8 @@ def test_skew_series(data, null_flag, numeric_only): @pytest.mark.parametrize("dtype", params_dtypes) @pytest.mark.parametrize("num_na", [0, 1, 50, 99, 100]) def test_series_median(dtype, num_na): - np.random.seed(0) - arr = np.random.random(100) + rng = np.random.default_rng(seed=0) + arr = rng.random(100) if np.issubdtype(dtype, np.integer): arr *= 100 mask = np.arange(100) >= num_na diff --git a/python/cudf/cudf/tests/test_string.py b/python/cudf/cudf/tests/test_string.py index b806b9258a2..07b3ba6f772 100644 --- a/python/cudf/cudf/tests/test_string.py +++ b/python/cudf/cudf/tests/test_string.py @@ -36,6 +36,7 @@ idx_list = [None, [10, 11, 12, 13, 14]] idx_id_list = ["None_index", "Set_index"] +rng = np.random.default_rng(seed=0) def raise_builder(flags, exceptions): @@ -1078,7 +1079,7 @@ def test_string_set_scalar(scalar): def test_string_index(): - pdf = pd.DataFrame(np.random.rand(5, 5)) + pdf = pd.DataFrame(rng.random(size=(5, 5))) gdf = cudf.DataFrame.from_pandas(pdf) stringIndex = ["a", "b", "c", "d", "e"] pdf.index = stringIndex diff --git a/python/cudf/cudf/tests/test_transform.py b/python/cudf/cudf/tests/test_transform.py index 88938457545..1305022d7fa 100644 --- a/python/cudf/cudf/tests/test_transform.py +++ b/python/cudf/cudf/tests/test_transform.py @@ -24,8 +24,8 @@ def _generic_function(a): ) def test_apply_python_lambda(dtype, udf, testfunc): size = 500 - - lhs_arr = np.random.random(size).astype(dtype) + rng = np.random.default_rng(seed=0) + lhs_arr = rng.random(size).astype(dtype) lhs_ser = Series(lhs_arr) out_ser = lhs_ser.apply(udf) diff --git a/python/cudf/cudf/tests/test_unaops.py b/python/cudf/cudf/tests/test_unaops.py index 5f5d79c1dce..b714beb0069 100644 --- a/python/cudf/cudf/tests/test_unaops.py +++ b/python/cudf/cudf/tests/test_unaops.py @@ -17,7 +17,8 @@ @pytest.mark.parametrize("dtype", utils.NUMERIC_TYPES) def test_series_abs(dtype): - arr = (np.random.random(1000) * 100).astype(dtype) + rng = np.random.default_rng(seed=0) + arr = (rng.random(1000) * 100).astype(dtype) sr = Series(arr) np.testing.assert_equal(sr.abs().to_numpy(), np.abs(arr)) np.testing.assert_equal(abs(sr).to_numpy(), abs(arr)) @@ -25,22 +26,24 @@ def test_series_abs(dtype): @pytest.mark.parametrize("dtype", utils.INTEGER_TYPES) def test_series_invert(dtype): - arr = (np.random.random(1000) * 100).astype(dtype) + rng = np.random.default_rng(seed=0) + arr = (rng.random(1000) * 100).astype(dtype) sr = Series(arr) np.testing.assert_equal((~sr).to_numpy(), np.invert(arr)) np.testing.assert_equal((~sr).to_numpy(), ~arr) def test_series_neg(): - arr = np.random.random(100) * 100 + rng = np.random.default_rng(seed=0) + arr = rng.random(100) * 100 sr = Series(arr) np.testing.assert_equal((-sr).to_numpy(), -arr) @pytest.mark.parametrize("mth", ["min", "max", "sum", "product"]) def test_series_pandas_methods(mth): - np.random.seed(0) - arr = (1 + np.random.random(5) * 100).astype(np.int64) + rng = np.random.default_rng(seed=0) + arr = (1 + rng.random(5) * 100).astype(np.int64) sr = Series(arr) psr = pd.Series(arr) np.testing.assert_equal(getattr(sr, mth)(), getattr(psr, mth)()) diff --git a/python/cudf/cudf/tests/test_unique.py b/python/cudf/cudf/tests/test_unique.py index 6a1366770b3..9a1c3b213b8 100644 --- a/python/cudf/cudf/tests/test_unique.py +++ b/python/cudf/cudf/tests/test_unique.py @@ -12,7 +12,7 @@ @pytest.fixture def df(): df = cudf.DataFrame() - np.random.seed(0) + rng = np.random.default_rng(seed=0) arr = rng.integers(2, size=10, dtype=np.int64) df["foo"] = arr diff --git a/python/cudf/cudf/utils/hash_vocab_utils.py b/python/cudf/cudf/utils/hash_vocab_utils.py index babe4be2715..66c9dd5135f 100644 --- a/python/cudf/cudf/utils/hash_vocab_utils.py +++ b/python/cudf/cudf/utils/hash_vocab_utils.py @@ -70,9 +70,10 @@ def _get_space_util(bins, init_bins): def _pick_initial_a_b(data, max_constant, init_bins): + rng = np.random.default_rng(seed=0) while True: - a = np.random.randint(2**12, 2**15) - b = np.random.randint(2**12, 2**15) + a = rng.integers(2**12, 2**15) + b = rng.integers(2**12, 2**15) bins = _make_bins(data, init_bins, a, b) score = _get_space_util(bins, init_bins) / len(data) @@ -87,17 +88,18 @@ def _pick_initial_a_b(data, max_constant, init_bins): def _find_hash_for_internal(hash_bin): + rng = np.random.default_rng(seed=0) if not hash_bin: return [[], 0, 0] new_length = _new_bin_length(len(hash_bin)) while True: - a = np.random.randint( + a = rng.integers( A_LBOUND_SECOND_LEVEL_HASH, A_HBOUND_SECOND_LEVEL_HASH, ) - b = np.random.randint( + b = rng.integers( B_LBOUND_SECOND_LEVEL_HASH, B_HBOUND_SECOND_LEVEL_HASH ) bins = _make_bins(hash_bin, new_length, a, b) @@ -245,7 +247,7 @@ def hash_vocab( """ Write the vocab vocabulary hashtable to the output_path """ - np.random.seed(1243342) + _ = np.random.default_rng(seed=0) vocab = _load_vocab_dict(vocab_path) keys = list(map(_sdbm_hash, vocab.keys())) diff --git a/python/cudf/cudf_pandas_tests/data/repr_slow_down_test.ipynb b/python/cudf/cudf_pandas_tests/data/repr_slow_down_test.ipynb index c7d39b78810..cc03574155e 100644 --- a/python/cudf/cudf_pandas_tests/data/repr_slow_down_test.ipynb +++ b/python/cudf/cudf_pandas_tests/data/repr_slow_down_test.ipynb @@ -24,7 +24,7 @@ "num_columns = 12\n", "\n", "# Create a DataFrame with random data\n", - "df = pd.DataFrame(np.random.randint(0, 100, size=(num_rows, num_columns)),\n", + "df = pd.DataFrame(rng.integers(0, 100, size=(num_rows, num_columns)),\n", " columns=[f'Column_{i}' for i in range(1, num_columns + 1)])" ] }, diff --git a/python/cudf/cudf_pandas_tests/test_cudf_pandas.py b/python/cudf/cudf_pandas_tests/test_cudf_pandas.py index 2bbed40e34e..06cc630e9af 100644 --- a/python/cudf/cudf_pandas_tests/test_cudf_pandas.py +++ b/python/cudf/cudf_pandas_tests/test_cudf_pandas.py @@ -1135,8 +1135,8 @@ def test_private_method_result_wrapped(): def test_numpy_var(): - np.random.seed(42) - data = np.random.rand(1000) + rng = np.random.default_rng(seed=0) + data = rng.random(1000) psr = pd.Series(data) sr = xpd.Series(data) diff --git a/python/cudf/cudf_pandas_tests/test_profiler.py b/python/cudf/cudf_pandas_tests/test_profiler.py index 5b7bde06d1d..b20c3fff346 100644 --- a/python/cudf/cudf_pandas_tests/test_profiler.py +++ b/python/cudf/cudf_pandas_tests/test_profiler.py @@ -23,12 +23,12 @@ reason="function names change across versions of pandas, so making sure it only runs on latest version of pandas", ) def test_profiler(): - np.random.seed(42) + rng = np.random.default_rng(seed=0) with Profiler() as profiler: df = pd.DataFrame( { - "idx": np.random.randint(0, 10, 1000), - "data": np.random.rand(1000), + "idx": rng.integers(0, 10, 1000), + "data": rng.random(1000), } ) sums = df.groupby("idx").sum() @@ -58,7 +58,7 @@ def test_profiler(): calls = [ "pd.DataFrame", "", - "np.random.randint", + "rng.integers", "np.random.rand", 'df.groupby("idx").sum', 'df.sum()["data"]', diff --git a/python/cudf/cudf_pandas_tests/third_party_integration_tests/tests/test_cuml.py b/python/cudf/cudf_pandas_tests/third_party_integration_tests/tests/test_cuml.py index 892d0886596..27eaff87ba0 100644 --- a/python/cudf/cudf_pandas_tests/third_party_integration_tests/tests/test_cuml.py +++ b/python/cudf/cudf_pandas_tests/third_party_integration_tests/tests/test_cuml.py @@ -102,7 +102,7 @@ def test_random_forest(binary_classification_data): def test_clustering(): rng = np.random.default_rng(42) nsamps = 300 - X = rng.random((nsamps, 2)) + X = rng.random(size=(nsamps, 2)) data = pd.DataFrame(X, columns=["x", "y"]) kmeans = KMeans(n_clusters=3, random_state=42) diff --git a/python/cudf/cudf_pandas_tests/third_party_integration_tests/tests/test_stumpy_distributed.py b/python/cudf/cudf_pandas_tests/third_party_integration_tests/tests/test_stumpy_distributed.py index 37e3cc34856..a81d1d01aa2 100644 --- a/python/cudf/cudf_pandas_tests/third_party_integration_tests/tests/test_stumpy_distributed.py +++ b/python/cudf/cudf_pandas_tests/third_party_integration_tests/tests/test_stumpy_distributed.py @@ -31,17 +31,17 @@ def dask_client(): def test_1d_distributed(dask_client): - np.random.seed(42) - ts = pd.Series(np.random.rand(100)) + rng = np.random.default_rng(seed=0) + ts = pd.Series(rng.random(100)) m = 10 return stumpy.stumped(dask_client, ts, m) def test_multidimensional_distributed_timeseries(dask_client): - np.random.seed(42) + rng = np.random.default_rng(seed=0) # Each row represents data from a different dimension while each column represents # data from the same dimension - your_time_series = np.random.rand(3, 1000) + your_time_series = rng.random(3, 1000) # Approximately, how many data points might be found in a pattern window_size = 50 diff --git a/python/dask_cudf/dask_cudf/io/tests/test_parquet.py b/python/dask_cudf/dask_cudf/io/tests/test_parquet.py index 620a917109e..896c4169f5b 100644 --- a/python/dask_cudf/dask_cudf/io/tests/test_parquet.py +++ b/python/dask_cudf/dask_cudf/io/tests/test_parquet.py @@ -371,12 +371,12 @@ def test_split_row_groups(tmpdir, row_groups, index): row_group_size = 5 file_row_groups = 10 # Known apriori npartitions_expected = math.ceil(file_row_groups / row_groups) * 2 - + rng = np.random.default_rng(seed=0) df = pd.DataFrame( { - "a": np.random.choice(["apple", "banana", "carrot"], size=df_size), - "b": np.random.random(size=df_size), - "c": np.random.randint(1, 5, size=df_size), + "a": rng.choice(["apple", "banana", "carrot"], size=df_size), + "b": rng.random(size=df_size), + "c": rng.integers(1, 5, size=df_size), "index": np.arange(0, df_size), } ) diff --git a/python/dask_cudf/dask_cudf/tests/test_accessor.py b/python/dask_cudf/dask_cudf/tests/test_accessor.py index 6f04b5737da..3fbb2aacd2c 100644 --- a/python/dask_cudf/dask_cudf/tests/test_accessor.py +++ b/python/dask_cudf/dask_cudf/tests/test_accessor.py @@ -25,7 +25,7 @@ def data_dt_1(): def data_dt_2(): - return np.random.randn(100) + return np.random.default_rng(seed=0).standard_normal(size=100) dt_fields = ["year", "month", "day", "hour", "minute", "second"] diff --git a/python/dask_cudf/dask_cudf/tests/test_binops.py b/python/dask_cudf/dask_cudf/tests/test_binops.py index 87bd401accd..8c51f950765 100644 --- a/python/dask_cudf/dask_cudf/tests/test_binops.py +++ b/python/dask_cudf/dask_cudf/tests/test_binops.py @@ -1,4 +1,4 @@ -# Copyright (c) 2022, NVIDIA CORPORATION. +# Copyright (c) 2022-2024, NVIDIA CORPORATION. import operator @@ -21,10 +21,11 @@ def _make_empty_frame(npartitions=2): def _make_random_frame_float(nelem, npartitions=2): + rng = np.random.default_rng(seed=0) df = pd.DataFrame( { - "x": np.random.randint(0, 5, size=nelem), - "y": np.random.normal(size=nelem) + 1, + "x": rng.integers(0, 5, size=nelem), + "y": rng.normal(size=nelem) + 1, } ) gdf = cudf.from_pandas(df) @@ -51,7 +52,6 @@ def _make_random_frame_float(nelem, npartitions=2): @pytest.mark.parametrize("binop", _binops) def test_series_binops_integer(binop): - np.random.seed(0) size = 1000 lhs_df, lhs_gdf = _make_random_frame(size) rhs_df, rhs_gdf = _make_random_frame(size) @@ -62,7 +62,6 @@ def test_series_binops_integer(binop): @pytest.mark.parametrize("binop", _binops) def test_series_binops_float(binop): - np.random.seed(0) size = 1000 lhs_df, lhs_gdf = _make_random_frame_float(size) rhs_df, rhs_gdf = _make_random_frame_float(size) @@ -73,10 +72,10 @@ def test_series_binops_float(binop): @pytest.mark.parametrize("operator", _binops) def test_df_series_bind_ops(operator): - np.random.seed(0) + rng = np.random.default_rng(seed=0) size = 1000 lhs_df, lhs_gdf = _make_random_frame_float(size) - rhs = np.random.rand() + rhs = rng.random() for col in lhs_gdf.columns: got = getattr(lhs_gdf[col], operator.__name__)(rhs) diff --git a/python/dask_cudf/dask_cudf/tests/test_core.py b/python/dask_cudf/dask_cudf/tests/test_core.py index 5f0fae86691..8e42c847ddf 100644 --- a/python/dask_cudf/dask_cudf/tests/test_core.py +++ b/python/dask_cudf/dask_cudf/tests/test_core.py @@ -22,13 +22,15 @@ xfail_dask_expr, ) +rng = np.random.default_rng(seed=0) + def test_from_dict_backend_dispatch(): # Test ddf.from_dict cudf-backend dispatch - np.random.seed(0) + rng = np.random.default_rng(seed=0) data = { - "x": np.random.randint(0, 5, size=10000), - "y": np.random.normal(size=10000), + "x": rng.integers(0, 5, size=10000), + "y": rng.normal(size=10000), } expect = cudf.DataFrame(data) with dask.config.set({"dataframe.backend": "cudf"}): @@ -62,10 +64,10 @@ def test_from_dask_dataframe_deprecated(): def test_to_backend(): - np.random.seed(0) + rng = np.random.default_rng(seed=0) data = { - "x": np.random.randint(0, 5, size=10000), - "y": np.random.normal(size=10000), + "x": rng.integers(0, 5, size=10000), + "y": rng.normal(size=10000), } with dask.config.set({"dataframe.backend": "pandas"}): ddf = dd.from_dict(data, npartitions=2) @@ -114,12 +116,12 @@ def test_to_backend_kwargs(): def test_from_pandas(): - np.random.seed(0) + rng = np.random.default_rng(seed=0) df = pd.DataFrame( { - "x": np.random.randint(0, 5, size=10000), - "y": np.random.normal(size=10000), + "x": rng.integers(0, 5, size=10000), + "y": rng.normal(size=10000), } ) @@ -169,10 +171,10 @@ def _fragmented_gdf(df, nsplit): def test_query(): - np.random.seed(0) + rng = np.random.default_rng(seed=0) df = pd.DataFrame( - {"x": np.random.randint(0, 5, size=10), "y": np.random.normal(size=10)} + {"x": rng.integers(0, 5, size=10), "y": rng.normal(size=10)} ) gdf = cudf.DataFrame.from_pandas(df) expr = "x > 2" @@ -188,9 +190,9 @@ def test_query(): def test_query_local_dict(): - np.random.seed(0) + rng = np.random.default_rng(seed=0) df = pd.DataFrame( - {"x": np.random.randint(0, 5, size=10), "y": np.random.normal(size=10)} + {"x": rng.integers(0, 5, size=10), "y": rng.normal(size=10)} ) gdf = cudf.DataFrame.from_pandas(df) ddf = dask_cudf.from_cudf(gdf, npartitions=2) @@ -204,11 +206,11 @@ def test_query_local_dict(): def test_head(): - np.random.seed(0) + rng = np.random.default_rng(seed=0) df = pd.DataFrame( { - "x": np.random.randint(0, 5, size=100), - "y": np.random.normal(size=100), + "x": rng.integers(0, 5, size=100), + "y": rng.normal(size=100), } ) gdf = cudf.DataFrame.from_pandas(df) @@ -220,13 +222,11 @@ def test_head(): @pytest.mark.parametrize("nelem", [10, 200, 1333]) def test_set_index(nelem): with dask.config.set(scheduler="single-threaded"): - np.random.seed(0) + rng = np.random.default_rng(seed=0) # Use unique index range as the sort may not be stable-ordering x = np.arange(nelem) - np.random.shuffle(x) - df = pd.DataFrame( - {"x": x, "y": np.random.randint(0, nelem, size=nelem)} - ) + rng.shuffle(x) + df = pd.DataFrame({"x": x, "y": rng.integers(0, nelem, size=nelem)}) ddf = dd.from_pandas(df, npartitions=2) ddf2 = ddf.to_backend("cudf") @@ -242,7 +242,7 @@ def test_set_index(nelem): def test_set_index_quantile(nelem, nparts, by): df = cudf.DataFrame() df["a"] = np.ascontiguousarray(np.arange(nelem)[::-1]) - df["b"] = np.random.choice(cudf.datasets.names, size=nelem) + df["b"] = rng.choice(cudf.datasets.names, size=nelem) ddf = dd.from_pandas(df, npartitions=nparts) with pytest.warns(FutureWarning, match="deprecated"): @@ -270,11 +270,11 @@ def assert_frame_equal_by_index_group(expect, got): @pytest.mark.parametrize("nelem", [10, 200, 1333]) def test_set_index_2(nelem): with dask.config.set(scheduler="single-threaded"): - np.random.seed(0) + rng = np.random.default_rng(seed=0) df = pd.DataFrame( { - "x": 100 + np.random.randint(0, nelem // 2, size=nelem), - "y": np.random.normal(size=nelem), + "x": 100 + rng.integers(0, nelem // 2, size=nelem), + "y": rng.normal(size=nelem), } ) expect = df.set_index("x").sort_index() @@ -289,11 +289,11 @@ def test_set_index_2(nelem): def test_set_index_w_series(): with dask.config.set(scheduler="single-threaded"): nelem = 20 - np.random.seed(0) + rng = np.random.default_rng(seed=0) df = pd.DataFrame( { - "x": 100 + np.random.randint(0, nelem // 2, size=nelem), - "y": np.random.normal(size=nelem), + "x": 100 + rng.integers(0, nelem // 2, size=nelem), + "y": rng.normal(size=nelem), } ) expect = df.set_index(df.x).sort_index() @@ -327,12 +327,12 @@ def test_set_index_sorted(): @pytest.mark.parametrize("index", [None, "myindex"]) def test_rearrange_by_divisions(nelem, index): with dask.config.set(scheduler="single-threaded"): - np.random.seed(0) + rng = np.random.default_rng(seed=0) df = pd.DataFrame( { - "x": np.random.randint(0, 20, size=nelem), - "y": np.random.normal(size=nelem), - "z": np.random.choice(["dog", "cat", "bird"], nelem), + "x": rng.integers(0, 20, size=nelem), + "y": rng.normal(size=nelem), + "z": rng.choice(["dog", "cat", "bird"], nelem), } ) df["z"] = df["z"].astype("category") @@ -355,9 +355,9 @@ def test_rearrange_by_divisions(nelem, index): def test_assign(): - np.random.seed(0) + rng = np.random.default_rng(seed=0) df = pd.DataFrame( - {"x": np.random.randint(0, 5, size=20), "y": np.random.normal(size=20)} + {"x": rng.integers(0, 5, size=20), "y": rng.normal(size=20)} ) dgf = dd.from_pandas(cudf.DataFrame.from_pandas(df), npartitions=2) @@ -372,10 +372,10 @@ def test_assign(): @pytest.mark.parametrize("data_type", ["int8", "int16", "int32", "int64"]) def test_setitem_scalar_integer(data_type): - np.random.seed(0) - scalar = np.random.randint(0, 100, dtype=data_type) + rng = np.random.default_rng(seed=0) + scalar = rng.integers(0, 100, dtype=data_type) df = pd.DataFrame( - {"x": np.random.randint(0, 5, size=20), "y": np.random.normal(size=20)} + {"x": rng.integers(0, 5, size=20), "y": rng.normal(size=20)} ) dgf = dd.from_pandas(cudf.DataFrame.from_pandas(df), npartitions=2) @@ -388,10 +388,10 @@ def test_setitem_scalar_integer(data_type): @pytest.mark.parametrize("data_type", ["float32", "float64"]) def test_setitem_scalar_float(data_type): - np.random.seed(0) - scalar = np.random.randn(1).astype(data_type)[0] + rng = np.random.default_rng(seed=0) + scalar = rng.standard_normal(size=1).astype(data_type)[0] df = pd.DataFrame( - {"x": np.random.randint(0, 5, size=20), "y": np.random.normal(size=20)} + {"x": rng.integers(0, 5, size=20), "y": rng.normal(size=20)} ) dgf = dd.from_pandas(cudf.DataFrame.from_pandas(df), npartitions=2) @@ -403,10 +403,10 @@ def test_setitem_scalar_float(data_type): def test_setitem_scalar_datetime(): - np.random.seed(0) - scalar = np.int64(np.random.randint(0, 100)).astype("datetime64[ms]") + rng = np.random.default_rng(seed=0) + scalar = np.int64(rng.integers(0, 100)).astype("datetime64[ms]") df = pd.DataFrame( - {"x": np.random.randint(0, 5, size=20), "y": np.random.normal(size=20)} + {"x": rng.integers(0, 5, size=20), "y": rng.normal(size=20)} ) dgf = dd.from_pandas(cudf.DataFrame.from_pandas(df), npartitions=2) @@ -422,12 +422,12 @@ def test_setitem_scalar_datetime(): "func", [ lambda: pd.DataFrame( - {"A": np.random.rand(10), "B": np.random.rand(10)}, + {"A": rng.random(10), "B": rng.random(10)}, index=list("abcdefghij"), ), lambda: pd.DataFrame( { - "A": np.random.rand(10), + "A": rng.random(10), "B": list("a" * 10), "C": pd.Series( [str(20090101 + i) for i in range(10)], @@ -438,7 +438,7 @@ def test_setitem_scalar_datetime(): ), lambda: pd.Series(list("abcdefghijklmnop")), lambda: pd.Series( - np.random.rand(10), + rng.random(10), index=pd.Index( [str(20090101 + i) for i in range(10)], dtype="datetime64[ns]" ), @@ -497,10 +497,11 @@ def test_repartition_hash_staged(npartitions): by = ["b"] datarange = 35 size = 100 + rng = np.random.default_rng(seed=0) gdf = cudf.DataFrame( { "a": np.arange(size, dtype="int64"), - "b": np.random.randint(datarange, size=size), + "b": rng.integers(datarange, size=size), } ) # WARNING: Specific npartitions-max_branch combination @@ -537,12 +538,13 @@ def test_repartition_hash(by, npartitions, max_branch): npartitions_i = 4 datarange = 26 size = 100 + rng = np.random.default_rng(seed=0) gdf = cudf.DataFrame( { "a": np.arange(0, stop=size, dtype="int64"), - "b": np.random.randint(datarange, size=size), - "c": np.random.choice(list("abcdefgh"), size=size), - "d": np.random.choice(np.arange(26), size=size), + "b": rng.integers(datarange, size=size), + "c": rng.choice(list("abcdefgh"), size=size), + "d": rng.choice(np.arange(26), size=size), } ) gdf.d = gdf.d.astype("datetime64[ms]") @@ -768,6 +770,7 @@ def test_dataframe_series_replace(data): def test_dataframe_assign_col(): + rng = np.random.default_rng(seed=0) df = cudf.DataFrame(list(range(100))) pdf = pd.DataFrame(list(range(100))) @@ -780,7 +783,7 @@ def test_dataframe_assign_col(): pddf = dd.from_pandas(pdf, npartitions=4) pddf["fold"] = 0 pddf["fold"] = pddf["fold"].map_partitions( - lambda p_df: pd.Series(np.random.randint(0, 4, len(p_df))) + lambda p_df: pd.Series(rng.integers(0, 4, len(p_df))) ) dd.assert_eq(ddf[0], pddf[0]) @@ -1015,10 +1018,11 @@ def test_to_backend_simplify(): @pytest.mark.parametrize("numeric_only", [True, False]) @pytest.mark.parametrize("op", ["corr", "cov"]) def test_cov_corr(op, numeric_only): + rng = np.random.default_rng(seed=0) df = cudf.DataFrame.from_dict( { - "x": np.random.randint(0, 5, size=10), - "y": np.random.normal(size=10), + "x": rng.integers(0, 5, size=10), + "y": rng.normal(size=10), } ) ddf = dd.from_pandas(df, npartitions=2) diff --git a/python/dask_cudf/dask_cudf/tests/test_delayed_io.py b/python/dask_cudf/dask_cudf/tests/test_delayed_io.py index e6fb58ad6df..84ed3b46598 100644 --- a/python/dask_cudf/dask_cudf/tests/test_delayed_io.py +++ b/python/dask_cudf/dask_cudf/tests/test_delayed_io.py @@ -51,9 +51,13 @@ def test_series_from_delayed(): def test_dataframe_to_delayed(): nelem = 100 - df = cudf.DataFrame() - df["x"] = np.arange(nelem) - df["y"] = np.random.randint(nelem, size=nelem) + rng = np.random.default_rng(seed=0) + df = cudf.DataFrame( + { + "x": np.arange(nelem), + "y": rng.integers(nelem, size=nelem), + } + ) ddf = dask_cudf.from_cudf(df, npartitions=5) @@ -80,8 +84,8 @@ def test_dataframe_to_delayed(): def test_series_to_delayed(): nelem = 100 - - sr = cudf.Series(np.random.randint(nelem, size=nelem)) + rng = np.random.default_rng(seed=0) + sr = cudf.Series(rng.integers(nelem, size=nelem)) dsr = dask_cudf.from_cudf(sr, npartitions=5) @@ -109,11 +113,13 @@ def test_series_to_delayed(): def test_mixing_series_frame_error(): nelem = 20 - - df = cudf.DataFrame() - df["x"] = np.arange(nelem) - df["y"] = np.random.randint(nelem, size=nelem) - + rng = np.random.default_rng(seed=0) + df = cudf.DataFrame( + { + "x": np.arange(nelem), + "y": rng.integers(nelem, size=nelem), + } + ) ddf = dask_cudf.from_cudf(df, npartitions=5) delay_frame = ddf.to_delayed() @@ -128,10 +134,13 @@ def test_mixing_series_frame_error(): def test_frame_extra_columns_error(): nelem = 20 - - df = cudf.DataFrame() - df["x"] = np.arange(nelem) - df["y"] = np.random.randint(nelem, size=nelem) + rng = np.random.default_rng(seed=0) + df = cudf.DataFrame( + { + "x": np.arange(nelem), + "y": rng.integers(nelem, size=nelem), + } + ) ddf1 = dask_cudf.from_cudf(df, npartitions=5) df["z"] = np.arange(nelem) diff --git a/python/dask_cudf/dask_cudf/tests/test_dispatch.py b/python/dask_cudf/dask_cudf/tests/test_dispatch.py index a12481a7bb4..fe57d4a4f00 100644 --- a/python/dask_cudf/dask_cudf/tests/test_dispatch.py +++ b/python/dask_cudf/dask_cudf/tests/test_dispatch.py @@ -32,8 +32,9 @@ def test_pyarrow_conversion_dispatch(preserve_index, index): to_pyarrow_table_dispatch, ) + rng = np.random.default_rng(seed=0) df1 = cudf.DataFrame( - np.random.randn(10, 3), columns=list("abc"), index=index + rng.standard_normal(size=(10, 3)), columns=list("abc"), index=index ) df2 = from_pyarrow_table_dispatch( df1, to_pyarrow_table_dispatch(df1, preserve_index=preserve_index) @@ -108,7 +109,8 @@ def test_pyarrow_schema_dispatch(preserve_index): to_pyarrow_table_dispatch, ) - df = cudf.DataFrame(np.random.randn(10, 3), columns=list("abc")) + rng = np.random.default_rng(seed=0) + df = cudf.DataFrame(rng.standard_normal(size=(10, 3)), columns=list("abc")) df["d"] = cudf.Series(["cat", "dog"] * 5) table = to_pyarrow_table_dispatch(df, preserve_index=preserve_index) schema = pyarrow_schema_dispatch(df, preserve_index=preserve_index) diff --git a/python/dask_cudf/dask_cudf/tests/test_groupby.py b/python/dask_cudf/dask_cudf/tests/test_groupby.py index 7b9f0ca328a..e30474f6b94 100644 --- a/python/dask_cudf/dask_cudf/tests/test_groupby.py +++ b/python/dask_cudf/dask_cudf/tests/test_groupby.py @@ -30,21 +30,21 @@ def assert_cudf_groupby_layers(ddf): @pytest.fixture(params=["non_null", "null"]) def pdf(request): - np.random.seed(0) + rng = np.random.default_rng(seed=0) # note that column name "x" is a substring of the groupby key; # this gives us coverage for cudf#10829 pdf = pd.DataFrame( { - "xx": np.random.randint(0, 5, size=10000), - "x": np.random.normal(size=10000), - "y": np.random.normal(size=10000), + "xx": rng.integers(0, 5, size=10000), + "x": rng.normal(size=10000), + "y": rng.normal(size=10000), } ) # insert nulls into dataframe at random if request.param == "null": - pdf = pdf.mask(np.random.choice([True, False], size=pdf.shape)) + pdf = pdf.mask(rng.choice([True, False], size=pdf.shape)) return pdf @@ -173,11 +173,12 @@ def test_groupby_agg_empty_partition(tmpdir, split_out): ], ) def test_groupby_multi_column(func): + rng = np.random.default_rng(seed=0) pdf = pd.DataFrame( { - "a": np.random.randint(0, 20, size=1000), - "b": np.random.randint(0, 5, size=1000), - "x": np.random.normal(size=1000), + "a": rng.integers(0, 20, size=1000), + "b": rng.integers(0, 5, size=1000), + "x": rng.normal(size=1000), } ) @@ -371,11 +372,12 @@ def test_groupby_string_index_name(myindex): ], ) def test_groupby_split_out_multiindex(agg_func): + rng = np.random.default_rng(seed=0) df = cudf.DataFrame( { - "a": np.random.randint(0, 10, 100), - "b": np.random.randint(0, 5, 100), - "c": np.random.random(100), + "a": rng.integers(0, 10, 100), + "b": rng.integers(0, 5, 100), + "c": rng.random(100), } ) ddf = dask_cudf.from_cudf(df, 5) @@ -419,12 +421,13 @@ def test_groupby_multiindex_reset_index(npartitions): ], ) def test_groupby_reset_index_multiindex(groupby_keys, agg_func): + rng = np.random.default_rng(seed=0) df = cudf.DataFrame( { - "a": np.random.randint(0, 10, 10), - "b": np.random.randint(0, 5, 10), - "c": np.random.randint(0, 5, 10), - "dd": np.random.randint(0, 5, 10), + "a": rng.integers(0, 10, 10), + "b": rng.integers(0, 5, 10), + "c": rng.integers(0, 5, 10), + "dd": rng.integers(0, 5, 10), } ) ddf = dask_cudf.from_cudf(df, 5) @@ -437,8 +440,9 @@ def test_groupby_reset_index_multiindex(groupby_keys, agg_func): def test_groupby_reset_index_drop_True(): + rng = np.random.default_rng(seed=0) df = cudf.DataFrame( - {"a": np.random.randint(0, 10, 10), "b": np.random.randint(0, 5, 10)} + {"a": rng.integers(0, 10, 10), "b": rng.integers(0, 5, 10)} ) ddf = dask_cudf.from_cudf(df, 5) pddf = dd.from_pandas(df.to_pandas(), 5) @@ -653,10 +657,11 @@ def test_groupby_agg_params(npartitions, split_every, split_out, as_index): "aggregations", [(sum, "sum"), (max, "max"), (min, "min")] ) def test_groupby_agg_redirect(aggregations): + rng = np.random.default_rng(seed=0) pdf = pd.DataFrame( { - "x": np.random.randint(0, 5, size=10000), - "y": np.random.normal(size=10000), + "x": rng.integers(0, 5, size=10000), + "y": rng.normal(size=10000), } ) @@ -758,10 +763,11 @@ def test_groupby_with_list_of_series(): ], ) def test_groupby_nested_dict(func): + rng = np.random.default_rng(seed=0) pdf = pd.DataFrame( { - "x": np.random.randint(0, 5, size=10000), - "y": np.random.normal(size=10000), + "x": rng.integers(0, 5, size=10000), + "y": rng.normal(size=10000), } ) @@ -794,10 +800,11 @@ def test_groupby_nested_dict(func): ], ) def test_groupby_all_columns(func): + rng = np.random.default_rng(seed=0) pdf = pd.DataFrame( { - "x": np.random.randint(0, 5, size=10000), - "y": np.random.normal(size=10000), + "x": rng.integers(0, 5, size=10000), + "y": rng.normal(size=10000), } ) diff --git a/python/dask_cudf/dask_cudf/tests/test_join.py b/python/dask_cudf/dask_cudf/tests/test_join.py index 43fadbecd0a..61d0f8d7eb9 100644 --- a/python/dask_cudf/dask_cudf/tests/test_join.py +++ b/python/dask_cudf/dask_cudf/tests/test_join.py @@ -22,18 +22,18 @@ def test_join_inner(left_nrows, right_nrows, left_nkeys, right_nkeys): chunksize = 50 - np.random.seed(0) + rng = np.random.default_rng(seed=0) # cuDF left = cudf.DataFrame( { - "x": np.random.randint(0, left_nkeys, size=left_nrows), + "x": rng.integers(0, left_nkeys, size=left_nrows), "a": np.arange(left_nrows), } ) right = cudf.DataFrame( { - "x": np.random.randint(0, right_nkeys, size=right_nrows), + "x": rng.integers(0, right_nkeys, size=right_nrows), "a": 1000 * np.arange(right_nrows), } ) @@ -84,18 +84,18 @@ def gather(df, grows): def test_join_left(left_nrows, right_nrows, left_nkeys, right_nkeys, how): chunksize = 50 - np.random.seed(0) + rng = np.random.default_rng(seed=0) # cuDF left = cudf.DataFrame( { - "x": np.random.randint(0, left_nkeys, size=left_nrows), + "x": rng.integers(0, left_nkeys, size=left_nrows), "a": np.arange(left_nrows, dtype=np.float64), } ) right = cudf.DataFrame( { - "x": np.random.randint(0, right_nkeys, size=right_nrows), + "x": rng.integers(0, right_nkeys, size=right_nrows), "a": 1000 * np.arange(right_nrows, dtype=np.float64), } ) @@ -153,20 +153,20 @@ def test_merge_left( ): chunksize = 3 - np.random.seed(0) + rng = np.random.default_rng(seed=42) # cuDF left = cudf.DataFrame( { - "x": np.random.randint(0, left_nkeys, size=left_nrows), - "y": np.random.randint(0, left_nkeys, size=left_nrows), + "x": rng.integers(0, left_nkeys, size=left_nrows), + "y": rng.integers(0, left_nkeys, size=left_nrows), "a": np.arange(left_nrows, dtype=np.float64), } ) right = cudf.DataFrame( { - "x": np.random.randint(0, right_nkeys, size=right_nrows), - "y": np.random.randint(0, right_nkeys, size=right_nrows), + "x": rng.integers(0, right_nkeys, size=right_nrows), + "y": rng.integers(0, right_nkeys, size=right_nrows), "a": 1000 * np.arange(right_nrows, dtype=np.float64), } ) @@ -200,18 +200,18 @@ def test_merge_1col_left( ): chunksize = 3 - np.random.seed(0) + rng = np.random.default_rng(seed=0) # cuDF left = cudf.DataFrame( { - "x": np.random.randint(0, left_nkeys, size=left_nrows), + "x": rng.integers(0, left_nkeys, size=left_nrows), "a": np.arange(left_nrows, dtype=np.float64), } ) right = cudf.DataFrame( { - "x": np.random.randint(0, right_nkeys, size=right_nrows), + "x": rng.integers(0, right_nkeys, size=right_nrows), "a": 1000 * np.arange(right_nrows, dtype=np.float64), } ) @@ -238,13 +238,19 @@ def test_merge_1col_left( def test_merge_should_fail(): # Expected failure cases described in #2694 - df1 = cudf.DataFrame() - df1["a"] = [1, 2, 3, 4, 5, 6] * 2 - df1["b"] = np.random.randint(0, 12, 12) - - df2 = cudf.DataFrame() - df2["a"] = [7, 2, 3, 8, 5, 9] * 2 - df2["c"] = np.random.randint(0, 12, 12) + rng = np.random.default_rng(seed=0) + df1 = pd.DataFrame( + { + "a": [1, 2, 3, 4, 5, 6] * 2, + "b": rng.integers(0, 12, 12), + } + ) + df2 = pd.DataFrame( + { + "a": [7, 2, 3, 8, 5, 9] * 2, + "c": rng.integers(0, 12, 12), + } + ) left = dask_cudf.from_cudf(df1, 1).groupby("a").b.min().to_frame() right = dask_cudf.from_cudf(df2, 1).groupby("a").c.min().to_frame() @@ -257,8 +263,7 @@ def test_merge_should_fail(): left.merge(right, how="left", on=["c"]) # Same column names - - df2["b"] = np.random.randint(0, 12, 12) + df2["b"] = np.random.default_rng(seed=0).integers(0, 12, 12) right = dask_cudf.from_cudf(df2, 1).groupby("a").b.min().to_frame() with pytest.raises(KeyError): From 858afbbb55f4f9b0ded98e3cc6423b60015552ed Mon Sep 17 00:00:00 2001 From: galipremsagar Date: Mon, 7 Oct 2024 22:04:52 +0000 Subject: [PATCH 05/21] improve --- python/cudf/cudf/testing/_utils.py | 2 +- python/cudf/cudf/tests/test_binops.py | 10 +++++++--- python/cudf/cudf/tests/test_dataframe.py | 4 ++-- python/cudf/cudf/tests/test_datetime.py | 2 +- python/cudf/cudf/tests/test_indexing.py | 2 +- python/cudf/cudf/tests/test_resampling.py | 15 +++++++++------ 6 files changed, 21 insertions(+), 14 deletions(-) diff --git a/python/cudf/cudf/testing/_utils.py b/python/cudf/cudf/testing/_utils.py index 8a30b0ae6d6..38b46ff74c7 100644 --- a/python/cudf/cudf/testing/_utils.py +++ b/python/cudf/cudf/testing/_utils.py @@ -217,7 +217,7 @@ def gen_rand(dtype, size, **kwargs): if kwargs.get("positive_only", False): return res else: - return res * 2 - 1 + return 2 * res - 2 elif dtype == np.int8 or dtype == np.int16: low = kwargs.get("low", -32) high = kwargs.get("high", 32) diff --git a/python/cudf/cudf/tests/test_binops.py b/python/cudf/cudf/tests/test_binops.py index 474d64130eb..138e6e92515 100644 --- a/python/cudf/cudf/tests/test_binops.py +++ b/python/cudf/cudf/tests/test_binops.py @@ -960,11 +960,11 @@ def gen_df(): @pytest.mark.parametrize("nulls", _nulls) @pytest.mark.parametrize("other", ["df", "scalar"]) def test_logical_operator_func_dataframe(func, nulls, other): - rng = np.random.default_rng(seed=0) num_rows = 100 num_cols = 3 def gen_df(): + rng = np.random.default_rng(seed=0) pdf = pd.DataFrame() from string import ascii_lowercase @@ -983,8 +983,12 @@ def gen_df(): pdf1 = gen_df() pdf2 = gen_df() if other == "df" else 59.0 - gdf1 = cudf.DataFrame.from_pandas(pdf1) - gdf2 = cudf.DataFrame.from_pandas(pdf2) if other == "df" else 59.0 + gdf1 = cudf.DataFrame.from_pandas(pdf1, nan_as_null=False) + gdf2 = ( + cudf.DataFrame.from_pandas(pdf2, nan_as_null=False) + if other == "df" + else 59.0 + ) got = getattr(gdf1, func)(gdf2) expect = getattr(pdf1, func)(pdf2)[list(got._data)] diff --git a/python/cudf/cudf/tests/test_dataframe.py b/python/cudf/cudf/tests/test_dataframe.py index 13260e1cb90..b26e6b3e9b2 100644 --- a/python/cudf/cudf/tests/test_dataframe.py +++ b/python/cudf/cudf/tests/test_dataframe.py @@ -10537,10 +10537,10 @@ def test_dataframe_init_length_error(data, index): def test_dataframe_binop_with_mixed_date_types(): rng = np.random.default_rng(seed=0) df = pd.DataFrame( - rng.random(2, 2), + rng.random(size=(2, 2)), columns=pd.Index(["2000-01-03", "2000-01-04"], dtype="datetime64[ns]"), ) - ser = pd.Series(rng.random(3), index=[0, 1, 2]) + ser = pd.Series(rng.random(size=3), index=[0, 1, 2]) gdf = cudf.from_pandas(df) gser = cudf.from_pandas(ser) expected = df - ser diff --git a/python/cudf/cudf/tests/test_datetime.py b/python/cudf/cudf/tests/test_datetime.py index 14b53569860..33a93b02a3f 100644 --- a/python/cudf/cudf/tests/test_datetime.py +++ b/python/cudf/cudf/tests/test_datetime.py @@ -219,7 +219,7 @@ def test_sort_datetime(): rng = np.random.default_rng(seed=0) df = pd.DataFrame( { - "data": np.array( + "date": np.array( [ np.datetime64("2016-11-20"), np.datetime64("2020-11-20"), diff --git a/python/cudf/cudf/tests/test_indexing.py b/python/cudf/cudf/tests/test_indexing.py index 3145c48c0cb..421bc0c298b 100644 --- a/python/cudf/cudf/tests/test_indexing.py +++ b/python/cudf/cudf/tests/test_indexing.py @@ -594,7 +594,7 @@ def test_dataframe_series_loc_multiindex(obj): def test_series_iloc(nelem): # create random cudf.Series rng = np.random.default_rng(seed=0) - ps = pd.Series(rng.sample(nelem)) + ps = pd.Series(rng.random(nelem)) # gpu cudf.Series gs = cudf.Series(ps) diff --git a/python/cudf/cudf/tests/test_resampling.py b/python/cudf/cudf/tests/test_resampling.py index 4ac4484bf82..5ff0098bcf4 100644 --- a/python/cudf/cudf/tests/test_resampling.py +++ b/python/cudf/cudf/tests/test_resampling.py @@ -50,8 +50,9 @@ def test_series_upsample_simple(): @pytest.mark.parametrize("rule", ["2s", "10s"]) def test_series_resample_ffill(rule): - rng = pd.date_range("1/1/2012", periods=10, freq="5s") - ts = pd.Series(rng.integers(0, 500, len(rng)), index=rng) + date_idx = pd.date_range("1/1/2012", periods=10, freq="5s") + rng = np.random.default_rng(seed=0) + ts = pd.Series(rng.integers(0, 500, len(date_idx)), index=date_idx) gts = cudf.from_pandas(ts) assert_resample_results_equal( ts.resample(rule).ffill(), gts.resample(rule).ffill() @@ -60,8 +61,9 @@ def test_series_resample_ffill(rule): @pytest.mark.parametrize("rule", ["2s", "10s"]) def test_series_resample_bfill(rule): - rng = pd.date_range("1/1/2012", periods=10, freq="5s") - ts = pd.Series(rng.integers(0, 500, len(rng)), index=rng) + date_idx = pd.date_range("1/1/2012", periods=10, freq="5s") + rng = np.random.default_rng(seed=0) + ts = pd.Series(rng.integers(0, 500, len(date_idx)), index=date_idx) gts = cudf.from_pandas(ts) assert_resample_results_equal( ts.resample(rule).bfill(), gts.resample(rule).bfill() @@ -70,8 +72,9 @@ def test_series_resample_bfill(rule): @pytest.mark.parametrize("rule", ["2s", "10s"]) def test_series_resample_asfreq(rule): - rng = pd.date_range("1/1/2012", periods=100, freq="5s") - ts = pd.Series(rng.integers(0, 500, len(rng)), index=rng) + date_range = pd.date_range("1/1/2012", periods=100, freq="5s") + rng = np.random.default_rng(seed=0) + ts = pd.Series(rng.integers(0, 500, len(date_range)), index=date_range) gts = cudf.from_pandas(ts) assert_resample_results_equal( ts.resample(rule).asfreq(), gts.resample(rule).asfreq() From ebaa5624dad1d8032a1bfd0db156a99743e1b225 Mon Sep 17 00:00:00 2001 From: galipremsagar Date: Fri, 11 Oct 2024 19:31:34 +0000 Subject: [PATCH 06/21] more fixes --- python/cudf/cudf/_fuzz_testing/avro.py | 15 +- python/cudf/cudf/_fuzz_testing/csv.py | 40 ++--- python/cudf/cudf/_fuzz_testing/io.py | 5 +- python/cudf/cudf/_fuzz_testing/json.py | 14 +- python/cudf/cudf/_fuzz_testing/orc.py | 28 ++- python/cudf/cudf/_fuzz_testing/parquet.py | 14 +- .../_fuzz_testing/tests/fuzz_test_parquet.py | 6 +- python/cudf/cudf/_fuzz_testing/utils.py | 15 +- python/cudf/cudf/testing/dataset_generator.py | 169 ++++++++++-------- .../groupby/test_ordering_pandas_compat.py | 5 +- 10 files changed, 169 insertions(+), 142 deletions(-) diff --git a/python/cudf/cudf/_fuzz_testing/avro.py b/python/cudf/cudf/_fuzz_testing/avro.py index d9974037daa..4236ecb0219 100644 --- a/python/cudf/cudf/_fuzz_testing/avro.py +++ b/python/cudf/cudf/_fuzz_testing/avro.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2022, NVIDIA CORPORATION. +# Copyright (c) 2020-2024, NVIDIA CORPORATION. import copy import io @@ -68,12 +68,12 @@ def generate_input(self): # https://github.com/rapidsai/cudf/issues/6604 - cudf.utils.dtypes.TIMEDELTA_TYPES ) - + seed = random.randint(0, 2**32 - 1) dtypes_meta, num_rows, num_cols = _generate_rand_meta( - self, dtypes_list + self, dtypes_list, seed ) self._current_params["dtypes_meta"] = dtypes_meta - seed = random.randint(0, 2**32 - 1) + self._current_params["seed"] = seed self._current_params["num_rows"] = num_rows self._current_params["num_cols"] = num_cols @@ -100,17 +100,18 @@ def write_data(self, file_name): def set_rand_params(self, params): params_dict = {} + rng = np.random.default_rng() for param, values in params.items(): if values == ALL_POSSIBLE_VALUES: if param == "columns": col_size = self._rand(len(self._df.columns)) params_dict[param] = list( - np.unique(np.random.choice(self._df.columns, col_size)) + np.unique(rng.choice(self._df.columns, col_size)) ) elif param in ("skiprows", "num_rows"): - params_dict[param] = np.random.choice( + params_dict[param] = rng.choice( [None, self._rand(len(self._df))] ) else: - params_dict[param] = np.random.choice(values) + params_dict[param] = rng.choice(values) self._current_params["test_kwargs"] = self.process_kwargs(params_dict) diff --git a/python/cudf/cudf/_fuzz_testing/csv.py b/python/cudf/cudf/_fuzz_testing/csv.py index 67211a1c4bf..4ab666f1726 100644 --- a/python/cudf/cudf/_fuzz_testing/csv.py +++ b/python/cudf/cudf/_fuzz_testing/csv.py @@ -54,7 +54,7 @@ def generate_input(self): random.seed(seed) dtypes_list = list(cudf.utils.dtypes.ALL_TYPES) dtypes_meta, num_rows, num_cols = _generate_rand_meta( - self, dtypes_list + self, dtypes_list, seed ) self._current_params["dtypes_meta"] = dtypes_meta self._current_params["seed"] = seed @@ -77,25 +77,22 @@ def write_data(self, file_name): def set_rand_params(self, params): params_dict = {} + rng = np.random.default_rng() for param, values in params.items(): if values == ALL_POSSIBLE_VALUES: if param == "usecols": col_size = self._rand(len(self._df.columns)) - col_val = np.random.choice( + col_val = rng.choice( [ None, - np.unique( - np.random.choice(self._df.columns, col_size) - ), + np.unique(rng.choice(self._df.columns, col_size)), ] ) params_dict[param] = ( col_val if col_val is None else list(col_val) ) elif param == "dtype": - dtype_val = np.random.choice( - [None, self._df.dtypes.to_dict()] - ) + dtype_val = rng.choice([None, self._df.dtypes.to_dict()]) if dtype_val is not None: dtype_val = { col_name: "category" @@ -105,25 +102,25 @@ def set_rand_params(self, params): } params_dict[param] = dtype_val elif param == "header": - header_val = np.random.choice( - ["infer", np.random.randint(low=0, high=len(self._df))] + header_val = rng.choice( + ["infer", rng.integers(low=0, high=len(self._df))] ) params_dict[param] = header_val elif param == "skiprows": - params_dict[param] = np.random.randint( + params_dict[param] = rng.integers( low=0, high=len(self._df) ) elif param == "skipfooter": - params_dict[param] = np.random.randint( + params_dict[param] = rng.integers( low=0, high=len(self._df) ) elif param == "nrows": - nrows_val = np.random.choice( - [None, np.random.randint(low=0, high=len(self._df))] + nrows_val = rng.choice( + [None, rng.integers(low=0, high=len(self._df))] ) params_dict[param] = nrows_val else: - params_dict[param] = np.random.choice(values) + params_dict[param] = rng.choice(values) self._current_params["test_kwargs"] = self.process_kwargs(params_dict) @@ -159,7 +156,7 @@ def generate_input(self): random.seed(seed) dtypes_list = list(cudf.utils.dtypes.ALL_TYPES) dtypes_meta, num_rows, num_cols = _generate_rand_meta( - self, dtypes_list + self, dtypes_list, seed ) self._current_params["dtypes_meta"] = dtypes_meta self._current_params["seed"] = seed @@ -182,26 +179,25 @@ def write_data(self, file_name): def set_rand_params(self, params): params_dict = {} + rng = np.random.default_rng() for param, values in params.items(): if values == ALL_POSSIBLE_VALUES: if param == "columns": col_size = self._rand(len(self._current_buffer.columns)) params_dict[param] = list( np.unique( - np.random.choice( - self._current_buffer.columns, col_size - ) + rng.choice(self._current_buffer.columns, col_size) ) ) elif param == "chunksize": - params_dict[param] = np.random.choice( + params_dict[param] = rng.choice( [ None, - np.random.randint( + rng.integers( low=1, high=max(1, len(self._current_buffer)) ), ] ) else: - params_dict[param] = np.random.choice(values) + params_dict[param] = rng.choice(values) self._current_params["test_kwargs"] = self.process_kwargs(params_dict) diff --git a/python/cudf/cudf/_fuzz_testing/io.py b/python/cudf/cudf/_fuzz_testing/io.py index ffb7171a855..f267c5bf77e 100644 --- a/python/cudf/cudf/_fuzz_testing/io.py +++ b/python/cudf/cudf/_fuzz_testing/io.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2022, NVIDIA CORPORATION. +# Copyright (c) 2020-2024, NVIDIA CORPORATION. import copy import json @@ -91,8 +91,9 @@ def get_next_regression_params(self): return dtypes_meta, num_rows, num_cols, seed def set_rand_params(self, params): + rng = np.random.default_rng() params_dict = { - param: np.random.choice(values) for param, values in params.items() + param: rng.choice(values) for param, values in params.items() } self._current_params["test_kwargs"] = self.process_kwargs( params_dict=params_dict diff --git a/python/cudf/cudf/_fuzz_testing/json.py b/python/cudf/cudf/_fuzz_testing/json.py index e987529c8ba..9d437dd2247 100644 --- a/python/cudf/cudf/_fuzz_testing/json.py +++ b/python/cudf/cudf/_fuzz_testing/json.py @@ -80,7 +80,7 @@ def generate_input(self): # https://github.com/rapidsai/cudf/issues/7086 # dtypes_list.extend(["list"]) dtypes_meta, num_rows, num_cols = _generate_rand_meta( - self, dtypes_list + self, dtypes_list, seed ) self._current_params["dtypes_meta"] = dtypes_meta self._current_params["seed"] = seed @@ -105,14 +105,15 @@ def write_data(self, file_name): def set_rand_params(self, params): params_dict = {} + rng = np.random.default_rng() for param, values in params.items(): if param == "dtype" and values == ALL_POSSIBLE_VALUES: - dtype_val = np.random.choice( + dtype_val = rng.choice( [True, self._current_buffer.dtypes.to_dict()] ) params_dict[param] = _get_dtype_param_value(dtype_val) else: - params_dict[param] = np.random.choice(values) + params_dict[param] = rng.choice(values) self._current_params["test_kwargs"] = self.process_kwargs(params_dict) @@ -155,7 +156,7 @@ def generate_input(self): # https://github.com/rapidsai/cudf/issues/7086 # dtypes_list.extend(["list"]) dtypes_meta, num_rows, num_cols = _generate_rand_meta( - self, dtypes_list + self, dtypes_list, seed ) self._current_params["dtypes_meta"] = dtypes_meta self._current_params["seed"] = seed @@ -180,12 +181,13 @@ def write_data(self, file_name): def set_rand_params(self, params): params_dict = {} + rng = np.random.default_rng() for param, values in params.items(): if param == "dtype" and values == ALL_POSSIBLE_VALUES: - dtype_val = np.random.choice( + dtype_val = rng.choice( [True, self._current_buffer.dtypes.to_dict()] ) params_dict[param] = _get_dtype_param_value(dtype_val) else: - params_dict[param] = np.random.choice(values) + params_dict[param] = rng.choice(values) self._current_params["test_kwargs"] = self.process_kwargs(params_dict) diff --git a/python/cudf/cudf/_fuzz_testing/orc.py b/python/cudf/cudf/_fuzz_testing/orc.py index ecddc72fa85..bff8a061255 100644 --- a/python/cudf/cudf/_fuzz_testing/orc.py +++ b/python/cudf/cudf/_fuzz_testing/orc.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023, NVIDIA CORPORATION. +# Copyright (c) 2020-2024, NVIDIA CORPORATION. import copy import io @@ -62,13 +62,11 @@ def generate_input(self): - cudf.utils.dtypes.UNSIGNED_TYPES - {"datetime64[ns]"} ) - + seed = random.randint(0, 2**32 - 1) dtypes_meta, num_rows, num_cols = _generate_rand_meta( - self, dtypes_list + self, dtypes_list, seed ) - self._current_params["dtypes_meta"] = dtypes_meta - seed = random.randint(0, 2**32 - 1) self._current_params["seed"] = seed self._current_params["num_rows"] = num_rows self._current_params["num_cols"] = num_cols @@ -94,42 +92,41 @@ def write_data(self, file_name): def set_rand_params(self, params): params_dict = {} + rng = np.random.default_rng() for param, values in params.items(): if values == ALL_POSSIBLE_VALUES: if param == "columns": col_size = self._rand(len(self._df.columns)) params_dict[param] = list( - np.unique(np.random.choice(self._df.columns, col_size)) + np.unique(rng.choice(self._df.columns, col_size)) ) elif param == "stripes": f = io.BytesIO(self._current_buffer) orcFile = pa.orc.ORCFile(f) stripes = list(range(orcFile.nstripes)) - params_dict[param] = np.random.choice( + params_dict[param] = rng.choice( [ None, list( map( int, np.unique( - np.random.choice( - stripes, orcFile.nstripes - ) + rng.choice(stripes, orcFile.nstripes) ), ) ), ] ) elif param == "use_index": - params_dict[param] = np.random.choice([True, False]) + params_dict[param] = rng.choice([True, False]) elif param in ("skiprows", "num_rows"): - params_dict[param] = np.random.choice( + params_dict[param] = rng.choice( [None, self._rand(len(self._df))] ) else: if not isinstance(values, list): raise TypeError("values must be of type list") - params_dict[param] = np.random.choice(values) + params_dict[param] = rng.choice(values) self._current_params["test_kwargs"] = self.process_kwargs(params_dict) @@ -177,12 +174,11 @@ def generate_input(self): # https://github.com/rapidsai/cudf/issues/7355 - cudf.utils.dtypes.DATETIME_TYPES ) - + seed = random.randint(0, 2**32 - 1) dtypes_meta, num_rows, num_cols = _generate_rand_meta( - self, dtypes_list + self, dtypes_list, seed ) self._current_params["dtypes_meta"] = dtypes_meta - seed = random.randint(0, 2**32 - 1) self._current_params["seed"] = seed self._current_params["num_rows"] = num_rows self._current_params["num_cols"] = num_cols diff --git a/python/cudf/cudf/_fuzz_testing/parquet.py b/python/cudf/cudf/_fuzz_testing/parquet.py index 2d934e4816d..0f52795e2a2 100644 --- a/python/cudf/cudf/_fuzz_testing/parquet.py +++ b/python/cudf/cudf/_fuzz_testing/parquet.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2022, NVIDIA CORPORATION. +# Copyright (c) 2020-2024, NVIDIA CORPORATION. import logging import random @@ -59,12 +59,11 @@ def generate_input(self): - {"uint32"} | {"list", "decimal64"} ) - + seed = random.randint(0, 2**32 - 1) dtypes_meta, num_rows, num_cols = _generate_rand_meta( - self, dtypes_list + self, dtypes_list, seed ) self._current_params["dtypes_meta"] = dtypes_meta - seed = random.randint(0, 2**32 - 1) self._current_params["seed"] = seed self._current_params["num_rows"] = num_rows self._current_params["num_cols"] = num_cols @@ -96,14 +95,15 @@ def write_data(self, file_name): def set_rand_params(self, params): params_dict = {} + rng = np.random.default_rng() for param, values in params.items(): if param == "columns" and values == ALL_POSSIBLE_VALUES: col_size = self._rand(len(self._df.columns)) params_dict[param] = list( - np.unique(np.random.choice(self._df.columns, col_size)) + np.unique(rng.choice(self._df.columns, col_size)) ) else: - params_dict[param] = np.random.choice(values) + params_dict[param] = rng.choice(values) self._current_params["test_kwargs"] = self.process_kwargs(params_dict) @@ -146,7 +146,7 @@ def generate_input(self): | {"list", "decimal64"} ) dtypes_meta, num_rows, num_cols = _generate_rand_meta( - self, dtypes_list + self, dtypes_list, seed ) self._current_params["dtypes_meta"] = dtypes_meta self._current_params["seed"] = seed diff --git a/python/cudf/cudf/_fuzz_testing/tests/fuzz_test_parquet.py b/python/cudf/cudf/_fuzz_testing/tests/fuzz_test_parquet.py index 3d070576a12..bbc19dce1a4 100644 --- a/python/cudf/cudf/_fuzz_testing/tests/fuzz_test_parquet.py +++ b/python/cudf/cudf/_fuzz_testing/tests/fuzz_test_parquet.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2022, NVIDIA CORPORATION. +# Copyright (c) 2020-2024, NVIDIA CORPORATION. import sys @@ -68,7 +68,9 @@ def parquet_writer_test(pdf): @pythonfuzz( data_handle=ParquetWriter, params={ - "row_group_size": np.random.random_integers(1, 10000, 100), + "row_group_size": np.random.default_rng(seed=0).integers( + 1, 10000, 100 + ), "compression": ["snappy", None], }, ) diff --git a/python/cudf/cudf/_fuzz_testing/utils.py b/python/cudf/cudf/_fuzz_testing/utils.py index 8ce92e1c0f6..4cadb3a109c 100644 --- a/python/cudf/cudf/_fuzz_testing/utils.py +++ b/python/cudf/cudf/_fuzz_testing/utils.py @@ -40,8 +40,11 @@ } -def _generate_rand_meta(obj, dtypes_list, null_frequency_override=None): +def _generate_rand_meta( + obj, dtypes_list, null_frequency_override=None, seed=0 +): obj._current_params = {} + rng = np.random.default_rng(seed=seed) num_rows = obj._rand(obj._max_rows) num_cols = obj._rand(obj._max_columns) @@ -69,12 +72,12 @@ def _generate_rand_meta(obj, dtypes_list, null_frequency_override=None): meta["max_string_length"] = obj._max_string_length elif dtype == "list": if obj._max_lists_length is None: - meta["lists_max_length"] = np.random.randint(0, 2000000000) + meta["lists_max_length"] = rng.integers(0, 2000000000) else: meta["lists_max_length"] = obj._max_lists_length if obj._max_lists_nesting_depth is None: - meta["nesting_max_depth"] = np.random.randint( + meta["nesting_max_depth"] = rng.integers( 1, np.iinfo("int64").max ) else: @@ -85,7 +88,7 @@ def _generate_rand_meta(obj, dtypes_list, null_frequency_override=None): ) elif dtype == "struct": if obj._max_lists_nesting_depth is None: - meta["nesting_max_depth"] = np.random.randint(2, 10) + meta["nesting_max_depth"] = rng.integers(2, 10) else: meta["nesting_max_depth"] = obj._max_lists_nesting_depth @@ -95,9 +98,7 @@ def _generate_rand_meta(obj, dtypes_list, null_frequency_override=None): meta["max_null_frequency"] = obj._max_struct_null_frequency if obj._max_struct_types_at_each_level is None: - meta["max_types_at_each_level"] = np.random.randint( - low=1, high=10 - ) + meta["max_types_at_each_level"] = rng.integers(low=1, high=10) else: meta["max_types_at_each_level"] = ( obj._max_struct_types_at_each_level diff --git a/python/cudf/cudf/testing/dataset_generator.py b/python/cudf/cudf/testing/dataset_generator.py index 13c194d6be0..538b01c6157 100644 --- a/python/cudf/cudf/testing/dataset_generator.py +++ b/python/cudf/cudf/testing/dataset_generator.py @@ -48,16 +48,19 @@ def __init__( self, cardinality=100, null_frequency=0.1, - generator=lambda: [ - _generate_string(string.ascii_letters, random.randint(4, 8)) - for _ in range(100) - ], + generator=None, is_sorted=True, dtype=None, ): self.cardinality = cardinality self.null_frequency = null_frequency - self.generator = generator + if generator is None: + self.generator = lambda: [ + np.random.default_rng(seed=0).integers(0, 100) + for _ in range(100) + ] + else: + self.generator = generator self.is_sorted = is_sorted self.dtype = dtype @@ -96,7 +99,7 @@ def _write(tbl, path, format): tbl.to_parquet(path, row_group_size=format["row_group_size"]) -def _generate_column(column_params, num_rows): +def _generate_column(column_params, num_rows, rng): # If cardinality is specified, we create a set to sample from. # Otherwise, we simply use the given generator to generate each value. @@ -115,10 +118,8 @@ def _generate_column(column_params, num_rows): ) return pa.DictionaryArray.from_arrays( dictionary=vals, - indices=np.random.randint( - low=0, high=len(vals), size=num_rows - ), - mask=np.random.choice( + indices=rng.integers(low=0, high=len(vals), size=num_rows), + mask=rng.choice( [True, False], size=num_rows, p=[ @@ -142,7 +143,7 @@ def _generate_column(column_params, num_rows): column_params.generator, names=column_params.dtype.fields.keys(), mask=pa.array( - np.random.choice( + rng.choice( [True, False], size=num_rows, p=[ @@ -163,10 +164,10 @@ def _generate_column(column_params, num_rows): type=arrow_type, ) vals = pa.array( - np.random.choice(column_params.generator, size=num_rows) + rng.choice(column_params.generator, size=num_rows) if isinstance(arrow_type, pa.lib.Decimal128Type) - else np.random.choice(vals, size=num_rows), - mask=np.random.choice( + else rng.choice(vals, size=num_rows), + mask=rng.choice( [True, False], size=num_rows, p=[ @@ -189,7 +190,7 @@ def _generate_column(column_params, num_rows): # Generate data for current column return pa.array( column_params.generator, - mask=np.random.choice( + mask=rng.choice( [True, False], size=num_rows, p=[ @@ -233,7 +234,9 @@ def generate( def get_dataframe(parameters, use_threads): # Initialize seeds if parameters.seed is not None: - np.random.seed(parameters.seed) + rng = np.random.default_rng(seed=parameters.seed) # noqa: F841 + else: + rng = np.random.default_rng(seed=0) # noqa: F841 # For each column, invoke the data generator for column_params in parameters.column_parameters: @@ -281,14 +284,16 @@ def get_dataframe(parameters, use_threads): if not use_threads: for i, column_params in enumerate(parameters.column_parameters): column_data[i] = _generate_column( - column_params, parameters.num_rows + column_params, + parameters.num_rows, + rng, ) else: pool = Pool(pa.cpu_count()) column_data = pool.starmap( _generate_column, [ - (column_params, parameters.num_rows) + (column_params, parameters.num_rows, rng) for i, column_params in enumerate(parameters.column_parameters) ], ) @@ -336,7 +341,7 @@ def rand_dataframe( """ # Apply seed random.seed(seed) - np.random.seed(seed) + rng = np.random.default_rng(seed=seed) column_params = [] for meta in dtypes_meta: @@ -348,7 +353,7 @@ def rand_dataframe( lists_max_length = meta["lists_max_length"] nesting_max_depth = meta["nesting_max_depth"] value_type = meta["value_type"] - nesting_depth = np.random.randint(1, nesting_max_depth) + nesting_depth = rng.integers(1, nesting_max_depth) dtype = cudf.core.dtypes.ListDtype(value_type) @@ -368,19 +373,22 @@ def rand_dataframe( size=cardinality, nesting_depth=nesting_depth, lists_max_length=lists_max_length, + rng=rng, ), is_sorted=False, dtype=dtype, + rng=rng, ) ) elif dtype == "struct": nesting_max_depth = meta["nesting_max_depth"] max_types_at_each_level = meta["max_types_at_each_level"] max_null_frequency = meta["max_null_frequency"] - nesting_depth = np.random.randint(1, nesting_max_depth) + nesting_depth = rng.integers(1, nesting_max_depth) structDtype = create_nested_struct_type( max_types_at_each_level=max_types_at_each_level, nesting_level=nesting_depth, + rng=rng, ) column_params.append( @@ -392,6 +400,7 @@ def rand_dataframe( cardinality=cardinality, size=rows, max_null_frequency=max_null_frequency, + rng=rng, ), is_sorted=False, dtype=structDtype, @@ -401,14 +410,16 @@ def rand_dataframe( max_precision = meta.get( "max_precision", cudf.Decimal64Dtype.MAX_PRECISION ) - precision = np.random.randint(1, max_precision) - scale = np.random.randint(0, precision) + precision = rng.integers(1, max_precision) + scale = rng.integers(0, precision) dtype = cudf.Decimal64Dtype(precision=precision, scale=scale) column_params.append( ColumnParameters( cardinality=cardinality, null_frequency=null_frequency, - generator=decimal_generator(dtype=dtype, size=cardinality), + generator=decimal_generator( + dtype=dtype, size=cardinality, rng=rng + ), is_sorted=False, dtype=dtype, ) @@ -417,14 +428,16 @@ def rand_dataframe( max_precision = meta.get( "max_precision", cudf.Decimal32Dtype.MAX_PRECISION ) - precision = np.random.randint(1, max_precision) - scale = np.random.randint(0, precision) + precision = rng.integers(1, max_precision) + scale = rng.integers(0, precision) dtype = cudf.Decimal32Dtype(precision=precision, scale=scale) column_params.append( ColumnParameters( cardinality=cardinality, null_frequency=null_frequency, - generator=decimal_generator(dtype=dtype, size=cardinality), + generator=decimal_generator( + dtype=dtype, size=cardinality, rng=rng + ), is_sorted=False, dtype=dtype, ) @@ -433,14 +446,16 @@ def rand_dataframe( max_precision = meta.get( "max_precision", cudf.Decimal128Dtype.MAX_PRECISION ) - precision = np.random.randint(1, max_precision) - scale = np.random.randint(0, precision) + precision = rng.integers(1, max_precision) + scale = rng.integers(0, precision) dtype = cudf.Decimal128Dtype(precision=precision, scale=scale) column_params.append( ColumnParameters( cardinality=cardinality, null_frequency=null_frequency, - generator=decimal_generator(dtype=dtype, size=cardinality), + generator=decimal_generator( + dtype=dtype, size=cardinality, rng=rng + ), is_sorted=False, dtype=dtype, ) @@ -469,6 +484,7 @@ def rand_dataframe( size=cardinality, min_bound=meta.get("min_bound", None), max_bound=meta.get("max_bound", None), + rng=rng, ), is_sorted=False, dtype=dtype, @@ -484,6 +500,7 @@ def rand_dataframe( size=cardinality, min_bound=meta.get("min_bound", None), max_bound=meta.get("max_bound", None), + rng=rng, ), is_sorted=False, dtype=dtype, @@ -497,7 +514,8 @@ def rand_dataframe( generator=lambda cardinality=cardinality: [ _generate_string( string.printable, - np.random.randint( + rng, + rng.integers( low=0, high=meta.get("max_string_length", 1000), size=1, @@ -519,6 +537,7 @@ def rand_dataframe( size=cardinality, min_bound=meta.get("min_bound", None), max_bound=meta.get("max_bound", None), + rng=rng, ), is_sorted=False, dtype=cudf.dtype(dtype), @@ -534,6 +553,7 @@ def rand_dataframe( size=cardinality, min_bound=meta.get("min_bound", None), max_bound=meta.get("max_bound", None), + rng=rng, ), is_sorted=False, dtype=cudf.dtype(dtype), @@ -544,7 +564,7 @@ def rand_dataframe( ColumnParameters( cardinality=cardinality, null_frequency=null_frequency, - generator=boolean_generator(cardinality), + generator=boolean_generator(cardinality, rng), is_sorted=False, dtype=cudf.dtype(dtype), ) @@ -567,7 +587,7 @@ def rand_dataframe( return df -def int_generator(dtype, size, min_bound=None, max_bound=None): +def int_generator(dtype, size, rng, min_bound=None, max_bound=None): """ Generator for int data """ @@ -577,7 +597,7 @@ def int_generator(dtype, size, min_bound=None, max_bound=None): iinfo = np.iinfo(dtype) low, high = iinfo.min, iinfo.max - return lambda: np.random.randint( + return lambda: rng.integers( low=low, high=high, size=size, @@ -585,13 +605,13 @@ def int_generator(dtype, size, min_bound=None, max_bound=None): ) -def float_generator(dtype, size, min_bound=None, max_bound=None): +def float_generator(dtype, size, rng, min_bound=None, max_bound=None): """ Generator for float data """ if min_bound is not None and max_bound is not None: low, high = min_bound, max_bound - return lambda: np.random.uniform( + return lambda: rng.uniform( low=low, high=high, size=size, @@ -599,7 +619,7 @@ def float_generator(dtype, size, min_bound=None, max_bound=None): else: finfo = np.finfo(dtype) return ( - lambda: np.random.uniform( + lambda: rng.uniform( low=finfo.min / 2, high=finfo.max / 2, size=size, @@ -608,7 +628,7 @@ def float_generator(dtype, size, min_bound=None, max_bound=None): ) -def datetime_generator(dtype, size, min_bound=None, max_bound=None): +def datetime_generator(dtype, size, rng, min_bound=None, max_bound=None): """ Generator for datetime data """ @@ -618,14 +638,14 @@ def datetime_generator(dtype, size, min_bound=None, max_bound=None): iinfo = np.iinfo("int64") low, high = iinfo.min + 1, iinfo.max - return lambda: np.random.randint( + return lambda: rng.integers( low=np.datetime64(low, "ns").astype(dtype).astype("int"), high=np.datetime64(high, "ns").astype(dtype).astype("int"), size=size, ) -def timedelta_generator(dtype, size, min_bound=None, max_bound=None): +def timedelta_generator(dtype, size, rng, min_bound=None, max_bound=None): """ Generator for timedelta data """ @@ -635,25 +655,25 @@ def timedelta_generator(dtype, size, min_bound=None, max_bound=None): iinfo = np.iinfo("int64") low, high = iinfo.min + 1, iinfo.max - return lambda: np.random.randint( + return lambda: rng.integers( low=np.timedelta64(low, "ns").astype(dtype).astype("int"), high=np.timedelta64(high, "ns").astype(dtype).astype("int"), size=size, ) -def boolean_generator(size): +def boolean_generator(size, rng): """ Generator for bool data """ - return lambda: np.random.choice(a=[False, True], size=size) + return lambda: rng.choice(a=[False, True], size=size) -def decimal_generator(dtype, size): +def decimal_generator(dtype, size, rng): max_integral = 10 ** (dtype.precision - dtype.scale) - 1 max_float = (10**dtype.scale - 1) if dtype.scale != 0 else 0 return lambda: ( - np.random.uniform( + rng.uniform( low=-max_integral, high=max_integral + (max_float / 10**dtype.scale), size=size, @@ -661,32 +681,33 @@ def decimal_generator(dtype, size): ) -def get_values_for_nested_data(dtype, lists_max_length=None, size=None): +def get_values_for_nested_data(dtype, rng, lists_max_length=None, size=None): """ Returns list of values based on dtype. """ if size is None: - cardinality = np.random.randint(0, lists_max_length) + cardinality = rng.integers(0, lists_max_length) else: cardinality = size dtype = cudf.dtype(dtype) if dtype.kind in ("i", "u"): - values = int_generator(dtype=dtype, size=cardinality)() + values = int_generator(dtype=dtype, size=cardinality, rng=rng)() elif dtype.kind == "f": - values = float_generator(dtype=dtype, size=cardinality)() + values = float_generator(dtype=dtype, size=cardinality, rng=rng)() elif dtype.kind in ("U", "O"): values = [ _generate_string( string.printable, + rng, 100, ) for _ in range(cardinality) ] elif dtype.kind == "M": - values = datetime_generator(dtype=dtype, size=cardinality)().astype( - dtype - ) + values = datetime_generator( + dtype=dtype, size=cardinality, rng=rng + )().astype(dtype) elif dtype.kind == "m": values = timedelta_generator(dtype=dtype, size=cardinality)().astype( dtype @@ -699,14 +720,14 @@ def get_values_for_nested_data(dtype, lists_max_length=None, size=None): return values -def make_lists(dtype, lists_max_length, nesting_depth, top_level_list): +def make_lists(dtype, lists_max_length, nesting_depth, top_level_list, rng): """ Helper to create random list of lists with `nesting_depth` and specified value type `dtype`. """ nesting_depth -= 1 if nesting_depth >= 0: - L = np.random.randint(1, lists_max_length) + L = rng.integers(1, lists_max_length) for i in range(L): top_level_list.append( make_lists( @@ -714,11 +735,14 @@ def make_lists(dtype, lists_max_length, nesting_depth, top_level_list): lists_max_length=lists_max_length, nesting_depth=nesting_depth, top_level_list=[], + rng=rng, ) ) else: top_level_list = get_values_for_nested_data( - dtype=dtype, lists_max_length=lists_max_length + dtype=dtype, + lists_max_length=lists_max_length, + rng=rng, ) # To ensure numpy arrays are not passed as input to # list constructor, returning a python list object here. @@ -728,22 +752,22 @@ def make_lists(dtype, lists_max_length, nesting_depth, top_level_list): return top_level_list -def make_array_for_struct(dtype, cardinality, size, max_null_frequency): +def make_array_for_struct(dtype, cardinality, size, max_null_frequency, rng): """ Helper to create a pa.array with `size` and `dtype` for a `StructArray`. """ - null_frequency = np.random.uniform(low=0, high=max_null_frequency) - local_cardinality = max(np.random.randint(low=0, high=cardinality), 1) + null_frequency = rng.uniform(low=0, high=max_null_frequency) + local_cardinality = max(rng.integers(low=0, high=cardinality), 1) data = get_values_for_nested_data( - dtype=dtype.type.to_pandas_dtype(), size=local_cardinality + dtype=dtype.type.to_pandas_dtype(), size=local_cardinality, rng=rng ) - vals = np.random.choice(data, size=size) + vals = rng.choice(data, size=size) return pa.array( vals, - mask=np.random.choice( + mask=rng.choice( [True, False], size=size, p=[null_frequency, 1 - null_frequency], @@ -756,7 +780,7 @@ def make_array_for_struct(dtype, cardinality, size, max_null_frequency): ) -def get_nested_lists(dtype, size, nesting_depth, lists_max_length): +def get_nested_lists(dtype, size, nesting_depth, lists_max_length, rng): """ Returns a list of nested lists with random nesting depth and random nested lists length. @@ -776,7 +800,7 @@ def get_nested_lists(dtype, size, nesting_depth, lists_max_length): return list_of_lists -def get_nested_structs(dtype, cardinality, size, max_null_frequency): +def get_nested_structs(dtype, cardinality, size, max_null_frequency, rng): """ Returns a list of arrays with random data corresponding to the dtype provided. @@ -787,7 +811,7 @@ def get_nested_structs(dtype, cardinality, size, max_null_frequency): for name, col_dtype in dtype.fields.items(): if isinstance(col_dtype, cudf.StructDtype): result_arrays = get_nested_structs( - col_dtype, cardinality, size, max_null_frequency + col_dtype, cardinality, size, max_null_frequency, rng ) result_arrays = pa.StructArray.from_arrays( result_arrays, names=col_dtype.fields.keys() @@ -798,13 +822,14 @@ def get_nested_structs(dtype, cardinality, size, max_null_frequency): cardinality=cardinality, size=size, max_null_frequency=max_null_frequency, + rng=rng, ) list_of_arrays.append(result_arrays) return list_of_arrays -def list_generator(dtype, size, nesting_depth, lists_max_length): +def list_generator(dtype, size, nesting_depth, lists_max_length, rng): """ Generator for list data """ @@ -813,10 +838,11 @@ def list_generator(dtype, size, nesting_depth, lists_max_length): size=size, nesting_depth=nesting_depth, lists_max_length=lists_max_length, + rng=rng, ) -def struct_generator(dtype, cardinality, size, max_null_frequency): +def struct_generator(dtype, cardinality, size, max_null_frequency, rng): """ Generator for struct data """ @@ -825,25 +851,26 @@ def struct_generator(dtype, cardinality, size, max_null_frequency): cardinality=cardinality, size=size, max_null_frequency=max_null_frequency, + rng=rng, ) -def create_nested_struct_type(max_types_at_each_level, nesting_level): +def create_nested_struct_type(max_types_at_each_level, nesting_level, rng): dtypes_list = cudf.utils.dtypes.ALL_TYPES - picked_types = np.random.choice(list(dtypes_list), max_types_at_each_level) + picked_types = rng.choice(list(dtypes_list), max_types_at_each_level) type_dict = {} for name, type_ in enumerate(picked_types): if type_ == "struct": type_dict[str(name)] = create_nested_struct_type( - max_types_at_each_level, nesting_level - 1 + max_types_at_each_level, nesting_level - 1, rng ) else: type_dict[str(name)] = cudf.dtype(type_) return cudf.StructDtype(type_dict) -def _generate_string(str_seq: str, length: int = 10) -> str: - return "".join(random.choices(str_seq, k=length)) +def _generate_string(str_seq: str, rng, length: int = 10) -> str: + return "".join(rng.choices(str_seq, k=length)) def _unique_string() -> str: diff --git a/python/cudf/cudf/tests/groupby/test_ordering_pandas_compat.py b/python/cudf/cudf/tests/groupby/test_ordering_pandas_compat.py index a009802bab0..a8c5ae3b6a3 100644 --- a/python/cudf/cudf/tests/groupby/test_ordering_pandas_compat.py +++ b/python/cudf/cudf/tests/groupby/test_ordering_pandas_compat.py @@ -14,9 +14,10 @@ def with_nulls(request): @pytest.mark.parametrize("nrows", [30, 300, 300_000]) @pytest.mark.parametrize("nkeys", [1, 2, 4]) def test_groupby_maintain_order_random(nrows, nkeys, with_nulls): + rng = np.random.default_rng(seed=0) key_names = [f"key{key}" for key in range(nkeys)] - key_values = [np.random.randint(100, size=nrows) for _ in key_names] - value = np.random.randint(-100, 100, size=nrows) + key_values = [rng.integers(100, size=nrows) for _ in key_names] + value = rng.integers(-100, 100, size=nrows) df = cudf.DataFrame(dict(zip(key_names, key_values), value=value)) if with_nulls: for key in key_names: From e100e2d4c27d221b0163b26edd3b0295f88af7d7 Mon Sep 17 00:00:00 2001 From: galipremsagar Date: Fri, 11 Oct 2024 22:38:17 +0000 Subject: [PATCH 07/21] fix issues --- python/cudf/cudf/testing/dataset_generator.py | 4 ++-- python/cudf/cudf/tests/test_factorize.py | 10 ++++++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/python/cudf/cudf/testing/dataset_generator.py b/python/cudf/cudf/testing/dataset_generator.py index 538b01c6157..4cc5b00f63e 100644 --- a/python/cudf/cudf/testing/dataset_generator.py +++ b/python/cudf/cudf/testing/dataset_generator.py @@ -377,7 +377,6 @@ def rand_dataframe( ), is_sorted=False, dtype=dtype, - rng=rng, ) ) elif dtype == "struct": @@ -794,6 +793,7 @@ def get_nested_lists(dtype, size, nesting_depth, lists_max_length, rng): lists_max_length=lists_max_length, nesting_depth=nesting_depth, top_level_list=[], + rng=rng, ) ) @@ -870,7 +870,7 @@ def create_nested_struct_type(max_types_at_each_level, nesting_level, rng): def _generate_string(str_seq: str, rng, length: int = 10) -> str: - return "".join(rng.choices(str_seq, k=length)) + return "".join(rng.choice(list(str_seq), size=length)) def _unique_string() -> str: diff --git a/python/cudf/cudf/tests/test_factorize.py b/python/cudf/cudf/tests/test_factorize.py index cd558cc1415..cfb4ae2c0f8 100644 --- a/python/cudf/cudf/tests/test_factorize.py +++ b/python/cudf/cudf/tests/test_factorize.py @@ -19,7 +19,10 @@ def test_factorize_series_obj(ncats, nelem): df["cats"] = arr = rng.integers(2, size=10, dtype=np.int32) uvals, labels = df["cats"].factorize() - np.testing.assert_array_equal(labels.to_numpy(), sorted(set(arr))) + unique_values, indices = np.unique(arr, return_index=True) + expected_values = unique_values[np.argsort(indices)] + + np.testing.assert_array_equal(labels.to_numpy(), expected_values) assert isinstance(uvals, cp.ndarray) assert isinstance(labels, Index) @@ -38,7 +41,10 @@ def test_factorize_index_obj(ncats, nelem): df = df.set_index("cats") uvals, labels = df.index.factorize() - np.testing.assert_array_equal(labels.values.get(), sorted(set(arr))) + unique_values, indices = np.unique(arr, return_index=True) + expected_values = unique_values[np.argsort(indices)] + + np.testing.assert_array_equal(labels.values.get(), expected_values) assert isinstance(uvals, cp.ndarray) assert isinstance(labels, Index) From 33234fc08cae6bf6a06db6c16dee18488a82b2f0 Mon Sep 17 00:00:00 2001 From: galipremsagar Date: Sat, 12 Oct 2024 12:45:30 +0000 Subject: [PATCH 08/21] fix more failures --- python/cudf/cudf/core/dataframe.py | 1 + python/cudf/cudf/testing/_utils.py | 2 +- python/cudf/cudf/tests/test_binops.py | 12 ++++++++++-- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/python/cudf/cudf/core/dataframe.py b/python/cudf/cudf/core/dataframe.py index 3b09bf2c408..f8d544e04b1 100644 --- a/python/cudf/cudf/core/dataframe.py +++ b/python/cudf/cudf/core/dataframe.py @@ -5118,6 +5118,7 @@ def info( useful for big DataFrames and fine-tune memory optimization: >>> import numpy as np + >>> rng = np.random.default_rng(seed=0) >>> random_strings_array = rng.choice(['a', 'b', 'c'], 10 ** 6) >>> df = cudf.DataFrame({ ... 'column_1': rng.choice(['a', 'b', 'c'], 10 ** 6), diff --git a/python/cudf/cudf/testing/_utils.py b/python/cudf/cudf/testing/_utils.py index 38b46ff74c7..8a30b0ae6d6 100644 --- a/python/cudf/cudf/testing/_utils.py +++ b/python/cudf/cudf/testing/_utils.py @@ -217,7 +217,7 @@ def gen_rand(dtype, size, **kwargs): if kwargs.get("positive_only", False): return res else: - return 2 * res - 2 + return res * 2 - 1 elif dtype == np.int8 or dtype == np.int16: low = kwargs.get("low", -32) high = kwargs.get("high", 32) diff --git a/python/cudf/cudf/tests/test_binops.py b/python/cudf/cudf/tests/test_binops.py index 138e6e92515..206374a83cd 100644 --- a/python/cudf/cudf/tests/test_binops.py +++ b/python/cudf/cudf/tests/test_binops.py @@ -178,7 +178,13 @@ @pytest.mark.parametrize("obj_class", ["Series", "Index"]) @pytest.mark.parametrize("binop", _binops) -def test_series_binop(binop, obj_class): +def test_series_binop(request, binop, obj_class): + request.applymarker( + pytest.mark.xfail( + binop is operator.floordiv, + reason="https://github.com/rapidsai/cudf/issues/17073", + ) + ) nelem = 1000 arr1 = utils.gen_rand("float64", nelem) * 10000 # Keeping a low value because CUDA 'pow' has 2 full range error @@ -186,13 +192,15 @@ def test_series_binop(binop, obj_class): sr1 = Series(arr1) sr2 = Series(arr2) + psr1 = sr1.to_pandas() + psr2 = sr2.to_pandas() if obj_class == "Index": sr1 = Index(sr1) sr2 = Index(sr2) + expect = binop(psr1, psr2) result = binop(sr1, sr2) - expect = binop(pd.Series(arr1), pd.Series(arr2)) if obj_class == "Index": result = Series(result) From 5915e5b7ad4950363ebfc2e03da4b5f1ea9c3ca1 Mon Sep 17 00:00:00 2001 From: galipremsagar Date: Sat, 12 Oct 2024 12:54:26 +0000 Subject: [PATCH 09/21] update pre-commit --- .pre-commit-config.yaml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 09f441b143b..88ecf4f287c 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -95,6 +95,12 @@ repos: entry: 'pytest\.xfail' language: pygrep types: [python] + - id: no-unseeded-default-rng + name: no-unseeded-default-rng + description: 'Enforce that no non-seeded default_rng is used' + entry: 'default_rng\(\)' + language: pygrep + types: [python] - id: cmake-format name: cmake-format entry: ./cpp/scripts/run-cmake-format.sh cmake-format @@ -141,7 +147,6 @@ repos: hooks: - id: ruff files: python/.*$ - args: [ "--fix" ] - id: ruff-format files: python/.*$ - repo: https://github.com/rapidsai/pre-commit-hooks From 3d35be19744dadf52ff1aaffe2469da0408addf5 Mon Sep 17 00:00:00 2001 From: galipremsagar Date: Sat, 12 Oct 2024 12:58:41 +0000 Subject: [PATCH 10/21] fix default seed --- python/cudf/cudf/_fuzz_testing/avro.py | 2 +- python/cudf/cudf/_fuzz_testing/csv.py | 4 ++-- python/cudf/cudf/_fuzz_testing/io.py | 2 +- python/cudf/cudf/_fuzz_testing/json.py | 4 ++-- python/cudf/cudf/_fuzz_testing/orc.py | 2 +- python/cudf/cudf/_fuzz_testing/parquet.py | 2 +- python/cudf/cudf/tests/test_column.py | 2 +- python/dask_cudf/dask_cudf/tests/utils.py | 2 +- 8 files changed, 10 insertions(+), 10 deletions(-) diff --git a/python/cudf/cudf/_fuzz_testing/avro.py b/python/cudf/cudf/_fuzz_testing/avro.py index 4236ecb0219..172193aa672 100644 --- a/python/cudf/cudf/_fuzz_testing/avro.py +++ b/python/cudf/cudf/_fuzz_testing/avro.py @@ -100,7 +100,7 @@ def write_data(self, file_name): def set_rand_params(self, params): params_dict = {} - rng = np.random.default_rng() + rng = np.random.default_rng(seed=None) for param, values in params.items(): if values == ALL_POSSIBLE_VALUES: if param == "columns": diff --git a/python/cudf/cudf/_fuzz_testing/csv.py b/python/cudf/cudf/_fuzz_testing/csv.py index 4ab666f1726..fa3ed40ce91 100644 --- a/python/cudf/cudf/_fuzz_testing/csv.py +++ b/python/cudf/cudf/_fuzz_testing/csv.py @@ -77,7 +77,7 @@ def write_data(self, file_name): def set_rand_params(self, params): params_dict = {} - rng = np.random.default_rng() + rng = np.random.default_rng(seed=None) for param, values in params.items(): if values == ALL_POSSIBLE_VALUES: if param == "usecols": @@ -179,7 +179,7 @@ def write_data(self, file_name): def set_rand_params(self, params): params_dict = {} - rng = np.random.default_rng() + rng = np.random.default_rng(seed=None) for param, values in params.items(): if values == ALL_POSSIBLE_VALUES: if param == "columns": diff --git a/python/cudf/cudf/_fuzz_testing/io.py b/python/cudf/cudf/_fuzz_testing/io.py index f267c5bf77e..a4b8e18d8b4 100644 --- a/python/cudf/cudf/_fuzz_testing/io.py +++ b/python/cudf/cudf/_fuzz_testing/io.py @@ -91,7 +91,7 @@ def get_next_regression_params(self): return dtypes_meta, num_rows, num_cols, seed def set_rand_params(self, params): - rng = np.random.default_rng() + rng = np.random.default_rng(seed=None) params_dict = { param: rng.choice(values) for param, values in params.items() } diff --git a/python/cudf/cudf/_fuzz_testing/json.py b/python/cudf/cudf/_fuzz_testing/json.py index 9d437dd2247..45d2c8d8cf0 100644 --- a/python/cudf/cudf/_fuzz_testing/json.py +++ b/python/cudf/cudf/_fuzz_testing/json.py @@ -105,7 +105,7 @@ def write_data(self, file_name): def set_rand_params(self, params): params_dict = {} - rng = np.random.default_rng() + rng = np.random.default_rng(seed=None) for param, values in params.items(): if param == "dtype" and values == ALL_POSSIBLE_VALUES: dtype_val = rng.choice( @@ -181,7 +181,7 @@ def write_data(self, file_name): def set_rand_params(self, params): params_dict = {} - rng = np.random.default_rng() + rng = np.random.default_rng(seed=None) for param, values in params.items(): if param == "dtype" and values == ALL_POSSIBLE_VALUES: dtype_val = rng.choice( diff --git a/python/cudf/cudf/_fuzz_testing/orc.py b/python/cudf/cudf/_fuzz_testing/orc.py index bff8a061255..4d9e4abb09e 100644 --- a/python/cudf/cudf/_fuzz_testing/orc.py +++ b/python/cudf/cudf/_fuzz_testing/orc.py @@ -92,7 +92,7 @@ def write_data(self, file_name): def set_rand_params(self, params): params_dict = {} - rng = np.random.default_rng() + rng = np.random.default_rng(seed=None) for param, values in params.items(): if values == ALL_POSSIBLE_VALUES: if param == "columns": diff --git a/python/cudf/cudf/_fuzz_testing/parquet.py b/python/cudf/cudf/_fuzz_testing/parquet.py index 0f52795e2a2..bd3df1b0847 100644 --- a/python/cudf/cudf/_fuzz_testing/parquet.py +++ b/python/cudf/cudf/_fuzz_testing/parquet.py @@ -95,7 +95,7 @@ def write_data(self, file_name): def set_rand_params(self, params): params_dict = {} - rng = np.random.default_rng() + rng = np.random.default_rng(seed=None) for param, values in params.items(): if param == "columns" and values == ALL_POSSIBLE_VALUES: col_size = self._rand(len(self._df.columns)) diff --git a/python/cudf/cudf/tests/test_column.py b/python/cudf/cudf/tests/test_column.py index 6073c4e6434..c5b3191edd1 100644 --- a/python/cudf/cudf/tests/test_column.py +++ b/python/cudf/cudf/tests/test_column.py @@ -31,7 +31,7 @@ @pytest.fixture(params=dtypes, ids=dtypes) def pandas_input(request): dtype = request.param - rng = np.random.default_rng() + rng = np.random.default_rng(seed=None) size = 100 def random_ints(dtype, size): diff --git a/python/dask_cudf/dask_cudf/tests/utils.py b/python/dask_cudf/dask_cudf/tests/utils.py index 1744b08cd8d..9aaf6dc8420 100644 --- a/python/dask_cudf/dask_cudf/tests/utils.py +++ b/python/dask_cudf/dask_cudf/tests/utils.py @@ -19,7 +19,7 @@ def _make_random_frame(nelem, npartitions=2, include_na=False): - rng = np.random.default_rng() + rng = np.random.default_rng(seed=None) df = pd.DataFrame( {"x": rng.random(size=nelem), "y": rng.random(size=nelem)} ) From 8336a5f6623cda234173e0db734cfa20efa9980b Mon Sep 17 00:00:00 2001 From: galipremsagar Date: Sat, 12 Oct 2024 12:59:48 +0000 Subject: [PATCH 11/21] style --- python/cudf/cudf/tests/test_parquet.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/python/cudf/cudf/tests/test_parquet.py b/python/cudf/cudf/tests/test_parquet.py index 6d3ff918673..c9ce24d2a5b 100644 --- a/python/cudf/cudf/tests/test_parquet.py +++ b/python/cudf/cudf/tests/test_parquet.py @@ -455,7 +455,9 @@ def test_parquet_read_filtered(tmpdir, rdg_seed): dg.ColumnParameters( 40, 0.2, - lambda: np.random.default_rng().integers(0, 100, size=40), + lambda: np.random.default_rng(seed=None).integers( + 0, 100, size=40 + ), True, ), ], From cd7e1984f2c22ad7f770680cd874455c420c54af Mon Sep 17 00:00:00 2001 From: galipremsagar Date: Mon, 14 Oct 2024 19:16:33 +0000 Subject: [PATCH 12/21] update files --- .../bert_base_cased_sampled/vocab-hash.txt | 8580 ++++++++--------- python/cudf/cudf/utils/hash_vocab_utils.py | 16 +- 2 files changed, 4297 insertions(+), 4299 deletions(-) diff --git a/python/cudf/cudf/tests/data/subword_tokenizer_data/bert_base_cased_sampled/vocab-hash.txt b/python/cudf/cudf/tests/data/subword_tokenizer_data/bert_base_cased_sampled/vocab-hash.txt index 84b13c9d946..566ac2c337d 100644 --- a/python/cudf/cudf/tests/data/subword_tokenizer_data/bert_base_cased_sampled/vocab-hash.txt +++ b/python/cudf/cudf/tests/data/subword_tokenizer_data/bert_base_cased_sampled/vocab-hash.txt @@ -1,4382 +1,4382 @@ -26899 -27424 +19535 +9039 875 -7428432802425011718 0 -5054974408289448963 6 -18358444369622338053 9 -5716902217424485892 14 -8236612966193239043 18 -15282833726017872390 21 -15533348956988973570 27 -9001315167781089284 29 -7621090240282984451 33 -15337888141402371590 36 -16169070283077377537 42 -15615300272936709634 43 -12338784885023498756 45 -3175624061711419395 49 -9436392785812228615 52 -12978641027296058883 59 -14468815760709033991 62 -15607694490571932163 69 -53295083356623878 72 -0 78 -2230148770582976004 78 -6120456721458209796 82 -15411373208619074054 86 -10274574020114097153 92 -9000294930530661890 93 -13031557903172483076 95 -11350066664294002181 99 -6325605033787362307 104 -2909954277284188676 107 -4104562716099355138 111 -3267092979937387012 113 -17525453481571210244 117 -11532627846208440834 121 -10784672185103672321 123 -11229796758348255749 124 -4379577250247562242 129 -1041161126836283908 131 -3854383966527313413 135 -16467720483237810694 140 -14820844471735454722 146 -13111220924289178119 148 -2548683052821249538 155 -719749806464434178 157 -2121722119826170883 159 -9005614210949580292 162 -7050169108294333445 166 -17351764915062575107 171 -14644698505496219141 174 -11657834349296686081 179 -13626797927783164930 180 -14735048589438940164 182 -1078491261937017863 186 -7952761372439242754 193 -7692446865301965827 195 -4552111108816020995 198 -12455022990418032132 201 -1123962659471997957 205 -3056549312838577156 210 -1025661670765243906 214 -5397331336358247944 216 -7810366437124875782 224 -1195318972358038531 230 -7079722807026103811 233 -2524512050942986248 236 -1208593608912656389 244 -458260789232344578 249 -13194777122325112327 251 -5922704468287492 258 -11746235869336195079 262 -8611574268876189188 269 -7889840228953421829 273 -16998721522558936068 278 -6703563424903621638 282 -8885848295085850114 288 -13776273837475230211 290 -6036043703810622467 293 -2006225773287659526 296 -14202467530861800964 302 -7157057020317447684 306 -16885485872491802629 310 -12800303798361952772 315 -621325108927868418 319 -16727475898656483841 321 -6890112792805515778 322 -2421332377941126151 324 -16243404411124196356 331 -179400401794890244 335 -2630159406474274819 339 -1306609735592145925 342 -14908020842914311174 347 -1684452927247835651 353 -9400495923215416322 356 -8041860727239247878 358 -5619270496913133574 364 -2985476283152588291 370 -18150632792370312198 373 -13075355875451793410 379 -7596576612263365635 381 -7174955249282660868 384 -2272878747426984963 388 -9645618748109430277 391 -5995177571885476868 396 -16871713338758691845 400 -11801224416933808644 405 -15551192014010130949 409 -8196030292452405250 414 -4794784530053649411 416 -68047322062825475 419 -10163451915097363972 422 -4366630365820669955 426 -9174613115382159879 429 -17673253091692480002 436 -10710744348807818249 438 -6301209632168211460 447 -6557199531177304066 451 -10370980735304160259 453 -2426040420413965827 456 -18123352379522220547 459 -15891150425892429319 462 -16507447417454265351 469 -487708338428237827 476 -14107089365716616196 479 -747857609528251395 483 -17357876987202521607 486 -321005419951863300 493 -703083947315053061 497 -0 502 -17149635587492691460 502 -8277651075246678020 506 -1819886593879462403 510 -13106328552418381315 513 -17519686381941948418 516 -10696099526822671877 518 -4627984173327437314 523 -2628632462897246722 525 -3686397216490033667 527 -6617920799692924934 530 -6679301623707790339 536 -2596030458845084674 539 -13288938917088308226 541 -8348492885671808517 543 -6252009608718840325 548 -5807005916268695559 553 -15382799971167504899 560 -14954638692016032262 563 -8963684459383523331 569 -2934745887866391556 572 -8236887590303639044 576 -2016330563068923911 580 -12976290063611676164 587 -9986513189506445831 591 -780378482699725318 598 -383862355994530823 604 -7511344867307093508 611 -1435616864863593988 615 -12590979271693393411 619 -859813995721111047 622 -17910873098448224770 629 -16703366890805911553 631 -6922480979814889987 632 -8200210214462711297 635 -18382541080931060232 636 -12959023536126992897 644 -11055794376142651906 645 -8668012051305565187 647 -6795201209679524868 650 -3864186432644490244 654 -4574634299775772674 658 -2086703290536303619 660 -7145543127561014787 663 -9889572542971630085 666 -3510566585561691650 671 -10482036181312531460 673 -4296479271603189251 677 -17165580381790665732 680 -17931697598514948104 684 -5072138329769649158 692 -17857316349005986308 698 -1196313437880152072 702 -16094827446472526340 710 -6365083142954013701 714 -17639674970007880709 719 -1336948026798963208 724 -15719079816546418177 732 -453771991153695748 733 -15666021623592344581 737 -3887496731301423107 742 -16351565489992748547 745 -12913808626051103749 748 -9427161342471792643 753 -14610089064185748483 756 -11909740995340709890 759 -3386059367942955011 761 -7100313088634791944 764 -14954362273735097348 772 -5300343188950335490 776 -3306636399811602435 778 -15049176780536452612 781 -11478464585367391747 785 -4192691696663825924 788 -1724981527538165256 792 -8923121468991320579 800 -10407927314751914499 803 -4140577061391662082 806 -11024499228689010181 808 -11103397578962422789 813 -16103730809841527300 818 -2161511371026989571 822 -16905537098408481288 825 -14418359835235787780 833 -8643099440826274820 837 -15803230958149170691 841 -2270949347024239618 844 -16607521085023703556 846 -12520505897845165062 850 -10502193626894192132 856 -12350321094518214659 860 -4950437143309872131 863 -938542234576037889 866 -9547302901107668484 867 -7827404372121768966 871 -17757593377946824198 877 -13699186867246955524 883 -9859653826627356163 887 -16394835100035514883 890 -13800374264730731525 893 -16954635983094506500 898 -8015308433863798275 902 -858715644299290630 905 -4519655150699331077 911 -7134867591233050115 916 -6432786657037144579 919 -0 922 -9408341322832972291 922 -13653279902433200130 925 -1249019122170091524 927 -5444522055126761479 931 -18233734556082323457 938 -1838285473517654531 939 -10799019207790220804 942 -2448710159565130755 946 -18425837006146807297 949 -1384258267102048263 950 -6553795393861204486 957 -5022631533298058243 963 -2595435540421003780 966 -18298501952506793480 970 -17380720526409169413 978 -10291550905275666437 983 -8968303908578660869 988 -7762552109517888009 993 -12993351549860134403 1002 -13098482377540869636 1005 -17174134275815044100 1009 -2405939573849534980 1013 -11051603729345690626 1017 -2765842466801084934 1019 -13348255112383532037 1025 -4560899789258637829 1030 -17071422935680193539 1035 -11513452937230732294 1038 -1637355496640499203 1044 -14940739688966611972 1047 -8286559267538602502 1051 -6029036263825492484 1057 -6337648087046756355 1061 -12327119652833755139 1064 -7489768843341343236 1067 -17101806024406781955 1071 -1494687508867621385 1074 -915975103999953922 1083 -14731060910946571783 1085 -7993361195780195330 1092 -13688799604315935236 1094 -7328858946338903047 1098 -2913637027195678723 1105 -18189363439163655681 1108 -11261484070936291332 1109 -1244962005334571010 1113 -12618388435910808066 1115 -655187203027088898 1117 -1699259352638115337 1119 -9837815037477742085 1128 -10558465000768489987 1133 -3128326958710492164 1136 -16210393874387209731 1140 -3831602806328386054 1143 -1858477608543888899 1149 -11203849268139405826 1152 -14876215834473532933 1154 -838167957834962945 1159 -4472540425609859076 1160 -11410947109444917250 1164 -8435818218907397633 1166 -11045000766266457089 1167 -12325335880954441220 1168 -16708265953266297345 1172 -18342265362969646594 1173 -6953158344648897539 1175 -9922701673105435137 1178 -10113283973443524101 1179 -11668798096262926343 1184 -2129351334726026241 1191 -5692959118811792390 1192 -2917574127780044290 1198 -0 1200 -14420924818562740228 1200 -6098057863303978497 1204 -1252966646111680002 1205 -7111078464697947144 1207 -14144456899593720327 1215 -7367692118573781509 1222 -9319588592876439043 1227 -5212294342286609410 1230 -1600499660866511361 1232 -17579747388547180552 1233 -8365608306992954885 1241 -10307394306592963076 1246 -17092600292669807621 1250 -17030981925892977667 1255 -6929843536411176451 1258 -9908722951841282057 1261 -14685407131320535554 1270 -12861962652898171396 1272 -11958437143660911107 1276 -15904867421058229764 1279 -7283769647955500035 1283 -7872121678898447876 1286 -11726527760261815816 1290 -2316085662456682505 1298 -12840093831481137155 1307 -15574983692566917639 1310 -15176154862895929860 1317 -16186650646772958214 1321 -1965140296142659588 1327 -17362020270091437575 1331 -26356620300320263 1338 -4688323194808506371 1345 -470137109846916612 1348 -785647648524588041 1352 -686083037273571331 1361 -8705676087000994307 1364 -15985311040931325446 1367 -8848102120172622345 1373 -14900059783221505542 1382 -11611185676221023751 1388 -5823293000835959809 1395 -11173877492782561286 1396 -5985141512875075076 1402 -16607272189142469634 1406 -7000924871247012354 1408 -12796508861938638339 1410 -16352304696891085315 1413 -12654027566339262469 1416 -17652126895193709571 1421 -2059554016646703617 1424 -8824828815238545922 1425 -8026041213654553606 1427 -189105210507091461 1433 -8038465995762949635 1438 -0 1441 -4346653818095449092 1441 -13441396742193060358 1445 -5067771148519478785 1451 -210369551309682178 1452 -7856429334361659909 1454 -6456628847560069634 1459 -4777640967745320451 1461 -8983636279512822276 1464 -14568805960710332932 1468 -13817574021643753989 1472 -14625711259902278149 1477 -4632056779689710085 1482 -17613320542667293189 1487 -3172012402848437254 1492 -8040798394603101188 1498 -14064841209998140419 1502 -1914908168343121410 1505 -7368139610144548354 1507 -12868473585497306119 1509 -0 1516 -1618708134596732930 1516 -12587973098332420105 1518 -4964388169698209795 1527 -11644359715676310021 1530 -2644060095775605251 1535 -6430078223195648003 1538 -10183198452214045187 1541 -1240799682393062914 1544 -594310634075621378 1546 -2369514519273954820 1548 -10180653661786314245 1552 -954303650251543043 1557 -14430712698160791045 1560 -7362398115224322564 1565 -17170839233019868678 1569 -4334478792852912645 1575 -6976600872204725253 1580 -2757627166710815234 1585 -11581525848542896643 1587 -1902097979216049156 1590 -7092174838851165700 1594 -3776232881097953287 1598 -4956341896516184071 1605 -16560365104979398147 1612 -9985649880040289799 1615 -8870322153106933763 1622 -6905121755133908995 1625 -13368640352340902916 1628 -6681848478588709895 1632 -1825204937600832520 1639 -10492979809894170628 1647 -16021790814379410438 1651 -2537982728896871938 1657 -17110141827238231043 1659 -8972517116882764291 1662 -6878463938568223238 1665 -3653948979877717506 1671 -11414481194651397126 1673 -14522267179648162819 1679 -3098339502618796035 1682 -7079749050994126342 1685 -13571764215085394946 1691 -4748948606525397506 1693 -1577643399485818884 1695 -4080235243237779462 1699 -10874175738252140040 1705 -8407257242091918850 1713 -13208300770644489219 1715 -692428139842995202 1718 -1811883090719733762 1720 -9059362818280152070 1722 -1942856588307002885 1728 -8118332366482353665 1733 -4958069245857057284 1734 -14647311378680886789 1738 -10762024033896625670 1743 -28898254948429830 1749 -9834906317233815042 1755 -14985989359682912259 1757 -1282980713864208388 1760 -6063131598875265027 1764 -11171681444901584901 1767 -9942643440891227650 1772 -7536761905759707139 1774 -17586310513048226310 1777 -5368266791748388869 1783 -14231943828217691651 1788 -12518647321260815877 1791 -129394441281844743 1796 -2483490487411335170 1803 -654244401428041732 1805 -15646533714849457160 1809 -11807354932867949571 1817 -15902831808268765699 1820 -16275101253541722114 1823 -7489443708629377026 1825 -15395914353243975682 1827 -5617555619731661829 1829 -3134100206450675206 1834 -11607495136261988868 1840 -4974806308616426501 1844 -17446584074836170241 1849 -15686830167444742663 1850 -9706307518401206273 1857 -1668062460313515521 1858 -1175330870409010693 1859 -6316020408117881860 1864 -3926008952689808899 1868 -7412001888157663237 1871 -16350342416828571139 1876 -17722048717800707588 1879 -6638262866276511751 1883 -7428951476729761793 1890 -17816197047883941382 1891 -1346568064340942337 1897 -3701787015222295555 1898 -6659812133237486083 1901 -1828541539854978054 1904 -12379063259192634885 1910 -2611769333840765443 1915 -9618163593004828678 1918 -10135224491789939206 1924 -12979651712861326853 1930 -8882180359699969027 1935 -8839565787481092102 1938 -13328456084920556038 1944 -14232512278042323458 1950 -1868952656876792325 1952 -7567044498348088836 1957 -9878469525845452294 1961 -10877666723773861891 1967 -4437849393189355524 1970 -542122243470857732 1974 -4059190346138068994 1978 -14321675947144358916 1980 -14971180244834539009 1984 -7944574903635664900 1985 -6982417546170903047 1989 -9205813465909939715 1996 -14237044737088801799 1999 -636814072910696963 2006 -12520841226045264391 2009 -8898943418672995331 2016 -15646690259358356484 2019 -15618851112604340228 2023 -10285088843216830977 2027 -18286036510192394760 2028 -6450286360774949890 2036 -12025307250191760899 2038 -7044602746592181249 2041 -8270361223031661060 2042 -7199149542695273990 2046 -16798091800673956358 2052 -5285433079037354499 2058 -8498140496880657410 2061 -18434636390635965953 2063 -8780418579830073348 2064 -959965579978681347 2068 -2666650386212475906 2071 -4093783342266269185 2073 -7977153448080645638 2074 -3230317076849645570 2080 -2644129221999468547 2082 -7597431151331275265 2085 -6151418962808616963 2086 -16786361788616914434 2089 -9522044737514147334 2091 -15360350686533802498 2097 -4398995179394704386 2099 -4163122903470647302 2101 -18110267126768664070 2107 -17811600627481865731 2113 -11988559903619469315 2116 -5893679902922151940 2119 -3302430115655037445 2123 -2756050317441962502 2128 -7373324598575981572 2134 -15626353672087051269 2138 -9026268416534243843 2143 -5857105831257628164 2146 -11246462751297413124 2150 -7459631049065515526 2154 -2175352842263141379 2160 -9748465532031254533 2163 -12060676108130005507 2168 -8160425232164846593 2171 -1665947540125783558 2172 -10758171140537368580 2178 -5744770555727548418 2182 -15867521551313803780 2184 -11178209498970826244 2188 -2663862265833334277 2192 -646145646253570050 2197 -6886825228888300036 2199 -5219187155516171272 2203 -16142200027647465989 2211 -8727938199665870852 2216 -1200328579526163971 2220 -12449385538114001417 2223 -14632283715533800450 2232 -5295800027246062086 2234 -8827019094633400323 2240 -14543826221768176641 2243 -12388128316821831686 2244 -3087048392675298821 2250 -17669786912563615747 2255 -3879520399747123716 2258 -15648071975541157893 2262 -5580473107362200071 2267 -6895786389712974853 2274 -17709709086906012676 2279 -9627483233657542665 2283 -9602326803985618949 2292 -6748599026443758086 2297 -11488364339401397254 2303 -6716511183525677573 2309 -16003763240189186563 2314 -6003803301075291138 2317 -15800367754014516746 2319 -2817341800198731782 2329 -2110085916033252869 2335 -10353852055773781511 2340 -8745468498457416193 2347 -15197463976907486213 2348 -11844773108515011075 2353 -10745169896165544965 2356 -9502565595236673539 2361 -18340734722524717062 2364 -0 2370 -4877506240735029250 2370 -6632868101528461318 2372 -1094192348264738308 2378 -15930308455756352518 2382 -7517061312773919237 2388 -11537382714050522116 2393 -15343851421525887493 2397 -15685583084244037124 2402 -11443729733346354693 2406 -18096845502703148037 2411 -13060060807344890377 2416 -8226818503915081731 2425 -5171144332412330499 2428 -5367144440061049859 2431 -4687503341676126209 2434 -8115677569098133507 2435 -8753274682505368066 2438 -6767268893840927749 2440 -10747160183142327300 2445 -5318831768157948930 2449 -16744837601970291208 2451 -3968740997769839108 2459 -1041860322726726147 2463 -13185494599343868419 2466 -3781663100474830852 2469 -8664347289501861378 2473 -7145447006642560001 2475 -977858689003972101 2476 -188865761021926916 2481 -14781205616979726850 2485 -7514076159997088261 2487 -15227633270557658627 2492 -7486357174119883778 2495 -7899052859637422087 2497 -4312982947448530435 2504 -2484418012864310785 2507 -8450324929602980870 2508 -11374778755239228418 2514 -10780034123560756745 2516 -10313953391808102916 2525 -13836623279669341188 2529 -16297706918062760459 2533 -6404560275247226885 2544 -8323769790774729734 2549 -10061687257419431941 2555 -6724033317759518212 2560 -12265972209834273288 2564 -4748706107567735299 2572 -17588235414846031363 2575 -16029681841978911746 2578 -333014962274056196 2580 -2819861156000228870 2584 -17301319418358929926 2590 -14323022738651812355 2596 -17758251407482208260 2599 -9992216596142364674 2603 -5541911712511293955 2605 -1880849355295036931 2608 -15421034026101803523 2611 -2288503501826235907 2614 -2336333131728265731 2617 -15127408664422292997 2620 -6756061181968708102 2625 -2316367058427453443 2631 -13786932856453332482 2634 -17564157627292750852 2636 -5809790665868502019 2640 -9389430036410766853 2643 -15157257604368261123 2648 -523412383725034497 2651 -5270886391729814021 2652 -8987256414287503365 2657 -2751897370690544643 2662 -47819066577966599 2665 -9543124453318907909 2672 -15186331456703232514 2677 -9731347057535958023 2679 -6234700495105510914 2686 -17720066604242729989 2688 -611878128332703234 2693 -6029104170087404549 2695 -14612606995632327172 2700 -7357792311987945475 2704 -6074856230289873410 2707 -13368808999886628358 2709 -5918378978107988995 2715 -15624776793824203778 2718 -4241055509726121476 2720 -12687432015779367427 2724 -4003272975122620932 2727 -17483676776191982087 2731 -2701605488646040584 2738 -7387630099939362308 2746 -16331822462747681798 2750 -2197183442359868933 2756 -17624623361194542087 2761 -1749450990014992388 2768 -2888206094896619010 2772 -12985412669390948353 2774 -9843120678422464515 2775 -15590458610270713859 2778 -5950622975418741251 2781 -17607672802725530117 2784 -1225097419526011394 2789 -3758572251524375044 2791 -5891371767718009858 2795 -6843754938996156419 2797 -13418347525088883204 2800 -2887280155684756490 2804 -7867196614872225796 2814 -10992396837241625094 2818 -15526482250456426497 2824 -7582254907030848515 2825 -14309589056601523716 2828 -2843794758628944386 2832 -10106627892829635078 2834 -11117505412117820418 2840 -17559521087909430786 2842 -18410508844162253834 2844 -7796754440171003912 2854 -1826091018065355268 2862 -5568124937607335426 2866 -9164033835486570503 2868 -7917102923116225537 2875 -10708221634884163076 2876 -966446973350329348 2880 -1882776320247897092 2884 -18137433528115911172 2888 -7577505208556149252 2892 -3902521102041700356 2896 -11942362790107158020 2900 -2328713611561709573 2904 -8376513561567004165 2909 -18415012889800110091 2914 -7983446382889179652 2925 -2304166271864391689 2929 -708759182721729026 2938 -10774631175750681603 2940 -2608247964063907842 2943 -7317603117343176707 2945 -12615180422705001477 2948 -17995452459822326275 2953 -12439250137675515394 2956 -9947610136498965509 2958 -10340600516380348420 2963 -10073894039732477444 2967 -15954561361998232578 2971 -6039226287079734788 2973 -12684813664097613833 2977 -8337524429261820932 2986 -0 2990 -5738139389410570757 2990 -0 2995 -163262518049440773 2995 -11390362112332120070 3000 -7666496378417453571 3006 -17188351170280199170 3009 -14157925477049500677 3011 -16535316221715341826 3016 -701193705161007105 3018 -15417977144980853763 3019 -9623949443365348357 3022 -16537640731048440324 3027 -9880057250380779521 3031 -10507448958568448514 3032 -9901540867816521219 3034 -10882434502571251716 3037 -15939490563935542790 3041 -3818155241101528578 3047 -10810785028031231493 3049 -17268925026504538113 3054 -6000103580025957894 3055 -14492044616225970179 3061 -8964295197943843335 3064 -13244227239481936387 3071 -2072267724499101186 3074 -735562179013069826 3076 -3271477415853879302 3078 -1150251700717751812 3084 -11835839830005115393 3088 -17028480913889055238 3089 -16864969398419772420 3095 -9646252156141336066 3099 -5589333819644110342 3101 -14729039479109188098 3107 -2256025994407046148 3109 -5630416426912279555 3113 -23611161351524356 3116 -16061932977440933889 3120 -7560058124185071106 3121 -8943767870065516551 3123 -17388385529962317834 3130 -11686727589179028995 3140 -2993671307613155843 3143 -7451626547139373061 3146 -12726375988952098305 3151 -0 3152 -1735273330892205060 3152 -2746028049042776065 3156 -17093562035495421445 3157 -7598703106262353411 3162 -17526920923827930631 3165 -0 3172 -18087597149122765317 3172 -11336730259137625602 3177 -9704022087244797957 3179 -14531181144788964866 3184 -5103530438547424773 3186 -7049971328222257156 3191 -2593832991454060548 3195 -2549992206172832771 3199 -2656864556911864322 3202 -3094347590740453380 3204 -0 3208 -10556974365044028932 3208 -12597146506913681926 3212 -18243354473097630721 3218 -4168646291002030084 3219 -8893226051755120644 3223 -7904367695210051587 3227 -17247367703075879942 3230 -1338287165638264836 3236 -6734394253777139715 3240 -14645087877274778627 3243 -1841749727013933062 3246 -0 3252 -9793622484838288388 3252 -15384076833580083718 3256 -14678310837729104389 3262 -8947895455599830021 3267 -12421729442783160325 3272 -14382812703434878978 3277 -3484468606955360259 3279 -2411175954345499653 3282 -18322361710054416389 3287 -8989744845956541448 3292 -9637438279185886726 3300 -8282725403817063939 3306 -10727259769060221446 3309 -280860399088910340 3315 -3074647116268871172 3319 -9311932047626983431 3323 -2990333995786696707 3330 -11415454184475025922 3333 -8194042667332418565 3335 -11269986522125913093 3340 -10773634478079810565 3345 -0 3350 -4302235270674672643 3350 -4579270605621971460 3353 -3687011949425630213 3357 -9678333478858482691 3362 -14661606109051090440 3365 -9504123850532876291 3373 -14299233528797568008 3376 -10370491504729965060 3384 -286239823911254530 3388 -7969121812144744451 3390 -16606218867148559880 3393 -11756345184017143302 3401 -8204961944753809412 3407 -12456910480062157316 3411 -7569786299014196739 3415 -3372309516929818119 3418 -16631131943564946948 3425 -4436969913528429575 3429 -14467771002258720772 3436 -15278270405312088583 3440 -6638334178561090565 3447 -8154814430089498114 3452 -17289464348431017987 3454 -13185969354886446085 3457 -4725380864147687429 3462 -14933071000620043778 3467 -12471883028204926466 3469 -13286302152236950530 3471 -12020003522260348419 3473 -11784545509165047810 3476 -10311182359550097412 3478 -2262872037167824902 3482 -15672162207595698690 3488 -8479660175647360516 3490 -543122224331105283 3494 -8738610060644560897 3497 -15969479020845567490 3498 +0 0 +1196190418526572547 0 +3117251964976502276 3 +0 7 +3266452963994632202 7 +6701451810090115586 17 +10156473964989528067 19 +6270220596053033473 22 +8689732391113957377 23 +345423933508452359 24 +9048486634542125058 31 +13000119181766437380 33 +1008808785591799299 37 +12586249368236978177 40 +11161089178393358857 41 +0 50 +6900865085865625094 50 +2615908179610132483 56 +1617129254806601731 59 +1607892326666533378 62 +123501381755693059 64 +17180234710792039941 67 +17345742025318016002 72 +7933590365928361474 74 +16187522989672200717 76 +14893593683284454915 89 +6001767212789422083 92 +1805417936920808451 95 +8589625060174958594 98 +13148488988905702416 100 +6759231203841442819 116 +798806762886474754 119 +13949836854106156034 121 +4277844318153606661 123 +18162360468357982216 128 +17429735113921325570 136 +10428297564837543938 138 +10174389176493224450 140 +4782734429389924866 142 +16828613770926935558 144 +16924367891356487169 150 +15473269356473895940 151 +10277883249583756290 155 +7398921953351034881 157 +15672774546004063755 158 +7032338026028942337 169 +12638648541163088900 170 +11956890857542837252 174 +10813991647348979717 178 +698603259209416204 183 +104155371596876289 195 +8849883347580968451 196 +13523964487472320004 199 +12948374094552270339 203 +16624700721113753096 206 +0 214 +630014773304871940 214 +14669827911540386306 218 +16593543947487157254 220 +16189120489289924617 226 +5936869209199720450 235 +6504800368776816645 237 +17628010111075734529 242 +16073662248530872322 243 +15997624981342335497 245 +13519486007586370049 254 +469623719382726661 255 +10478598590185625089 260 +5239294057556035586 261 +17274642882001730567 263 +7924882265216651266 270 +13138720901108912133 272 +13741737182438464004 277 +14608811194009491970 281 +2489742908982890509 283 +14952279757728973318 296 +13432486964055121926 302 +15397241996877524995 308 +7400937882698838020 311 +13309132794101168654 315 +8519404085542453250 329 +2551722931538879493 331 +4492819152473235971 336 +9634175483270757380 339 +5023439465649179147 343 +2912624940235659267 354 +15615524075652075524 357 +15131856319265032196 361 +7560465986110364673 365 +16393161300057821706 366 +6737538541011470849 376 +6394493716971627523 377 +0 380 +6957953643235488257 380 +7533365794097524234 381 +11551517784611555841 391 +0 392 +14017003685401013761 392 +13868858036311946245 393 +609890416048967688 398 +15853752823436186626 406 +13008887538399190534 408 +275598997711474690 414 +612244017304434692 416 +265561555991638021 420 +0 425 +4771730300985403909 425 +14595656195986303489 430 +13010615142623560194 431 +3520044222049365512 433 +4843556531627173889 441 +9544321596489038851 442 +18097338319835691009 445 +17588488217883868161 446 +4553739803879796748 447 +12247953831639953411 459 +1685939678565356546 462 +2454121115370725890 464 +7699707784321416706 466 +2322428462912444939 468 +4251948422489921028 479 +8009626371771665409 483 +15830912148611917313 484 +15530208627603713027 485 +14550069280077337095 488 +3074860258671426050 495 +9819565310679728648 497 +0 505 +239920763215632386 505 +4479084686100589069 507 +7541436040510714881 520 +0 521 +18361828565940659201 521 +13943609537766478850 522 +1644071836581560844 524 +3325147442114083333 536 +9121949682662027269 541 +5375060563545179653 546 +11461944020052039682 551 +10205876604940857353 553 +17856338086929782276 562 +3964733248608209412 566 +15252617693956101123 570 +5198588053258159617 573 +7294352613378259976 574 +14274593384918848004 582 +12443356879762990084 586 +15967601366558600195 590 +0 593 +1596502676746638348 593 +3447763432008799745 605 +2154246728958848517 606 +1249748142575979010 611 +12802117032328183298 613 +14720455521613154825 615 +14431397366571454983 624 +8968154969419252739 631 +61922506310515202 634 +17332184019644205571 636 +1580044533016865796 639 +0 643 +16037339623732295172 643 +0 647 +6451385579602643969 647 +2249232807147062791 648 +15969372656029624833 655 +9184080755936318981 656 +10444965622910510594 661 +976846907109217284 663 +15036566770534162954 667 +2852219209756952581 677 +14428186506827194885 682 +0 687 +9583345567128655877 687 +8154021185610424842 692 +7639653587249864197 702 +284400846134645765 707 +5822594207495943172 712 +4666916656146452484 716 +10837424823999667726 720 +7662230599689246212 734 +16769958284715374596 738 +14214321919518354947 742 +7700892892210644993 745 +5647486165416790024 746 +12807160877623480835 754 +17202327424132939777 757 +5849043248643779075 758 +18232796011600235523 761 +4957062118189902859 764 +6105730765254667266 775 +8753292226633308675 777 +14066686889142136835 780 +1047708050925830148 783 +5555751253338228747 787 +8205438979066793987 798 +10100035083082646017 801 +3037731532850264067 802 +16470238215781450756 805 +15841867742103541257 809 +8087512074161331714 818 +15493250668750321668 820 +3797087601271950854 824 +2623502875154101252 830 +15159098560356506121 834 +343051006899596292 843 +16668194639613285891 847 +0 850 +9601059867653113858 850 +1570493927206813191 852 +9118300038493915138 859 +9563382677447647747 861 +5285530497249013763 864 +14598000812816350721 867 +15243372398425255435 868 +9815541045508240385 879 +408899826773384197 880 +7463961818871554565 885 +12980371725716597249 890 +15376403281856848903 891 +0 898 +5841652391326774789 898 +6476912065420260354 903 +3963854010828661252 905 +5784218172655345161 909 +15327721657175197701 918 +13180549833166182403 923 +15904501101973266436 926 +0 930 +14206180323061139974 930 +1106786522797875713 936 +17058832169116321282 937 +721828206256696835 939 +0 942 +8561789411832569355 942 +13374043249168898050 953 +15922789491870388229 955 +0 960 +16131878595889026564 960 +5509499768642979336 964 +12415614990376579585 972 +11304605070154481157 973 +7663245502729528834 978 +2692663086158549507 980 +14133757573751133701 983 +6813598296480126979 988 +13616528755765764611 991 +16303994430841145861 994 +12880492472155407874 999 +14023778603465187338 1001 +1658551813664662018 1011 +8148008758896362498 1013 +10688946549204321795 1015 +13274653424094307841 1018 +10847911221158770190 1019 +0 1033 +4643539771717744131 1033 +4169507947260962821 1036 +3126526255358650372 1041 +13449815687571241992 1045 +9421207081901200898 1053 +6898163624184020997 1055 +7290174431607841794 1060 +2741902156609523715 1062 +15499057183587255302 1065 +16461426401301993476 1071 +11278211202787295747 1075 +0 1078 +9413985875830324739 1078 +4646548733144616463 1081 +7078801759685020673 1096 +5376123263925219331 1097 +14227335667134915589 1100 +0 1105 +7295351152600562699 1105 +0 1116 +1397641409882635269 1116 +2364632016557825025 1121 +7290779788839345158 1122 +223977268476071945 1128 +13026660262516529667 1137 +17998435953459809796 1140 +8522469059272339460 1144 +16293947433309880833 1148 +4576500186674335749 1149 +0 1154 +4042247147937702403 1154 +3034443556411821057 1157 +13667368622259281923 1158 +15202537810082257934 1161 +15337640185400698372 1175 +8308041085868251649 1179 +8832030889396702722 1180 +10436989792260434949 1182 +14898581533124037641 1187 +9317528159836099585 1196 +1612938252083390982 1197 +6278485319310800898 1203 +10612805446261845508 1205 +13787162434835940874 1209 +12133705386992745478 1219 +5227473436681376774 1225 +5656787771058157057 1231 +4433258109319585794 1232 +6704526927800668169 1234 +17440456789764264962 1243 +6979104089888754689 1245 +10768049747876580866 1246 +15707303682313568257 1248 +15148244407999994380 1249 +2841265161354426373 1261 +5252307512862989316 1266 +13331565891980378113 1270 +18159416118263116290 1271 +501516395825858060 1273 +3867012501081805829 1285 +8267472486312505860 1290 +12872828689431491073 1294 +727773195231890946 1295 +7322382021491738631 1297 +5402024496579473921 1304 +6959655625064837122 1305 +10187142685062514177 1307 +3029360479097259523 1308 +3524388403479357447 1311 +5803404108302127107 1318 +3322880653425492483 1321 +14014789072627667972 1324 +0 1328 +17779075582177396743 1328 +11597164340541700097 1335 +18164718194518923266 1336 +0 1338 +3688441162538457604 1338 +12763684824056344584 1342 +6555198237040291843 1350 +8999497138912988675 1353 +9277828726380557826 1356 +1652226711750231042 1358 +6386464493042135559 1360 +11832103051565904386 1367 +7889400420599073793 1369 +5173699340624307713 1370 +9839391635984425985 1371 +9179189546563518985 1372 +8987610858276033026 1381 +14211262843725043205 1383 +9924217736728436740 1388 +4401850895204555779 1392 +5541709837691148811 1395 +10214740045672277507 1406 +14656675767246138369 1409 +5518164076312088578 1410 +8819194535554354691 1412 +1202694809888231436 1415 +9937648736864647683 1427 +4776509399304216066 1430 +3828150896429232641 1432 +9726415758235178498 1433 +15478358790166008844 1435 +0 1447 +447632828248568324 1447 +10254625284015096321 1451 +9602208154038649858 1452 +7918490636759656966 1454 +4464032935723660291 1460 +517803065456797188 1463 +11296051306811729413 1467 +9559870439106258948 1472 +18140734313948729864 1476 +5761393475703308289 1484 +5817187969532432391 1485 +7214411138154648580 1492 +8556555308704695297 1496 +5517275039512219661 1497 +155198283803470849 1510 +12028807386786979841 1511 +9402878779861331461 1512 +7529466829850301953 1517 +3700043109242268166 1518 +7889220073888590849 1524 +9698905706548099588 1525 +950350740255051780 1529 +16659267722661032455 1533 +11934825441675277832 1540 +1840952787151591937 1548 +3181706929772123141 1549 +13084360636440561667 1554 +7392348362663288323 1557 +11299566685738323463 1560 +11865504406956790788 1567 +470806909387516931 1571 +11392390055026286594 1574 +0 1576 +15250035972710306824 1576 +1841748561073501700 1584 +13959366503388518404 1588 +16383575845586120707 1592 +5993903773214649347 1595 +12927537188954086928 1598 +6310676060569643522 1614 +6823572598110530053 1616 +0 1621 +10355215107753852930 1621 +12991560131813107723 1623 +6463225875312731650 1634 +444925180768886788 1636 +8287375501749122564 1640 +8102699978355624961 1644 +3217121844483982342 1645 +0 1651 +15310893597687290371 1651 +4651888484278436356 1654 +16622466823413339137 1658 +14426029300798547465 1659 +16208338759425902084 1668 +13384891560853317123 1672 +10542264124115582467 1675 +0 1678 +13404868863569442317 1678 +8380728838811013123 1691 +2656782871938641923 1694 +5621105522992570375 1697 +16165957063051496962 1704 +17183335989224497157 1706 +0 1711 +12377944724210268163 1711 +15698714840429098497 1714 +2063306500131813891 1715 +7135499884796623879 1718 +14916197160702468612 1725 +14565364212611500547 1729 +17109666354199615491 1732 +18420265465448709122 1735 +5039636110599831051 1737 +13648715526743665665 1748 +8648155745742680580 1749 +0 1753 +4128476852805537282 1753 +12229435493123252233 1755 +18671114624524289 1764 +0 1765 +4330985506003776003 1765 +4960636854468069379 1768 +2825174586054641673 1771 +8083214972260871169 1780 +1656668836635006471 1781 +15658718806708214274 1788 +1364137667359422465 1790 +5440910769879224326 1791 +1242060995600047617 1797 +6028285323527704577 1798 +9862524515548398083 1799 +14095132043223516673 1802 +5330121798209797643 1803 +3047808178481674242 1814 +7009881287782938629 1816 +3836453927748870146 1821 +4828562734878493698 1823 +6251707885160171534 1825 +13503013357676597250 1839 +13120060435028427777 1841 +17453157023102628866 1842 +6659266074333195266 1844 +12122449770852231175 1846 +76872493233309186 1853 +10510620038219076100 1855 +3104474465142299652 1859 +15145875800387371010 1863 +14514645157364972555 1865 +5990940750853294082 1876 +9568631318395414530 1878 +13307393937882497539 1880 +0 1883 +13432428898749511691 1883 +2851874300532727813 1894 +16127254686981486084 1899 +11152828733555106817 1903 +8099684063905722369 1904 +10726727557015251463 1905 +0 1912 +16773004137299201537 1912 +0 1913 +1737396243104320517 1913 +12312810570815952904 1918 +8420117868402509825 1926 +4468099455608655362 1927 +17181412210024682497 1929 +7344171998747088899 1930 +11200240032637073926 1933 +9773885730549905922 1939 +2888420847349521921 1941 +0 1942 +3301971714535044611 1942 +6622000068430301708 1945 +14679279568503564291 1957 +15312513401406547971 1960 +11219696574507219971 1963 +15557068645919193090 1966 +14518831268196627465 1968 +11306244334020066818 1977 +445302382600591361 1979 +4798518764725378563 1980 +12833053520101596161 1983 +6569110733351726088 1984 +1133142439547627010 1992 +6020738327851480577 1994 +0 1995 +0 1995 +15123217074875560455 1995 +5146261845254048769 2002 +15577303646915962882 2003 +5068854713026915334 2005 +5662217880612308482 2011 +13584286678752042508 2013 +17647669975855288324 2025 +7092182408195844613 2029 +5243600304614296065 2034 +16379641210199802883 2035 +6541142296931350023 2038 +17648968980389751301 2045 +3633167252938199556 2050 +691728008305302531 2054 +7434042972483105284 2057 +1243474674683616271 2061 +439217426838173186 2076 +10460352595647090183 2078 +5080394082232633345 2085 +7346464481151790597 2086 +8068677175549539843 2091 +4859996294860352513 2094 +12470823893961605122 2095 +10033529424736163842 2097 +10769920382809060357 2099 +16128670331104411146 2104 +2973668094989328385 2114 +16323032859702780931 2115 +12227727930958763521 2118 +7302528030871866371 2119 +8967586997946816013 2122 +13935701471042006020 2135 +15676859696752227844 2139 +0 2143 +2397906929972799494 2143 +731429270944234509 2149 +14629591375919925252 2162 +14201687141277194244 2166 +8813493889730974725 2170 +4967156306307785221 2175 +12152782138863493635 2180 +5716269545878689795 2183 +12118250850399448070 2186 +10079764034817249795 2192 +9905170822798166018 2195 +7330246949116896272 2197 +4975588281894977539 2213 +2377967791858227715 2216 +1711948357573607427 2219 +15733402191778006532 2222 +13617127880905861132 2226 +5413022680339381252 2238 +12001217113207191043 2242 +605362804928389124 2245 +10888521749365150723 2249 +11742554576381655052 2252 +3591551764774430724 2264 +8647496912976230402 2268 +3843626828621262342 2270 +3921763517492323331 2276 +7707493410895858692 2279 +3920334550068498946 2283 +2658528064200329217 2285 +9038122947820533253 2286 +6952499746958836740 2291 +7951530266135717388 2295 +16076637508890388481 2307 +15187897527562671106 2308 +5520701509759360003 2310 +2598679891400145409 2313 +17512255026679867408 2314 +10995766946592999425 2330 +18117038245928559618 2331 +5391766950501834244 2333 +14461374868186265605 2337 +1273598128050393611 2342 +11820949665032480260 2353 +17841646829021216260 2357 +10200569215461547521 2361 +3670141860910412289 2362 +18396940417538187269 2363 +14261984156631670787 2368 +106960762513502723 2371 +16393357936187300353 2374 +7032931990465729538 2375 +15907195827890083338 2377 +16437195285078765571 2387 +17301257309241798147 2390 +8236593629924756481 2393 +1379157623727557125 2394 +14767417508072398345 2399 +16695407490005887489 2408 +1414009372711604744 2409 +499004129948061185 2417 +5775255721778604547 2418 +16754393591199635469 2421 +10568987941526160386 2434 +3311623553148127749 2436 +10255724520964794369 2441 +3121950734017230849 2442 +2129428121322164230 2443 +5233872436075409922 2449 +5115946926893418500 2451 +298818270766586369 2455 +2534391384903305218 2456 +13962240998865999372 2458 +2858192092257344002 2470 +2246014736733727747 2472 +18208224108542041605 2475 +5900635063125726209 2480 +8459478259862856201 2481 +3106812066263162882 2490 +6016756381746226178 2492 +375597697640802819 2494 +2513762961093744131 2497 +15366269329105501700 2500 +10035949288505144322 2504 +427851159373997574 2506 +4274431321888115714 2512 +5253654952100000770 2514 +16894221500064376839 2516 +14687193167626954754 2523 +13771965837935513090 2525 +8874009193925074945 2527 +4974093839237721093 2528 +741620693598341642 2533 +11991618038806280705 2543 +11116672093208526850 2544 +15807249887587362818 2546 +7323942637968351746 2548 +3660270925885407751 2550 +0 2557 +10684033640943126020 2557 +16989816981004759553 2561 +9001924880900419075 2562 +1998443310251235851 2565 +17567979874939109890 2576 +13652482471668535812 2578 +17509569230481751555 2582 +3182500785161561606 2585 +13325982159032983558 2591 +1923914978402147329 2597 +5589189981371284484 2598 +1161601912578541572 2602 +1916235467976744451 2606 +16280831412119656968 2609 +5531274414859838467 2617 +13599333592024061957 2620 +17989155199582565378 2625 +3030922814179764740 2627 +14644007464957335564 2631 +0 2643 +5497605392959732225 2643 +2032331457863458818 2644 +8100338548587463682 2646 +993329328502006794 2648 +6750921732510502913 2658 +13748899324120622595 2659 +15617703054210413571 2662 +13138109094843573761 2665 +6544485718564688390 2666 +4168731610225209858 2672 +7315066071491735044 2674 +11306658702491732995 2678 +1460741416990041090 2681 +8624484085251326469 2683 +4952143576172173826 2688 +11470130411385533445 2690 +8808161070990530055 2695 +3407659004810532870 2702 +9761503347061253645 2708 +347929962150473217 2721 +15682869073661250565 2722 +12636859761190001153 2727 +2169559175677957635 2728 +6583723534446631435 2731 +11332478688871909892 2742 +3541912969021597188 2746 +15665073567582359041 2750 +6811971824255872515 2751 +17832657550632072714 2754 +8908928359280249862 2764 +16149194899805562374 2770 +16584564148406323202 2776 +8926638669588577795 2778 +8056234806465729542 2781 +20557314279745028 2787 +1574148835258315780 2791 +0 2795 +5593745704266732037 2795 +8450014032945361420 2800 +7024373575570305540 2812 +11737655816003366406 2816 +4727037432569372673 2822 +8600949146786643459 2823 +9003058529087846919 2826 +14052664559056898 2833 +1424791599736305667 2835 +5413427196124183555 2838 +13050600684981920260 2841 +8589685071512056331 2845 +13186761374251900929 2856 +14090913721681066498 2857 +0 2859 +2742241767433926657 2859 +6309431184810384395 2860 +16867533333923942913 2871 +555261403132789763 2872 +5659601479152637444 2875 +18276768397881284098 2879 +6852010445819064844 2881 +16631838326863331329 2893 +246764640492975110 2894 +1313867708490425347 2900 +8944238870676823556 2903 +1060867472129666057 2907 +16635885715046522883 2916 +13334184179287121921 2919 +1341139991463623173 2920 +0 2925 +6310211216600221189 2925 +3521973268169620995 2930 +1462184866304097281 2933 +8359017763585949185 2934 +14138351761235446785 2935 +6817592922583008262 2936 +0 2942 +6385096150346020868 2942 +0 2946 +5484657660585723395 2946 +10615912620259059212 2949 +11956475177743584771 2961 +14617995947569946629 2964 +16460942815259223553 2969 +9814422111234662404 2970 +4608931955518876683 2974 +8617716815688349187 2985 +17740454941921826819 2988 +0 2991 +10586556775954286081 2991 +11028786367153901576 2992 +7561184979369551368 3000 +10180555287637633027 3008 +262376940139235842 3011 +1252244297117510657 3013 +17286434400127825418 3014 +11940732067173687811 3024 +9446744360256471555 3027 +583923543216445954 3030 +8153426984110241281 3032 +8998238685693393417 3033 +11022193474305971204 3042 +18018779292443289604 3046 +13782486654821986817 3050 +1031535266324627457 3051 +17367371162468022278 3052 +16063095350159409665 3058 +16006913374966627331 3059 +0 3062 +317830424679224322 3062 +14882116247225631239 3064 +9977848214775454210 3071 +15016859152309685763 3073 +1451917599200393219 3076 +14163345466838668289 3079 +7124786413716748809 3080 +8972415547684808706 3089 +17905923295565835779 3091 +11508735911159903238 3094 +1060738927182784515 3100 +3235164743035444235 3103 +7249634886133244929 3114 +13627026919527422469 3115 +804144428748921345 3120 +4260278694170215937 3121 +2554890109424057864 3122 +0 3130 +2939022249034957313 3130 +3727916159743203841 3131 +14170274700031256577 3132 +7153627445263524879 3133 +6798175517396767234 3148 +1899052595905691141 3150 +4651137331222245891 3155 +14020723224952528387 3158 +5768869715157669895 3161 +13394211108659571714 3168 +15788932119193980932 3170 +13584005658508513793 3174 +9286626632069867523 3175 +2398026920081879562 3178 +1285989134179298818 3188 +9371873775174273029 3190 +18182246561705410049 3195 +3627164815665507843 3196 +18002283031389555722 3199 +13723140536667785217 3209 +11940684153082156547 3210 +16151440538186193925 3213 +13475891972713434115 3218 +5932226594251481096 3221 +15508203776273810434 3229 +13958242421862434307 3231 +2178759546197172739 3234 +12536204645038731778 3237 +14021691565090239498 3239 +0 3249 +18424936840617633797 3249 +9515558058741110274 3254 +14427656809453646337 3256 +15295479713001905676 3257 +6924455800485778945 3269 +5547275743159208965 3270 +15965423529103676930 3275 +6276065480049782274 3277 +923852355669990415 3279 +5171389834127005698 3294 +15756927494767584258 3296 +5380717287071449607 3298 +6048706605171842052 3305 +10493631130929582093 3309 +2792686703001238018 3322 +16318095573166788102 3324 +14961739739381704706 3330 +13885085964549002242 3332 +8803999472247604229 3334 +13681809489997040642 3339 +1274343414475602434 3341 +17525390131260455942 3343 +4637625228183366658 3349 +8313154017818126861 3351 +13090076428282480132 3364 +18133227728108545 3368 +8282473413611347970 3369 +107193099920609282 3371 +8505179371271580173 3373 +11102079825957593602 3386 +10212767298703785475 3388 +5215453497761775618 3391 +3298152084179375111 3393 +1095163960428030473 3400 +16887781145875813889 3409 +14786085928210816520 3410 +8581278387803219458 3418 +6241337607249230852 3420 +9254719800476612099 3424 +2568855290428722689 3427 +1289519920250085381 3428 +14618186241114017793 3433 +9612541243912769538 3434 +13926515287424429066 3436 +11093957915681312769 3446 +12010544601346956290 3447 +11839562359654205442 3449 +6839541636025740804 3451 +6012482217637302795 3455 +0 3466 +5775335776577318914 3466 +2685494297938271233 3468 +18186802079969910787 3469 +3127521196291951624 3472 +6934893239724900866 3480 +11630798772510404609 3482 +2767762624498050052 3483 +14135084772626181124 3487 +11643008759045397001 3491 3500 -5303047073946667464 +14107087915135404740 +3545799512027105927 +32996413518841137 +15568274631689570656 +20587511236070012 +2390363305266056430 +3863606920688567965 210658854139 +9870724567599405 +103154228 +3007753865419557454 493093586 -15289397349632312454 -5941764183477191834 -3477193953305167424 -236453760381 -7470284155521404014 -24445261 -16426766960960540026 -14549236 -817365937 +814220189 +538968856 +45810044 +11403474 +2625321602296383846 +3076135121411313050 +16635669954819197974 +5514354727165429372 +18413391979390173264 +3544953467117898450 +6361518319333476776 +5833854247140395797 +518849275 +2752627 +71565807 +9870724570416301 +163316374 +60096910 +817038254 +18411417877468545037 +5993603989931887912 +1873618523431177265 +14787093348585572176 +18413109988782047308 +1283692271244348427 +17461812017531651650 +13165236096819726043 +14883032307819284131 +2789363538679106064 +11161692095903435283 +62914993 +2365498112266798670 +154665586 +13726068529822894439 +5570718 +544604964 +33560368941433940 +819856323 +1873618458944931675 +1873618489039064439 +6156738032733324876 +10259573046193883986 +6208295848581203181 +5991347927496394467 +2272905061487347697 +8972557000702888938 +15289397384024950845 +4767727591019973374 +10758418391935812957 +2292825785040636736 +1545208828 +219257441372 +5569296714050766113 +2207492642904016905 +12612941966326959190 +12426051065400527122 +18331556280207363 +2785415334835848520 +6156737968247080128 +15292217517958891614 +5780604328577598853 +3188833133853148985 +4078298757842341053 +6051485356288903427 +573178715 +102957618 +91488775 +2625321602296187261 +114426460 +22675774 +11206864 +9870724567402585 +5406444726343502428 +68551110 +515834601 +2431124533 +538772246 +11065179658016983681 +8930986418384079868 +4076606646528706921 1873618471841499416 -71893492 -10694515171064744788 -29330183088506125 -61997475 -4653200 -109445719 -8926052536804313893 -7528330190111771360 -1418462186 -5887104182899575287 -2625321597997091447 -23407864425745813 -1647838213 -6152225753094686522 -14151987057237756511 -18058417591402760409 -538510099 -17855463731522440261 -240752528220 -27920040887059601 -11078361536363433136 -12517601 -15885957841278600403 -518718202 -805438326 -2621553 -1550910461 -2411070513 -59965836 -13012951802392676509 -97518103 -2625321602295859611 -30277976 -546374457 +3701601059573925529 +16166203682344470241 +6101795981361546864 +15289397371128186695 +7569568047215545466 +18411981910273949729 16759426304739641933 -259654328 -27356063970624739 -1873618458944931675 -6209987959894902621 -5728764444739437994 -18413109988782047308 -13885455448020813663 +48431492 +24535874148371011 +14024943 +59900299 +105775699 +10770155859627543824 +71369196 +9870724570219682 +163119765 +2530739313276357975 +5052785364214352114 +805372789 +5652457623480305518 +644809585 +816841645 +2556016 +4501477955215362649 +4502324021619918399 +2150364451440035988 +6156455943246842659 +1873618497637649718 +12309852946450942075 +3660444556051220001 +11103300151687644832 +8714520725396523830 +5461104765611607541 +27356033875641745 +5352348805862394041 +2012415014 +5151629580948802356 +5374107 +154468975 +108593749 +62718382 +16843031 +28311895 +1107456968073808590 +11490081257974859839 +16633695840000739887 +9386257335747873389 +4959080478982475006 +11408348231855703653 13464164481390611573 -5514354709969504081 -6364097374632348674 -2676033351739376985 -1136798196293306910 -5299098874403555921 -2120987217453057458 -17306856587979066781 -1873618532028844481 -5572365145471912335 -18412263926676652075 -105382480 -5303047039553965447 -9881712940254169714 -152830562 -8610102806501591788 -15524263781940136850 -14282671233461718187 -2857298572705729021 -29330122900898936 -10554335258691243263 -8453377129057749572 -18411417864571256842 -811271050 -1873618489038604579 -4657106642463886071 -2676033356038145381 -514654951 -10757572347027851837 -4237766514325588729 -571999061 -9821766011288487605 -7230168968130792223 -2704904949959166469 -1823671323 -103350839 -46006654 -2755882956846859930 -15289397371128186695 -12662636664722033563 -16318735 -18411417894664929297 -5462796894122411284 -9950019064427710530 -6981729909914862956 -1992588707391932346 -63766972 -6422699 -23407808536904833 -15394822466617412826 -16881139139804531782 -14312300901618944289 -2625321593698061230 -9870724570679212 -5780604289886653255 -3870997034531752803 -2531021389865944442 -10908568553618343357 -1860700038481053299 -196215461 -1801847830 -24183115 -18424247431471827427 -14287090 -417019855960 -71631344 -4391052 -61735328 -18413674012989259870 -2625321597996829544 -17957750408840481687 -9870724568648556 -41943405 -2789363542978135882 -18412827950883864637 -548143940 -22151483 -17257283845880874759 -899112529018292807 -538247952 -69599701 -8510664359869943178 -27356081165698156 -27638084672359236 -12255453 -11400819049620310987 -1321272283 -16881139122607162703 -2359405 -3101815889301670444 -518456056 -9232147856523987724 -3758799212073651272 -3591160524196219107 -154600049 -17946608694533885076 -11500631658516907905 -825323275339564903 -9870724566615620 -39911783 -12318365723907459763 -546112310 -18412827980977537092 -536216330 -2676033351739114988 -11069796553860646809 -7880043043777809442 -451412296787 -18411981918872141859 -11678577273375754735 -8856014234050823647 -105120332 -1309344723 -162464400 -681145240220010584 -2626514825137096412 -6589396841525218018 -356832249381 -6156738032733324876 -11202456151687629452 -27638041680086900 -11243723090649876783 -5726358144768542273 -12498251711624252784 -13702827714901707594 -811008904 +15494005608834598990 +1407386597 8192198 -8714520725396523830 -514392806 -9960543895307946415 -15287141235608259625 -5727354401416546168 +219257244681 +42598769 +811008904 +2573543610120276856 +5356297048398365877 +7595953279435999504 +5726226297114658480 +2723374776553770162 +1543385872365455415 +11535686880442518166 +15289397379726773461 +5565348488711963913 +504169174 +9870724567205432 +14212253575230457510 +5831598111619679502 +2625321602295990612 +572982104 +813826970 +279448324634 +538575636 +11010253 +68354499 +11243723090649876783 +18331491793766525 +15292781563660995825 +5991347884505304103 +9409295256684857617 +3759645248384009814 +5832726134240118664 +14312300901618944289 +20305615210743190 +13001845694847518363 +2652485274356286816 +6151097653090126690 +2203332276215481610 +18412545964574834746 1808894516123993997 -3686437022462641529 +518456056 +2359405 +1321272283 +71172585 +417019398489 +18895516000586505 +162923155 +9870724570023121 +13828334 +2625321864544389907 +816645035 +8453377129057749572 +11949535972653271176 +1873618467543321286 5249797181178709209 -2625321589399030850 -103088691 -3062219857732765097 -830399540494469985 -530117487457144076 -12454108019635062383 -197984938 -8930986418384079868 -818873277 -16056587 -11526999220155450649 -6160551 -63504826 -7621890105505615217 -11847668763332905754 -10377426660276898779 -1873618519132015281 -18092519415945890646 -15882855708139391266 -7993599274919922706 -2789363538679106064 -2150364451440035988 -9870724570416301 -2625321593697799226 -91161094 -1410073577 -23920969 -7513578521803359945 -22279798815198594 -15520597512816297356 -1023125932615797552 -540017436 -8910392170935354895 -195953314 -644809585 -14024943 -71369196 -1873618476141774348 -816841645 -10906583479868327250 -1454041666728626384 -4128904 -18413392005184749654 -108921430 -468609401971 -16204201012116260706 -99025451 -9870724568385196 -18412545943079354421 -11878630053446878902 +5567604589840172352 +3707523343842937215 +17088205463377873568 +2169005683868174908 +9568723490388248888 +6103488088376871190 +4025969582498383295 +62521771 +18276979644936029994 +154272366 +16646420 +544211744 +28766107292140894 +5177496 +509805280 +1873618519132801026 +1873618544926132491 +7676326001635166459 +7676326031729298383 +869984510486186619 +13146357072728951328 +2000487899013646903 +2449021711964768402 +6155298010574883251 +6098975770044401989 +3189961199463959445 +2676033351739376985 +7995587 +19464489 +547029825 +219257046468 +2021331689141374237 +15288269301218674108 +11705421198335413148 +2508194873 +2625321610894575340 +6097847713031849822 +16064731596255856452 +13701595356116683915 +6364097396127827248 +18413391987988365394 +16364556117061994922 +10296839827164892306 +5403008449516603011 +15858116883009440274 +5833854255738587405 +45220217 +194314911 +10813643 +68157888 +56689033 +114033243 +4287350266942457603 +987047180239768912 +813630359 +18411417886066737167 +18413109997380239438 +11548493110908749415 +6364097387529046615 +5561348123192067576 +5835546388547569431 +5246976935469649046 +13884327378110449525 18204249488608200784 -5566476545725367766 -17951898368652543383 -7558005371879033601 -16542141154387102177 -6316393479032998553 -11694336983993944146 -11427331956784106382 -4662073785906890031 -1873618454645640429 -537985804 -12999620585941961275 -2295119206548507606 -11993306 -1597536180772867045 -5299098844309358384 -8294669686619703163 -69337553 -1873618506235448739 -518193910 -5406444726343502428 -16765215479188031591 -5460499803636172954 -3431717683755289915 -28202117477106938 -5249797172580910311 -5745384143842643344 -14065038233622153931 -14311172801615955497 -16758489844492275047 -5510538272098551989 -11065487220741573048 -9870724566353399 -5679882735784101879 -259130038 -87097857 -3491703471172619422 -545850164 -18271599167641487963 -5991347923196709309 -1873618458944406678 -7033448275620070919 -812778389 -434977997061097911 -3445982126355516078 -2676033351738852867 -3545799512027105927 -1873618484739311861 -12749251354825264418 -14836382508930370955 -2625321585100000596 -21997756618246082 -8716776809328151764 -15580874176502892132 -3332575624131774585 -4445946672738010859 -5780604328577598853 -2848264744227112681 -1873618441749072804 -257098416 -4930631980557601532 -6877319166685482198 -1005889956380019628 -820642761 -17826079 -23125779236849772 -810746758 -7930050 -8929320279979198383 -9654763076979264499 -11949535972653271176 -1873618514832984063 -514130660 -18066207382028748450 -2573543666009114673 -18613585580197092 -1427238547443354327 -2625321589398768544 -102826544 -5903884228619468800 -4279043148 -7036226112429884975 -818611132 -15794439 -3324580943442478547 -1903640920853056624 -5898403 -1873618497637649718 -1133620887485417426 -10156853965084755435 -63242678 -282723005 -13586095437453200186 -9082058141968173941 -1987794462939089941 -13237708531286474753 -5240852582657493474 -1915314009235720841 -9870724570154139 -90898949 -17090754651615726815 -492307151 -195691169 -11050161621988804687 -23658823 -11623400942792738969 -9304480456320748248 -71107048 -816579498 -23971751058934778 -17869638717220195611 -1873618476141513316 -361675971417279818 -61211034 -1873618501936418049 -3866756 -567411536 -5302201063430292982 -8486888319115725460 -12406930521299355297 -9870724568123690 -11034422950646711803 -4287350254045103750 -5566476545725106758 -1923875870 -547619651 -6366353527348595732 +70975974 +9870724569826462 +816448424 +4211213383 +2162794 +12974919760129952993 +105382480 +5459976661309982295 +21433723812579518 +32432320527074663 +1873618497637255436 +9305858029919208637 +10225919154718574351 8597156797828894009 -13590665243542948895 -13237708561380147208 -4254959725487523541 -2907303882175415846 -1873618454645376983 -9230753948926543533 -11731158 -527827717 -5511666307614640107 -1330643932 -69075405 -28202091681942395 -4727296740454696303 -1992881785902860007 -18301216972081072101 -4076606659425995504 -9870724566091296 +12461042340477994821 +1455946274504313841 +9538952396691934382 +927164962728314711 +5782296426993943791 +9714916684781063078 +16449809 +4980885 +819266496 +2625321589399030850 +10907429529076434052 +257295025 39387493 154075756 -5459976644113468289 -545588016 -12461042340477994821 -223556406340 -32432337723721245 -19595563 -2573543610120276856 -24535874149025753 -5196265237615086368 +62325160 +1495925747 +288043895627 +4504298205224635444 +14835085562484362568 +16881139122607162703 +1839046019115124804 +11923578915473263059 +9388513449772451585 +5247593352907982888 +5153885686374731086 +12020808312486431384 +14848239906707278405 +5405598728725530322 +3653991426073234491 +5566476498435442740 +4333982245204396969 +17007720368052373541 +14458654042895551171 +16885259953617962521 +2676033351739180486 +6877309693745106245 +21997713627284659 +7562235540534921217 +2625321610894378836 +5458848587099997499 +1647838213 +288046714075 +1454859013759438228 +1133620887485417426 +237175467 +810615685 +1418462186 +12162857194684744950 +88080898 +19267879 +7798976 +546833214 +6206321690771522709 +21433680821684597 +1873618480439692390 +3932922014897081298 +2549492329236335496 +5249797112394286460 +12294570438877711433 +2324121364801391676 +3315661715940248009 +8971880411373045432 +5461104782808583112 +18411981918872141859 +15371922320578972378 +361675971417279818 +90898949 +13390152586296232130 +492307151 +13522668389390157414 +538182415 +10617033 +12498251711624252784 +22085946 +1987794462939089941 +425617786716 +1730937871 +5356297014005859746 +5569296739846327213 +16881139139804531782 +4196703391028741586 +1873618476141710425 +821147663836514852 +3158171969379764633 +30176223702288623 17735566651085687884 -6204347601746593065 -1873618484739049815 -812516243 -6152225714402428442 -15291935501556190620 -15505670362359531298 -451411772583 -9484411285755463284 -161940107 -15292499508566297469 -563348302 -506004186 -11238431078799509026 -18323667541285735009 -2625321610894640833 -103179363763488430 -503001580666 -12769025487284210679 -17785259844527786731 -29612147900877606 -15290243377345399572 -17563932 -7667902 -3186488476490139978 -810484612 -1192315333980326167 -1873618514832721746 -15292499491370961900 -513868514 -5347351719937377689 -45220217 -11775490430040476325 -12240192446106372977 -35324256 -2396555433535145871 -7409502855497715015 -7888341864134085054 -4278781002 -1732546121802517809 -2374936041605498895 -21433680820701635 -12189960762281954023 -869984510486186619 -3598203394278688718 -6103488079777762245 -72876542 -16990917635978692369 -818348984 -15532291 -1146796961722731823 -17761874897365304540 -62980530 -4534407021717882867 -5636255 -32714379920409891 -12552846396214610071 -6262673798361580735 -2528483177756102046 -9870724569894177 -9297735470756268616 -5831598115918776853 -32432303331018178 -6064762127302393958 -6156455943246842659 -23396678 -13500652 -16916327697533962956 -70844900 -816317351 -18411699885273055253 -5884848047378859255 -5837238405281154301 -14311736903207619026 -5141736951422061236 -3604608 -31022281504523376 -3599049409094225259 -577045344 -2974323816123992770 -8021450341214588326 -3577503648415550265 -509805280 -9870724567861628 -11098517635487303139 -7462549834646555859 -98501157 -5779476207078475458 -219257375260 -490013379 -4222974949961697922 +1427238547443354327 +10223260478367337870 +10720606758114626648 +70779363 +105185869 +162529937 +9870724569630759 +24904017 +2681814701524780811 +1320879066 +1584661506 +644219759 +13435115 +6097847786116483627 +12477949191893683608 +6925759835249836137 +27920040887322186 +10003084053115964048 +16253198 +153879145 +2625321589398833886 +257098416 +4784274 +9103100569952650951 +12474564753552836994 +1495729137 +62128549 +9774054990929462949 +5356296971014964874 +6153353870293665804 +9568883447315500158 +1915314009235720841 +16655465042802838677 +14866462842593414402 +2676033351738984017 +546636604 +535167753 +42008942 +30540122 +6365225483234117329 +7602365 +282854078 +2625321610894182276 +13307798926833551183 +10913926882465549337 +15906307047154976446 +6104586261131037638 +8483828720841721486 +15287423226215073909 +17785259896117529586 +2785415278947600352 +9000175594581527004 +14425661002709010016 +5513226652957347114 +805679481429165719 +17859691850682797212 +9181555677596944971 +1363739614 +9870724566615620 +537985804 +572392279 +15175534989820758889 +1873618476141513316 +2152780467316001469 +12601357272775920269 +16765215479188031591 +6534429686359852912 6366353553143235674 -3158171969379764633 -21365044 -27638058876667848 -29330140097217635 -1873618454645114642 -2703776923039566000 -68813257 -279448782049 -814285726 -12237654319976351671 -517669620 -5779476284463187670 -10375505326587315831 -18411699915366727708 -6205475624366966000 -3307734082 -39125348 -1087507565178193378 -545325868 -15986098390340470919 -223556143025 -19177592590632702 -8865366478519731984 -19333416 -32432337723461001 -812254097 -11305519054433421356 -1873618484738787248 -5105416417023100899 -572982104 -505742040 -563086155 -104333894 -8070528080642443989 -11327137566841769230 -2625321610894378836 -16377260960560187819 -15586729198848181726 -1873618441748546884 -18413109971585663048 -4825924017323379312 -5915592292141435844 +12689613402799605860 +9138963602338286574 +104989258 +644023149 +361131345578 +816055205 +9870724569433729 +70582752 +1309213649 +17634738504986593825 +5639662680184522626 +6316393479032998553 +16340493341965880015 +5344573059048999857 +34124461934314600 +5994450030541998229 +2625321589398637514 +2676819007 +15515140772745448064 +498702419026 +227855238971 +4587663 +16893851890367073119 +14264208198271043974 +555090760 +818873277 +61931938 +16056587 +8821966780582857359 +18411699885273055253 +4861149623842704773 +18413391996586557524 +18115578910873816258 5832726151436896491 -17247780946628644032 +365262179507571896 +16896582888638318388 +4445946672738929841 +17186370630874106258 810222466 7405754 -11549275701007551889 -10161648502327149991 -570950482 -1873618514832459339 -313841222762 -4452458274095237609 -1445774942907271091 -6101795934071424788 -92406286 -5293539447540681024 -18331491793766525 -197198505 -11199980773228349986 -32432320526091507 -818086838 -1997667722089860216 -2524806027085153844 -1964966944 -15270143 -1370042529145686776 -5565348523104797810 -18331539082773742 -62718382 -2012415014 -18413110001679335503 -5374107 -14282027259104724924 -10375505339483621145 -9887461037680036022 -1873618544926132491 -4662355883991631380 -18412263939573940270 -157614716 -3295137431799204142 -9870724569630759 -491782859 -214958343888 -16875205763331852041 -7241607903360452069 -5408471212899110030 -23134531 -18411417877468545037 -27356081166681957 -644023149 -70582752 -816055205 -3342460 -5246976952665638015 -14212253575230457510 -576783198 -1842511416005692464 -806159226 -5566476498435574920 -15292217517958891614 -13516735047310051359 -5728764487730398405 -468608617008 -4025969582498383295 -16044698410490725659 -1519546451849645365 -9870724567599405 -5566476545724581156 -5619444426388998007 -98239009 -547095362 -27356033875641745 -219257112483 -8140646021471143544 -4713167439824750602 -16357059045845960667 -5462796881224795644 -9138963602338286574 -21102898 -10905173367761798655 -13701595356116683915 -2477484405147109478 -1880166538706292058 -11206864 -1283692271244348427 -68551110 -5885543833259674054 -18413673995792875610 -2352415791 -14947075702982868 -5299098870103476096 -681145240220994278 -163447447 -331038328206 -38863202 -96207382 -153551462 -2625321606595348609 -5461104757014004985 -10744889200825601240 -1988559907 -258343605 -6517011693716180143 -535167753 -2530175340657839273 -811991951 -15291935475760762248 -4397798264919820154 -18413674025886548065 -12109395139072755174 -475082778886408323 -104071746 -161415815 -8697110475982376165 -15584540329550678645 -13669583335851559254 -2625321610894116800 -1873618441748286746 -18412827963781152832 -819856323 -6209141854797957852 -1783548230307677653 -18411981901675757599 -637928298 -7143606 -15855332315905657597 -2625321864544389907 -12020808312486431384 -3076135121411313050 -10139438201185111279 -6152225744495577231 -33560368941368890 -210659313158 -4278256712 -27638024483702949 -24904017 -32432320525830439 -13263754581809432790 -817824692 -15007995 -359800716494834349 -18613516794268696 -9839328478246341893 -62456234 -5111959 -18411981931769430054 -16219982623696489082 -6261827792145090364 -7692717626264324682 -42664306 -13806855580317125108 -9870724569368358 -16269555352897260337 -214958081659 -11214563466575480865 -15636771529559117046 -13271165719268362246 -2652485274356286816 -538968856 -3784724792312663401 -18263821886743185772 -1986666427421953426 -5565348480114297669 -5352348827359053328 -12976359 -1873618476140725820 -421319345246 -70320604 -11703165067112811597 -21715697223994697 -3757107087862401328 -60424594 -3080312 -10697899350700788395 -1873618527730534170 -468608354196 -509280991 -50528646 -1193603335023233930 -16635669954819197974 -15426482629288462533 -5460499803637156023 -2625321602296318353 -9870724567336570 -97976862 -8818864638845060491 -14288223544298637564 -88080898 -6996745855548787140 -5566476571519223063 -546833214 -220421203678071202 -31022238513759415 -1873618458945389823 -6406389097441592980 -20840752 -813761433 -27356085465188671 -68288962 -5865888353649363875 -109394696450803010 -12213481117926952067 -18413391987988365394 -10944716 -517145329 -5723537903358642458 -21715753112570631 -7758478083289188556 -10675690836223986039 -153289315 -95945236 -11547019543992076059 -9649086479758069023 -2625321606595086582 -258081459 -544801575 -5887799994573980828 -2845029447323880298 -18809125 -8510103668314541335 -6205475701751155414 -1990332636357069057 -429916882098 -2673382969485886910 -1873618489039064439 -18413392018082037849 -10914208898869168291 -3773122177597967623 -161153669 -103809598 -14107087915135404740 -6366071515245381876 -18412545955976642616 -15289397371128645360 -5462796868327967227 -1402930148 -28202057290482949 -797695489810761887 -16777494 -18116142943679220675 -5142301044413893172 -17219576355390295334 -5249797112394286460 -13735950183222348532 -6881458 -29048192479791616 -16896582888638318388 -14517406836956661503 -5458848655886518922 -313840698753 -5197393273133271298 -3861350810962691992 -6375653898722412075 -16885380374869314205 -361129707266 -210659050964 -29048123694646491 -3017170418691476659 -1873618450347593089 -15290243360149277503 -14745847 -72090103 -14546784569801180959 -7431889721301470079 -6364097387529111599 -2435475427475262665 -1873618497636600365 -6151097734773868363 -62194086 -17083693200934636558 -32150372909516328 -4849811 -3172873313800750756 -2150364429944620611 -3862478902367620470 -9305858029919208637 -2625321597997287853 -2508194873 -491258567 -1408762855 -5015996636573993090 -2414921941537785811 -538706709 -5734260728554980678 -22610237 -12714212 -70058456 -6208295882974168451 -32714336929384395 -16643035121679272213 -20023641798084435 -4770547828131824981 -2818164 -1930668198955452820 -13726068529822894439 -468608091255 -5569296714050766113 -17490170188584258190 -8694008299851745161 -7073102484926630551 -155058804 -97714714 -40370537 -2625321602296056238 -1703347206 -15895039144349470066 -5352348805862656188 -3068049059797011246 -5880738612678821404 -12309852946450942075 -33560429128451329 -15289397384024950845 -4767727591019973374 -10682570 -10233718743719545342 -850088361543927300 -2792183694107936667 -1107456968073808590 -5759560470823897206 -162923155 -29612216687004362 -5875369269012203157 -95683088 -294416195335096411 -22279760122415532 -5639662680184522626 -17619012653768771484 -13237708544183762948 -8550520059753138843 -27356042474686002 -249849483538007723 -544539427 -13390152586296232130 -10906513561824594910 -18546980 -1873618489038801706 -2676033356038342054 -6313103561496791450 -2063139881 -6848542126596623056 -160891523 -103547450 -14101293042239958 -6151097653090126690 -1584595969 -12424382439595706534 -17698252132056434004 -4129856573689694799 -16885259953617962521 -12393440069873436875 -32432320527338097 -21433680821684597 -8617826180017097033 -1413046597527668667 -3973491001936446780 -819332033 -17305802226190387588 -1873618467542665344 -16515346 -6619310 -6206321690771522709 -4089771542585346905 -1223976962194278208 -13487493291780736605 -2487491354099451134 -8854886172739175692 -9870724570875039 -2625321593698257851 -1535116279 -6262673798362565305 -91619849 -493028049 -5352348797264856883 -8143564249694210398 -6151097683183797493 -9386257309953099582 -196412070 -3865299044899163405 -71827955 -18613366323088485 -18157949162008873831 -7562235583526800081 -817300400 -4618470194090937269 -4587663 -3932922014897081298 -61931938 -1873618497636337289 -2522831856378710008 -6364097413323754682 -6053028402293443390 -42140016 -12287601267178473523 -2625321597997025900 -538444562 -15991329612793777185 -15291089478142986477 -12452064 -2676033644081056812 -2556016 -16508579235574254010 -805372789 -59900299 -14787093348585572176 -2575517759332551933 -2412665810316625225 -7730749911729375728 -6155298010574883251 -10488220504998020326 -1311572948 -883931539946605906 -5352348805862394041 -2786543383251193103 -546308920 -3346269252 -5782296426993943791 -4469799173763958889 -6205475671656957491 -7872981661881076049 -18116424960081923281 -2676033351739311464 -516621038 -1465168459078698840 -5677488692584514734 -105316943 -4562124351240801677 -5245848874158263187 -16432982289349543214 -162661010 -3971798877726246151 -4787251587800828866 -5875369294806846690 -12217235256243064050 -95420943 -5354604868299326678 -4502324021619918399 -544277281 -5940918086979029952 -2014710471177341259 -2140013610 -1873618463243635741 -18284834 -2676033356038079832 -10531295876509927029 -5458848625792321791 -18411699898170343448 -7410231625909407077 -3478039985316562895 -6204347606046083061 -31586254122912349 -6829167320236755019 -27920101074341046 -13165236096819726043 -32432389312220424 -571933524 -5727354401416743090 -10225919154718574351 -4127600472563058730 -160629376 -103285302 -8483828720842049762 -15740334315622960494 -206359759935 -9813006656186419950 -9319686106503382840 -5515085278788979157 -232154663489 -26149204 -6208295848581203181 -3094190453106412515 -6520986101609793850 -32432320527074663 -5245848925746038203 -5942328186188203485 -1873618467542403595 -16253198 -15881445561639371975 -6357162 -63701435 -15515478115209971466 -5833854247140395797 -283181761 -19177532404009207 -16567374854657149772 -684134257893509654 -9870724570613070 -15680489859993767209 -12826571498698443033 -2625321593697995819 -10329316755526125416 -10754752208794748192 -10758418391935812957 -12105446909435186010 -3143159678306028631 -236453432350 -540214046 -14848239906707278405 -29330157293274228 -684134210602468610 -817038254 -4977791693940394179 -71565807 -1873618497636075077 -807142269 -61669791 -11287403619712895066 -4325515 -13819298136066198 -7734678113259293802 -6098975847429179176 -99222062 -18056758355458722638 -9870724568582655 -16224960573811657069 -2625321597996763849 -4078298757842341053 -17625510063045740642 -10528906628815718922 -490734276 -5412367062202975465 -22085946 -12751507524739009261 -538182415 -12189916 -18413109984482951243 -2541195915421354200 -6671860954713623381 -2893509029140760671 -69534164 -747829823970020707 -6770804071406897080 -2293868 -5566476498434524382 -6534429686359852912 -18412263922377556010 -164430493 -9870724566550039 -154534512 -10167299845199168903 -12754891682880490747 -5250413516934022944 -3315661715940248009 -451651625195343029 -32432333423379563 -5941764217869305943 -2141783083 -283748271730 -10161648493728303880 -5240846595623881868 -67502526 -15618641120352995308 -2676033351739049517 -6205475697451599682 -4023356732265137752 -14986955239351847842 -31304272112126853 -516358893 -2207492698791414354 -477207135345 -1309279186 -105054795 -17859691850682797212 -162398863 -4238330517036600601 -152502880 -18412263952471228465 -257295025 -10905173350565414454 -17498716255300421272 -8881019260503721949 -18022689 -534119176 -18411417890365833232 -6293435910568086045 -9374458755688828226 -820839372 -6153071780807051278 -5909364179964069981 -8126661 -3735453693364143828 -6155045908522469290 -745740842898098858 -2625321589398965240 -12142525752872799042 -160367231 -17958290734101235336 -9523554809025136564 -16892239439269464715 -15289397371127860096 -1736311827 -15991050 -63439289 -6095014 -12484855343804124176 -9658025172156550406 -18067928153034001057 -292345808939 -16572875051796793000 -10542598463376395267 -12772641161582545873 -18413674008690163805 -1544487931 -14737352740221028816 -282919615 -12808641794728789765 -2625321593697733840 -17128487303121020 -1706624008 -14101026494875963 -11214563466576463780 -18412827946584768572 -11966722661119888545 -6156455943247300775 -5300226909920168653 -6004915412369541960 -816776108 -4223816177647290930 -71303659 -1873618476141710425 -12477949191893683608 -417019528294 -9511403338599564690 -4063367 -61407645 -2543805385922512178 -9870724578216632 -5407707525201267705 -9870724568320021 -2564752444 -98959914 -15494005608834598990 -15140097999495498431 -21823800 -12734096628671909131 -537920267 -18412827976678441027 -11927769 -69272016 -18411981914573045794 -2571498445011814318 -10592171188278987146 -2057911839619745748 -9870724566287831 -154272366 -545784627 -17616192489740896443 -21715680027609308 -16886908734816455284 -583336804 -2246313005 -516096747 -2625321585099935141 -620888934 -162136717 -331037018572 -477206873177 -503001777494 -15592058013925444099 -1652810939277510396 -10531295803425490030 -3205882223899445065 -31304323701671300 -28484129580057898 -1873618441749006513 -16893851890367073119 -820577224 -16904712944498838074 -1394017249 -17760542 -4160689491693538063 -4047541379259827663 -7864513 -14219872676477209184 -504169174 -17244622751296785814 -2625321589398702921 -4278977611 -7239633818635733091 -5462796868326918190 -1334641629 -73073152 -7460569593843485201 -15287141188316891641 -818545595 -9339868219275806468 -15728902 -5382561551670903978 -9373330690077689939 -18413392000885653589 -5832866 -63177141 -438515402871 -2373415502940997016 -2148672322930150296 -168849237244054062 -12339564610979564477 -8327325764367420682 -7630443591734791098 -12608147700378373379 -9870724570088730 -2150364451439708714 -18412545938780258356 -13221120945827219803 -492241614 -4129856608083381232 -15740733274947783803 -15858116883009440274 -1873618476141446514 -816513961 -17564225130023161250 -13697261 -10668197763104573447 -71041511 -5357143003026951378 -31022281504720056 -1873618501936351339 -3801219 -442814170389 -5701610621477129021 -8520914754064026558 -15289397306641222853 -108593749 -98697768 -9870724568058057 -5780604294184830225 -156041850 -5192881006389626514 -32150304123324262 -219257572663 -18412545968873930811 -5249797099496672683 -11127945220196076778 -9103100569952650951 -11665621 -421318034537 -17619012718254098754 -14443179094226111164 -1873618480440216958 -69009868 -10594427319499622429 -814482337 -13968724050119231192 -28202091681875145 -27638110466671725 -16166203682344470241 -1712194570 -472907842721 -507970270 -15580874172203795679 -23689855033805297 -154010219 -17092164759424403479 -12893049762838873864 -6877309693745106245 -545522479 -5887800020369606783 -14977809576148535095 -19530026 -14105033451515939293 -6795216411027442152 -2543452128325209336 -1385890784 -114426460 -6444189713816225654 -6152225714402364510 -524384476410219715 -17953567922355439196 -17113993018971653874 -573178715 -515834601 -17090754617222956318 -161874570 -1538130937 -47186305 -30458188512103543 -2449021711964768402 -2414448843017751282 -5214737420442796133 -505938649 -2625321610894575340 -13965057806789381527 -970700105235760464 -15223822230290106035 -16285378285009240167 -16940455997476965252 -2601013084734032090 -5248157445900799208 -1580068669843704469 -15043322265989680207 -29048166685607288 -3863606942184311140 -820315079 -17045009756596405420 -29048192480512516 -11510172448171493799 -5885976160280708469 -7602365 -17785259896117529586 -8856014216854897981 -14477731067643038195 -1873618514832657292 -2578187325 -15292499491370895395 -33560368941827284 -13146357072728951328 -17353152791227993245 -159842942 -15530553734630409457 -5569296726948055802 -494159375523777824 -1812923415 -6366353518750729401 -4278715465 -17097308613030775025 -35258719 -1899651063193471062 -12103109825679658143 -6364338522051512284 -2429880031182916564 -11621189233770302317 -72811005 -15466754 -3880024017885400135 -818283447 -62914993 -4076606625033226775 -1873618497637320883 -7746405201714873917 -5570718 -10859426818132543221 -6925759835249836137 -3506237898852665380 -23407812836853915 -1873618523432225060 -17166316876055971050 -18008952305986046279 -43123062 -9870724569826462 -7410173966093388838 -33560399035500221 -511599051947 -214958540605 -13237708557081051143 -20587696099952690 -15339421027537585423 -6104586261132347910 -11103300151687644832 -1456931819 -1873618450346281005 -9181531069949872018 -14650572868605052119 -17783567759008991682 -575239712866634722 -15288269284022357372 -6206321673575138470 -644219759 -13435115 -399811749952817933 -145335345147610979 -70779363 -6366071455058494624 -7529998377695250462 -519635711 -3539071 -576979807 -9568723490388248888 -634323816 -13012951802393594980 -853643387796785445 -98435620 -28766107292140894 -9181555677596944971 -5195701200510977145 -5129024196560096606 -5831598124518278362 -4844858457232050089 -219257310372 -7569568047215545466 -5461104800004441485 -1518418407735101149 -814220189 -11403474 -18005251247539029895 -10333839787251271664 -1836516380 -8054758354584013306 -507708124 -163644058 -9001701177466488459 -2625321606595545096 -153748072 -4787251587801811388 -39059811 -545260331 -2036204584 -5356296971014964874 -19267879 -9714916684781063078 -3055188874828713383 -14576212124415364447 -2150364417046743283 -4662355849599126556 -1372824966366170355 -1318388695 -15289397293744393060 -8423108281783224429 -505676503 -104268357 -477206348880 -5831598081526006949 -4625631396377398109 -2625321610894313322 -6206321759557388696 -12237654281284815334 -17236251 -9391897711091583990 -3891732840317912522 -8856014216854636141 -5758903550139959418 -7340217 -638124907 -810156929 -6206321690772243584 -112132697 -15287987228927658628 -339636063086 -7721139320100816372 -684134305183500639 -22279768720672168 -5831598111619679502 -14814059355306855043 -4211213383 -15290243360149735302 -18411699880973959188 -15204606 -11507341268100646834 -62652845 -6365225483234117329 -5308570 -3491703531359374171 -17791918762976347730 -4127600455366674792 -11130039777759856047 -13951205954302381098 -18115578910873816258 -8659114857360722535 -6153353844499089111 -157549179 -9870724569564298 -16327183209838150989 -491717322 -214958278120 -32432303330691092 -17684252729367202593 -16965951797418331227 -23068994 -2272905061487347697 -1873618450346019367 -7515799761807542411 -815989668 -2576363817137867614 -70517215 -17763448248357489818 -13172970 -3276923 -806093689 -17621268802185464283 -60621205 -18411699911067631643 -576717661 -1685722535145180234 -23689824939607125 -17256155806064642777 -5516892801706297876 -12982659022915898414 -9870724567533791 -15515140725455259155 -547029825 -219257046468 -4180850416920431050 -21037361 -68485573 -11141327 -813958043 -189614828176542708 -1873618480439692390 -279448454880 -16253215886083360174 -572110149897422243 -9896616181508082455 -153485925 -8021450371307931626 +2507605048 +17607182983838566334 +546439994 +2679637056 +41812332 +99156525 +9140909979694467183 +11742834345080916462 +9950583114428779661 +18411417894664929297 +17160329975787685834 +1518418407735101149 +18331556279224644 +15289397293744393060 +13950077918785243724 +15287141235606883137 +2789363555875490728 +491913932 +90505732 +214958474959 +21692726 +2063139881 +9870724566418979 +339635799228 +11740202404159819072 +12769623874203027091 +7171706723174648069 +16156684754098128751 +6208295835683456476 +1873618476141316771 +5882159696614657105 +3431717683755289915 +1873618506235448739 +17166316876055971050 +1023125932615797552 +22279798815198594 +12346762090311779845 +162136717 +331037018572 +13041896 +1733362705 +643826540 +2306802734 +477206873177 +17309267256018536307 +2625321597997222413 +517669620 +620888934 +70386141 +31022281504720056 +7409502855497715015 +6155045934318095559 +18412263918078459945 +5458848625792321791 38797665 -19177566795402134 -27356016680241600 669582195 -2625321606595283106 +27328854 554894151 -5512098557251945790 -9568883447315500158 -1440671446449589035 -4502324021620638916 -3249068390006196153 -15292781563660995825 -821822415 -27356063969248337 -18413109967286566983 -10911952793442192048 -6064503826171693679 -11161692095903435283 -1004761907965660269 -2207210695286917386 -6388664954993575829 -46662016 -5885976061401368013 -104006209 -5572809636517250553 -2625321610894051277 -17955470565775510239 -4661227814082512385 -6368045642960996241 -5463642874544129714 -16974104 -533070599 -809894783 -18413109997380239438 -7078069 -637862761 -6288511205539515238 +468608091255 +15859976 +4287350254045103750 +61735328 +4391052 +6520986101609793850 +153485925 +8510664359869943178 +11050161621988804687 +20869691006257762 +5196265237615086368 +3491703531359374171 +1873618489037883086 +11633356565151157114 +16633695839999756254 +23407812836853915 +1873618519132015281 +12074216556992400767 +6153071832396467338 +16120716880803858984 +5299098848608717979 +17149817495305717193 +18411981927470333989 +3308118261903721908 +5831598124518278362 +7209143 +810025856 +797977540607610221 +98959914 +7470284155521404014 +2564752444 +1727529996 +12318365723907459763 +5884848047378859255 +13222096480399396057 +6314795724398267312 +4397798316509039896 3974700764184054454 -18613559784442970 -2791055594105669609 -4504298205224635444 -18412263935274844205 -2605266760616185153 -15287987228927396675 -339635799228 -92078603 -8501910827968825512 -5991347884504386492 -210659247559 -17284241873202253123 -16893851873170950707 -651404368114879038 -18411417873169448972 -24838480 -5726226344404977639 -10259573046193883986 -2676958769323838072 -72286714 -6886936648282539655 -14942458 -521143041 -5046422 -13980703149896829784 -1495991284 -62390697 -18199185222634702635 -8834282535679560676 -15925946803693423456 -42598769 -9870724569302153 -5459976661309982295 -11084138473134491150 -5303047078245827995 -214958016090 -12451287838412704489 -5509410202188647833 -2681814701524780811 -10628953736434486617 -9774054990929462949 +5514354709969504081 +2893509029140760671 +1873618514834032208 +5516046791188875281 +1223976962194278208 +14737352740221028816 +6368045642960996241 +3489447322753895731 +21496117 +9870724566222277 +514654951 +189614828176542708 +214958278120 +491717322 +571999061 +6367324841362000185 +10375505339483621145 +8070938101082033295 +5569296709751605280 +1316357237551401394 +12020684574736647824 +15991329612793777185 +10697899350700788395 +16739161091967945306 +3891732840317912522 +1899651063193471062 +161940107 +24314188 +2224234517276395067 +17082847207615301902 +2625321597997025900 +6152225714402364510 +12845285 +506004186 +1733166096 +70189530 +10906583445476542150 +563348302 +31022281504523376 +1873618527730601376 +2530175340657839273 +1873618497636468806 +1873618441749006513 +18412827950883864637 +6366353518750729401 +1413046597527668667 +4078298775038527628 +5565348505908348542 +4022831255438034250 +153289315 +4194441 +15663365 +11700344903086704893 +73007615 +818480058 +296644709200 +95945236 +2150364417046743283 +30740204914804024 +15290525359355331959 +4237766475632413481 +16758489844492275047 +5408700909154273182 +5153885660580611393 +1873618519131818153 +13951205954302051853 +3597357340772992368 +7432602967203907143 +1880166538706292058 +399811749952817933 +10381427610856195682 +4644563108626631009 +14665351642484132 +7012532 +5141736951422061236 +3344434243 +16330874579771459902 +1873618484739705502 +8550520059753138843 +4645667113710455153 +5885976069999102359 +15501473033754248808 +9896616181508082455 +5462796868327967227 +14585410861575638263 +214958081659 +339635406848 +11818157132458100908 +11526999220155450649 +18613533990193666 +1873618450347593089 +3861350810962691992 +684134305183500639 +18413673995792875610 +15530271666638163275 +17621561863500597513 +4238330517036600601 +22279768720672168 +4502606072414800438 +10655291933708585535 +161743496 +517276402 +2625321597996829544 +12648675 +563151692 +1308623824 +104399431 +236453432350 +4279043148 +540214046 +1744643526947965735 +2065251783916127931 +18411699893871247383 +5459976691403131036 +21715680027609308 +5726226344404977639 +15292499491370895395 +18413392005184749654 +1873618497636273356 +32432320526091507 +31304323701802109 +2576363817137867614 +1631882651478526261 +5995296157134227520 +7558005371879033601 +61342108 +95748625 +520094464 +15466754 +3997830 +5240846595623881868 +5887800020369606783 +15288833278135765839 +818283447 +72811005 +5459935770830768809 +9355193091131312182 18411417903263121427 -3865299049198390675 -12910822 -5356297009705911966 -2421359666 -70255067 -2248112069177510680 -3493395634074945822 -60359057 -12654580528992553525 -519111421 -3808100888100343209 -3014775 -13513632858283052077 -15289397310941235057 -8861613698626554738 -9697577994188492052 -155255415 -10381427610856195682 -9870724567271440 -2625321602296252770 -14512708438227029368 -97911325 -489423554 -4022831255438034250 -30671195 -1873618458945324208 -20775215 -5459976691403654584 -813695896 -12665415616966166285 -5645056620059298667 -68223425 +8430474765433179073 +5247593352907000017 +27638110466671725 +32714414313178248 +9234597529149245860 +3229097897723824621 +7449919019336600171 +2413828615876118471 +2414448843017751282 +6101795942670075923 +7697026996393675938 +31304285008889193 +15777957523720635747 +3143159678306028631 +11065487220741573048 +6815921 +2140013610 +14282671233461718187 +9230753948926543533 +98566694 +2625321585100065781 +5382561551670903978 +259130038 +155910777 +87097857 +18284834 +282067642 +545850164 +33278352538406314 +21433680820701635 +5625593289148533238 +10512763733196344280 +3784125305237867347 +1873618514833639109 +32432337723461001 +1873618454645376983 +15292499534361593441 +5133829485925763690 +16904712944497920326 +5511666277521099409 +5622264654903379074 +571605843 +514261733 +491324104 +2625321606595414132 +21102898 +1385890784 +524384476410219715 +17257283880273643533 +5195701200510977145 +10280579133800254203 +200191596416994196 +1873618476140725820 +13117263636444153530 +15096032016463431129 +6729754102968812754 +18412263926676652075 +31304272112126853 +12118995007347033900 +1996555300 +9870724568648556 +540017436 1319896024 -2390363305266056430 -17634738504986593825 -20305632407192782 -17462509665872383079 +4236074403011431549 1606616067 +195953314 +23920969 +104202820 305243098454 -163119765 -48431492 -10590197086357423689 -2787671431665157349 -6366353484357502971 -18413674021587452000 -17620986833073014515 -105775699 -20869665212206112 -4445946672738929841 -95879699 -2625321606595021110 -10906583445476542150 -18412827959482056767 -17205553309096938840 -12294570438877711433 -5461104782808583112 -544736038 -9950019055828534995 -5991347927496394467 -811664269 -5403008449516603011 -18411981897376661534 -572392279 -7677136701370927115 -6155045908523191668 -18067928196024961188 -20587511236070012 -103744061 -161088132 -335336768790 -6155045934318095559 -13322381941750499717 -15291371425760087333 -30740222110467489 -5245848925746498573 -5349308051975768286 -4548309565419816229 -255984301 -5461104787107351969 -16711957 -10906583475570214623 -6365225453139920066 -6177363118375897150 -6815921 -7032232753418799293 -5558136817694803400 -4030203865610717075 -12718336251608304605 -18411981927470333989 -1545208828 -15287141235606883137 -5837238474067478018 -11705421198335413148 -5524868651610213131 -210658985303 -6098975770044925746 -24576334 -13151687854617134836 -4662073803102881076 -72024566 -817497011 +12452064 +5248157445900799208 +31022281504130688 +1873618497636075077 +1454041666728626384 +1873618441748613384 +15289397310941170468 +12999620585941961275 +5875369294806846690 +18142877345697171235 +2789363542978135882 +18411981936068526119 +12057284352529139627 +356832576945 +17092164759424403479 +1460339693 +3801219 +256115374 +1987904546 +1964966944 +15270143 +33278386930321618 +442814170389 +818086838 +17462509665872383079 +6206321759557388696 +5408471212899110030 +1873618523432225060 +17353152791227993245 +6261827792145090364 +15223822230290106035 +15287141218411547437 +7576852735584046364 +9714916620293637762 +31586271318836879 +41025899 +2625321585099869531 +223556471268 +545653553 +4023356732265137752 +98370083 +1531970550 +6619310 +23689824939607125 +9950019064427710530 +12424382439595706534 +1873618484739311861 +18331530485106038 +23407864425745813 +797695489810761887 +15289397353931868100 29330157293733695 -17096567568145714575 -1454859013759438228 -14680310 -4784274 -62128549 -1493907215600323645 -6364097387529046615 -12583654612056476062 -12851509922494416016 -1495729137 -15287141218411547437 -828143439367899804 -2523959969279970191 -3919394969679695174 -7595953279435999504 -2625321597997222413 -491193030 -1839046019115124804 -7241043922144659849 -18613499598604650 -18413391983689269329 -10594427319500605883 -12648675 -4861149623842704773 -5782296448490276391 -5516046782590617836 -518849275 -10015828607276288922 -15662612681012938353 -2752627 -60096910 -5133829485924779401 +6101795994259359091 +7692717626264324682 +5299098870103476096 +9813006656186419950 +3591160524196219107 +4129856608083381232 +2755882956846859930 +5352348797264856883 +812254097 +5524868651610213131 +11124082762859154482 +2857298572705729021 +19177566795402134 +18301216972081072101 +2625321606595217579 +6152225753094686522 +548471621 +5512098595943810546 +6584302816815089825 +11092808190891527547 +5941764144784016877 +18412827959482056767 +14428481252717692252 +5301355009924597043 +12284124821458521275 +3577503648415550265 +9870724568450966 +69599701 +7431889721301470079 +46662016 +35193182 +104006209 +12255453 +17877509356004052233 +11069796553860646809 +4347925833116091776 +10590197086357423689 +5570988786672405753 +9297735470756268616 +14637903957824965363 +539325825270679628 +15584540329550678645 +17247780946628644032 +15073532 +1574831104 +72417787 +152699489 +496763604 +577045344 +817890229 +3604608 +6204347606046083061 +12771845711499103316 +15290243377345399572 +11127945220196076778 +6208295882974168451 +11846037961957312985 +13106160036035691955 +1906986264008723742 +4657106642463886071 +9198943117821938833 +15270695523793439937 +5246976952665638015 7003516464553396964 -12903069678853164419 -2625321602295990612 -97649177 -259785401 -5464488953846367762 -546505531 -30409049 -374027977988 -1396769762 -21715680028329254 -5637072609524124450 -7731877951544692100 -1873618458945062288 -6767393152337644543 -9467310877347154547 -5429433323061448040 -10617033 -1730937871 -107356700000258304 -425617786716 -451412690018 +10956724774926813288 +820708298 +545456942 +63766972 +4585257123188181630 +6422699 +17891616 +9117971362513815455 +18413674004391067740 +14597841535548131734 +9772926989806013640 +1873618458945784014 +4522983015860209939 +13806855580317125108 +15426482629288462533 +3506237898852665380 +5787083718919720300 +13322381941750499717 +13237708531286474753 +32178524 +490930885 +2625321606595021110 +20709678 +1706624008 +513868514 +245051624454 +525337347 +16483453074211931840 +12217235256243064050 +4794173760728861833 +5347351719937377689 +18411699902469439513 +30458205707308380 +10750398672578676906 +13351948495571782591 18413392013782941784 -12020684574736647824 -105513554 -3541851256594893702 -16038494049631274933 -497025749 -4661227783988316231 -18412545951677546551 -5565348467217401524 -14428481252717692252 -544473890 -3344434243 -2169005683868174908 -5993603989931887912 -12972952285742288 -13117263636444153530 -811402123 -2676033356038276482 -1873618514833639109 -514786024 -572130134 -160825986 -1938490399 -10280579133800254203 -285938493736356261 -6425213859614951480 -103481913 -11364576519499679975 -1881294612915292853 -15739206202722094240 -4397798316509039896 -17011915733784398286 -1873618446048496233 -14383326641327005 +17088031212435737557 +5105416417023100899 +11427331956784106382 +3698377064120454404 +69403090 +1629160452 +161153669 +17153706162049649384 +103809598 +15580874133512784221 +7872981661881076049 +2544766567488424310 +8818864638845060491 +1597536180772867045 +17631161371525515669 +4977791693940394179 +29048123694646491 +15288269284022357372 +806224763 26345813 -6156455960443095577 -14975681650483333306 -819266496 -16449809 -15288269301218674108 +72221177 +14876921 +60752278 +3407997 +152502880 +2625321593698257851 +5675796551176948530 +5337229686545450161 +10649664295314066054 +18271599167641487963 +5741055947585816645 +1873618523431831649 +9763237054719266042 +5778348175860436286 +11906248855590275274 +145335345147610979 +27356063970624739 +2676033356038407648 +6226088 +7285785859232107205 +2036204584 +109445719 +5779476228575003910 +13117159209037203716 +97976862 +545260331 +1839046014815569788 +23407778443758207 +13885455448020813663 +17091318705916150977 +14749580058850363919 +32714379920475611 +5511666307614640107 +5780604362970367638 +18412263935274844205 +4767727591020628301 +5885976160280708469 +1396769762 +811860878 +5996988225456246061 +9887461037680036022 +490734276 +295544243748734701 +30458205707109873 +9950019055828534995 +17090754617222956318 +5566476545725367766 +17648172271756969893 +15289115277341755866 +30176189305784773 +6205475701751155414 +9940375093616053431 +5728764444739437994 +15140097999495498431 +6523880655054768550 +5727354401416743090 +210659313158 +1456931819 +11862232 +527958790 +103612987 +4278256712 +9870724568058057 +69206479 +1997667722089860216 +12339564610979564477 +5243108696682924272 +23125779236849772 +1873618501936285414 +16044698410490725659 +13669583335851559254 +14425661019905001872 +13681696359428851594 +16161820259100396848 +72024566 +24535844054893958 +3211386 +817497011 +9870724570875039 +60555668 +26149204 +24535874149025753 +806028152 +232154663489 +507839197 +14680310 +2625321593698061230 +15273884660262766886 +6633286351216577743 1873618493337504776 -5782296461386581535 -12162857194684744950 -16633695839999756254 -6553773 -6206321690771457172 -5411573444917201071 -14273081993166850387 -17297538988880889355 -9870724570810095 -339635275824 -101450287 -2625321593698192308 -91554312 -3812049113439014303 -492962512 -15289397349632182266 -342928503145892901 -9257009393629660721 -13674941621707869313 -17952462371364276975 -24314188 -7676326001635166459 -12622921449567619867 -14471968401314024391 -14418163 -71762418 -4522126 -1873618497636273356 -1873618523431177265 -31304285008889193 -2625321597996960522 -42074479 -18895601982637667 -14883032307819284131 -32178524 -490930885 -5459976661309458015 -194314911 -1873618454646032908 -9386257314251803173 -13950077918785243724 -5831598146013367591 -5882159627828332650 -69730775 -6100103913039400051 -15744000533156660854 -12386527 -518587129 -59834762 -9231865831523354279 -2490479 +3094190453106412515 +1087507565178193378 +8481290603310483360 +16885380374869314205 +5412367062202975465 +1372824966366170355 +2543805385922512178 +27356033876298083 +2676033356038210923 +820315079 +63373752 +6813843502384089093 +97780251 +258343605 +155124341 2148672331528407961 -2908260051937332390 -16876615841046071902 -9950583114428779661 -154731123 +6029477 +17632571483632043275 +18349504802666319185 +12133908888583014197 +18412827968080248897 +6100103913039400051 +5249797202674912471 +1873618458945389823 +16271603835638319461 +605557034314828631 +5881866613803452649 +3544107379218385465 +7406761759861377295 +811664269 +3234866947851553000 +43254135 +10675690836223986039 +3346269252 +17946608694533885076 +5459976644113468289 +15290525376551717170 +5946696443085589628 +3477193953305167424 +5353476789790574588 +28202091681942395 +5944020284604679310 +8143564249694210398 +31304332299601191 +8856014216854636141 +160760449 +28766090095429261 +5727354401416546168 +421318034537 +814482337 +103416376 +210659116497 +15505670362359531298 +16893851873170950707 +15515478115209971466 +46072191 +11665621 +9870724567861628 +23134531 +69009868 +14105033451515939293 +1784112314702629632 +32714336929384395 +853643387796785445 +4713167439824750602 +3812049126336301758 +16130159995999161574 +15289397371128645360 +3910652327921846506 +519111421 +71827955 +9870724570679212 +2625321593697864817 +60359057 +326737659857 +163578521 +17219576355390295334 +197984938 +817300400 +3014775 +18413674012989259870 +27638084672359236 +6156455943247300775 +18115860927276518423 +18323667541285735009 +5572809636518234139 +2581508047683782932 13237708539884666883 -30458205708158447 -2964529530791004471 +2524806027085153844 +2676033356038014277 +31243224015702806 +12982659022915898414 +510460641 +464308734399 +2219404100148201532 +544867112 +438515402871 +258146996 +5832866 +97583640 +63177141 +21715697223994697 +14657391675119111356 +18411699911067631643 +1873618514832657292 +15339421027537585423 +3545799490531822688 +16916327697533962956 +5299098844309358384 +4127600472562141528 +8920676095134336910 +5133829485924779401 +6151097665987347595 +6152225697206437786 +1706034183 +15897859265386515143 +43057525 +536216330 +943759021439519007 +10939233345785957508 +1746899701160150410 +1384869222252743071 +5881302580997523790 +107356700000258304 +11287403619712895066 +814285726 +68813257 +279448782049 +539034393 +22937920 +210658919829 +493159123 +91750922 +5831598081526006949 +103219765 +45875581 +516096747 +9870724567665640 +2625321602296449309 +5568582435113995179 +6154199872212897041 +5356297009705911966 +9001701177466488459 +6425213859614951480 +5129024196560096606 +3971798877726246151 +6471725260172231870 +18412545934481162291 +6155045908523191668 +27356042474686002 +11226550812567014265 +9870724570481756 +417019855960 +12512221777814685432 +2625321593697668091 +18116424960081923281 +14287090 +2818164 +71631344 +18895601982637667 +18066207382028748450 +5353476806987745228 +6100103891543657570 +6996745855548787140 +10594427319500605883 +575239712866634722 +3870997034531752803 +7239633818635733091 +29612147900877606 +8865366478519731984 +5352348805862656188 +8709732826087622782 +18412263943873036335 40042856 -2933734509745341832 -5459976691403131036 -1730675726 -1873618484739705502 -2676033351739245930 -15215179494928287321 -14866462842593414402 -5463642917535614049 -631243623 +5245789596497153220 +819921860 +15580874176502892132 +154731123 +544670501 +62980530 +17105177 +4254959725487523541 +5636255 +30458188511970924 +3973491001936446780 +7410173966093388838 +8704274751914773568 5885261859847867262 -11391362031143292020 -506659547 -105251406 -5778348197355914873 -16324853745603185849 -5509410163496651347 -152699489 -15292499534361856724 -496763604 -544211744 -4078298792234977417 -5461104782808057591 -14648423506775771515 -10504814416598927327 -8709732826087622782 -2544766567488424310 -811139977 -17088205463377873568 -15798241638577276499 -2676033356038014277 -2785415326238639918 -12562453432512743836 -12350988444867431112 -1873618514833377412 -16940553195690134509 -45875581 -103219765 -8854886168440079511 -5941764153383128192 -2625321589399162008 -11818157132458100908 -2785415278947600352 -15257764832492062794 -232154598652 -819004351 -16187661 -4644563108626631009 -4000515045253449269 -16872667624306444468 -1873618493337242815 -6291625 -6156737968247080128 -292346005443 -283116224 -3220426554520570467 -12356593998396393868 +13590665243542948895 +2412665810316625225 +18613516794268696 +1873618514832459339 +11623400942792738969 684134257893444250 -17175427809786595961 -9870724570547380 +9126223058424237061 +10530167802300925091 +14267039342724252928 +7042731044489660311 +811271050 +219257507157 +16204201012116260706 +19923244 +2248112069177510680 +19741625396299098 +14311172801615955497 +313840698753 +157549179 +4662073785906890031 +9658025172156550406 +6364338522051512284 +3599049409094225259 +6177363118375897150 +1801912319444323213 +11272401 +91554312 +2625321602296252770 +68616647 +538837783 +1411918553413126104 +22741311 +492962512 +451411772583 +160367231 +9870724567468020 +814089116 +2528483177756102046 +10370417990725208293 +6829167367527204602 +10167299845199168903 +14284319595218536933 +18413109967286566983 +9881712940254169714 +13819298136066198 +10906513561824594910 +9486667438472824267 +10215782083327823122 +3685635809078676834 +518718202 1992881803100621054 -2625321593697930351 -9450798976826149302 -16655465042802838677 -6474545510181176536 -11740202404159819072 -15289397349631921063 -9714916620293637762 -6098975770044401989 -16364556117061994922 -196084388 -540148509 -24052042 -11065179658016983681 -12480382642832672298 -71500270 -7285785859232107205 -14156017 -17632571483632043275 -61604254 -4259978 -17750109864738752812 -1873618523430913566 -9830100417878166271 -14425661002709010016 -4794173760728861833 -464308734399 -510460641 -2507605048 -41812332 -2679637056 -99156525 -16044698410491643447 -9870724568517151 -5516046735301085409 -6261263733545503259 -3759645248384009814 -538116878 -5779476232874035736 -6104586261131037638 -10531295842117158093 -12124379 -69468627 -5565348505908348542 -814941090 -5299098870104394759 -14322284629040564382 -10440328872292254866 +14090480 +59965836 +1550910461 +17063697102470777209 +71434733 +2411070513 +17639632887023929831 +805438326 +2621553 +9870724570285675 +1192315333980326167 +6928358494714596151 +5512098613140196086 +15611911946388048179 +5214737420442796133 +5778348150066318224 +27638024483702949 +18412827976678441027 +8881019260503721949 +5837238405281154301 +5461104765611674055 +4181978486829943864 +154534512 +5439644 +755605599842665887 +62783919 +292345154665 +544473890 +567411536 +15257764832492062794 +15122676476569913436 +5835546375651263675 +5516046795487905107 +10758418391935682553 +27356085465188671 +11400819049620310987 +5245848947241584851 +1728578573 +42664306 +219257310372 +8257735 +524354306 +429916226796 +4076606625033226775 +10162787574158199843 +6064503826171693679 +1873618450346019367 +5566476545724581156 +2704904932763174902 +4548309565419816229 +12484855343804124176 +879419277503368073 +6153917830015027393 +573047641 +68420036 +9870724567271440 +2625321602296056238 +2531021389865944442 +11075790 +102826544 +6064762127302393958 +5249797159683425776 +18413674021587452000 +31586340104504804 +4469799173763958889 +13237708548482859013 +31586254122912349 +9870724570088730 +331037869860 +417019463453 +48300418 +71238122 +1539245050 +644678512 +2424942 +11305519054433421356 +15739206202722094240 +18411699919665823773 +4787251587801811388 +32432320527338097 +27920126869375123 +18008952305986046279 +4661227783988316231 +2543452128325209336 +12826571498698443033 +16711957 +4160546838840674266 +5245848925746038203 +62587308 +5784522635265967958 +5243033 +544277281 +6211116016906930204 +16253215886083360174 +23407808536904833 +9821766011288487605 +2676033351739442523 +8061124 +13012951802392676509 +219257112483 +547095362 +1992881785902860007 +19530026 +810877831 +2625321610894640833 +4825924017323379312 +8854886168440079511 +3808100888100343209 +3493395634074945822 +12591757708863407913 +5349308051975768286 +13361048879788721990 +4074350485214726972 +1626046306171619904 +8617826180017097033 +13513914891881875478 +29330183088506125 +18412545943079354421 +6405261049027955879 +17939922315943150958 +1410073577 +7837634943338155161 +85348920764927349 +2625321602295859611 +813695896 +538444562 +29048192480512516 +45285754 +68223425 +91161094 +10184384893691038634 +17542946455516547053 +4180850416920431050 +1928986057181235415 +6364097387529111599 +15289397371127860096 +2522831856378710008 +5885976061401368013 +21997756618246082 +18412263952471228465 +816513961 +13678484518713821516 2228331 +2531021385567766485 +197198505 518324983 -16872385650894636566 -6284197438710222140 -8098722631875955846 -5727354392818878727 -9870724566484489 -154468975 -2292825785040636736 -3172873343893834792 -14418466534433295118 -2707725182771857350 -15293345523383077603 -259261111 -19988781 -15371922320578972378 -19741625396299098 -18411699893871247383 -12818875419963886521 -2676033351738984017 -14268291611706526293 -1309213649 -104989258 -6367324841362000185 -7432602967203907143 -11331649863678691999 -15292499534361593441 -1815413785 -5778348223150556659 -5572809636518234139 -11408348231855703653 -2446197814 -13001682102565734253 -17186370630874106258 -2785415274648570354 +71041511 +9870724569894177 +105448017 +5779476207078475458 +13980703149896829784 +13697261 +12769025487284210679 +2150364451439708714 +4162099616697747321 +1873618497637320883 +1873618523430651633 +12716605781588708278 +5248951136269502637 +11703165067112811597 +62390697 +5046422 +521143041 +16515346 +2625321589399096275 +154141293 +1495991284 +165610142 +10528906628815718922 +555549513 +819332033 +567018319 +1095239150174145285 +1873618458944406678 +6364097374632348674 +10811668319096800853 +1465168459078698840 +17269866578628118199 +2676033351739245930 +7864513 +19333416 +11034422950646711803 +283116224 +2625321610894444316 +546898751 +18411417864571256842 +2372569380647405649 +12754891682880490747 +18413109975884759113 +3332575624131774585 +13536993689470216 +15291935475760762248 +6153353775713551670 +15289397349632312454 +9373330690077689939 +29330183088310857 14264783202905229777 -7171706723174648069 -820773835 -4645667113710455153 -16425638839461284611 -5353476806987745228 -1840738151924108521 -6153071806601889790 -810877831 -8061124 -5356297048398365877 -4770547841029572913 -12804866717273491655 -15580874133512784221 -514261733 -571605843 -12346762090311779845 -102957618 -10907429529076434052 +5995296139937712949 +12269921124804135698 +5885976155981547843 +4129856573689694799 +538247952 +3598203394278688718 +159777405 +22151483 +1409876968 +45089144 +10682570 +3172873343893834792 +15290243360149277503 +18412827985276633157 +28202117477106938 +2057911839619745748 +1193603335023233930 +1410790466305853323 +1873618476141774348 +16643035121679272213 +8716776878113885241 +14581169549127125939 +6375653898722412075 +8694008299851745161 +21997756618049241 +13500652 +816317351 +9870724569695611 +105251406 +70844900 +4279895118 +197001895 +24969554 +15855332315905657597 +151126621 +506659547 +5142301044413893172 +1917322269 +3137288237381257087 +14409153078548760239 +14633483086300318059 +5780604315680310424 +5572809636517250553 +15592058013925444099 +17244622751296785814 +27356063969248337 +33560399034844286 +62194086 +153944682 +4849811 +16318735 2625321589398899121 -5354604872597767596 -4279174221 -27638024484621167 -8483828720841721486 -1459422188 +9374458755688828226 +15882855708139391266 +10225919150420460684 +15292499508566297469 +14065038233622153931 +17943317531893566468 +7031431794891230329 +16385074671182940805 +6205475624366966000 +6103488079777762245 +18411981897376661534 +9796067026192895123 +7996312456522828750 +13487493291780736605 +17245750799710423012 +2676033351739049517 +546702141 +7667902 +42074479 +282919615 +5515085278788979157 +810484612 +2625321610894247837 +1544487931 +9511403338599564690 +5192881006389626514 +5778348223150556659 +32432363517642192 +14046027923586223423 +18413674030185644130 +10771469979967884371 +2229804632046437624 +17480593072628501093 +6368045642961454306 +13237708557081051143 +13331692090551241408 +7677136701370927115 +339636063086 +538051341 +21954873 +492176077 +9870724566681132 +1398211555 +8807886331112851129 +5516892801706297876 +16546579671803956126 +13217980679449939250 +8503320935775669540 +32150372909516328 +1675756474409617568 +7721139320100816372 +2541195915421354200 +24772943 +1309279186 +105054795 +9870724569498781 +162398863 +70648289 +477207135345 +3452050537366752044 +5460499803637156023 +18199185222634702635 +5512098557251945790 +21715680028265805 +249849483538007723 +3554388240579364748 +9386257314251803173 +10594427319499622429 +15289397306641222853 +29330140097217635 +14311736903207619026 +8856014234050823647 +17855463731522440261 +15291089478142986477 +6365225461738636619 +2625321589398702921 +39059811 23689889426704296 -17648172271756969893 -232154335723 -15925513 -10811668319096800853 -6365225478934037607 -9763237054719266042 -11633356565151157114 -63373752 -1873618493336979326 -6029477 -3580814869236944221 -5199085482290645376 -282854078 -2625321593697668091 -9870724570285675 -7449919019336600171 -1839046014815569788 -23789896 -9131616131521448314 -5779476228575003910 -5511666277521099409 -13940760354079114484 -18413109980183855178 -644678512 -71238122 -417019463453 -15131353489256221185 -447360420122266222 -520094464 -3997830 -15096032016463431129 -1873618501936549084 -61342108 -1873618523430651633 -18412263918078459945 -5344573059048999857 -5155859771100236117 -5405598659939206416 -27356033876298083 -2146416200305806198 -5303893093062347743 +2474797953316292924 +61997475 +818938814 +153748072 +4653200 +50528646 +256967343 +468608354196 +509280991 +5463642917535614049 +6209141923583494372 +16122124 +10375505326587315831 +4397798264919820154 +8054758354584013306 +1873618489038145001 +830399540494469985 +5637072609524124450 +13913370016116443160 +18412545951677546551 +2676033351738852867 +99222062 +546505531 +18940198 +5411521012994540776 +2625321610894051277 +374027977988 +282723005 +30409049 +7471291 +259785401 +821756878 +11229884474259868248 +16357059045845960667 +1873618454646032908 +10542598463376395267 +5887104182899575287 +12393440069873436875 +7730749911729375728 +15289397349631921063 +7621890105505615217 +18263821886743185772 +18058417591402760409 +1317733333 +511599051947 +214958540605 +67633599 +9870724566484489 21758263 -3189961199463959445 -527958790 -69206479 -11862232 -6364097396127827248 -1320879066 -365262179507571896 -23689855034002659 -1473119215 -18412263948172132400 -31243224015702806 -39518566 -9870724566222277 -545719090 -5301355009924597043 -9391897706793274792 -11514789185312918199 -18411417886066737167 -5299098848607995194 -2284412389694637269 -10530167802300925091 -10427987387505837891 -14322803714593785119 -2625321585099869531 -6829167367527204602 -6013889919468112625 -4181978486829943864 -8698802578697685482 -1654120425802828663 +1873618532028844481 +8328637003859953646 +5509410163496651347 +15289397375428069113 +16436648502584675667 +6205475697451599682 +8929320279979198383 +4974759074281293673 +9870724569302153 +13107433 +815924131 +2524775482 +28484129580057898 +206359759935 +2625321597997287853 +24576334 +70451678 +16432982289349543214 +5459976661309458015 +4237766514325588729 +14322284629040564382 +9697577994188492052 +5759560470823897206 +1873618527730862181 +6153071780807051278 +15586729198848181726 +5558136817694803400 +10694515171064744788 +1988559907 +5302201063430292982 +4456589 +1713308683 +96207382 +15925513 +13650504529854072320 +5458848655886518922 +61800865 +5779476232874035736 +153551462 +38863202 +8099682237308012832 +18411417873169448972 +2787671431665157349 +651404368114879038 +17955470565775510239 +18413109984482951243 +14911447610171655366 +8858552325786961082 +13840095604897025041 +5940918086979029952 +5723537903358642458 +11238431078799509026 +7758478083289188556 +2014710471177341259 +12454108019635062383 +99025451 +3862478902367620470 +17621268784989013395 +7274680 +546308920 +27638041680086900 +5991347923197297866 +6208295874376239521 +34124418943289166 +27356081166223293 +5461104782808057591 +5357143003026951378 +113312346 +7885152524183078888 +214958343888 +309541536868 +2395604016 +9870724566287831 +491782859 +2414921941537785811 +7528330190111771360 +30458205708158447 +2707725182771857350 +23407795639356361 +5991347884504386492 +14541340640523322842 +14576212124415364447 +525512494730316455 +6795216411027442152 +1160107295621122785 +11391362031143292020 +2421359666 +162005644 +517538547 +196412070 +6152225714402428442 +447112610911 +620757861 +2625321597997091447 +12910822 +9467310877347154547 +70255067 +8926052536804313893 +1873618467542403595 +1873618441749072804 +18116142943679220675 +4787251587800828866 +18411981905974853664 +17175427809786595961 +153354852 +818545595 +5462796881224795644 +15728902 +4259978 +96010773 +1334641629 +73073152 +61604254 +7570985824906512457 +20305632407192782 +14288223544298637564 +12772641161582545873 +13237708565679243273 +15394822466617412826 +18430745393540238720 +282329787 +98828841 +809894783 +17011915733784398286 +7078069 +637862761 +18546980 +7993599274919922706 +546112310 5569296748444387676 -1873618441748940565 -256967343 -5245848947241584851 -15862817677379702068 -14633483086300318059 -288046714075 -2203332276215481610 -7798976 -810615685 -237175467 -11340219378265033230 -313841615983 -513999587 -18413674004391067740 -2116750858326574509 -8070938101082033295 -2625321589398637514 -25099937047839912 -5245848878456439955 -12118995007347033900 -4562124381333884039 -31586327206235137 -16436648502583690678 -9181481831755875838 -5516046752497929091 +5429433323061448040 +1873618454645640429 +16425638839461284611 +32432337723721245 +2785415309041207732 +6156455960443095577 +15292499534361856724 +4727296740454696303 +15289115311734721621 +10914208898869168291 +583336804 +214958147231 +21365044 +491586249 +9870724566091296 +2246313005 +3901910077209972079 4183106466458307862 -1991460714865167155 -17082847207615301902 -818480058 -15663365 -73007615 -3701600990787603378 -63111604 -5767329 -579208034 -1493907215601306869 -11535686880442518166 -3313969578832561394 -2704904932763174902 -6570315963541227654 -282591932 -5726226297114658480 -17160329975787685834 -8843457619279611284 -18413674034484740195 -9870724570023121 -492176077 -30740204914083091 -21433663625497129 -1629160452 -1873618450346477252 -18412827972379344962 -5243108696682924272 -7260902865540482639 -816448424 -70975974 -15287423196122254433 -1873618501936285414 -5151629580948802356 -3735682 -61079961 -18411981910273949729 -7837634943338155161 -3597357340772992368 -5133829485925763690 -51184007 -10956724774926813288 -98632231 -17309267256018536307 -9870724567992379 -29048106498198701 -3544107379218385465 -14386655907412249373 -219257507157 -21496117 -68944331 -16330874579771459902 -11600084 -11124082762859154482 -5459935770830768809 -814416800 -347984565637089693 -11923578915473263059 -575144796 -517800693 -3297856681506178941 -326737923180 -16038494049632258844 -15104099179857577674 -32996413518841137 -153944682 -2152780467316001469 -8722536002903082945 -10646954815923686447 -545456942 -14458654042895551171 -3935742187522887052 -16064731596255856452 -19464489 -17648172288953812474 -6213874949885069218 -14851060135220743194 -6471725260172231870 -4504298175131421894 -573113178 -11701191021079496730 -12314601354656483126 -13957562954616997312 -161809033 -563217229 -104464968 +2989761681675848960 +681145240220994278 +4089771542585346905 +9960543895307946415 +1801847830 1366033375 -1133620930477295468 -6209141923583494372 -2625321610894509848 -5052785364214352114 -6155298040667702671 -5246977012853376412 -4074350485214726972 -27328854 -1873618441748677997 -2000487899013646903 -7465404271946632160 -7239351853821397993 -11742834345080916462 -6368045642961454306 -5516046795487905107 -434216307724 -3493677603186412637 -810353539 -16633695840000739887 -821147663836514852 -18413391996586557524 -7536828 -4151361015346562251 -14540810596246030644 -5995296139937712949 -159777405 -8816997369364548341 -45089144 -18412545934481162291 -9298403582666148514 -15108492788614827244 -35193182 -5568582435113995179 -5570988833963444820 -15289397375428069113 -15401217 -8430474765433179073 -10750398672578676906 -72745468 -5405598728725859379 -9250794030848869727 -62849456 -17422075106091075868 -5505181 -1873618497637255436 -578945889 -13106160036035691955 -282329787 -5570988786672405753 -9870724569761068 -7031431794891230329 -43057525 -1706034183 -491913932 -214958474959 -90505732 -18412545964574834746 -32432303330887118 -846140170598090257 -5458848587099997499 -17607182983838566334 -195297952 -539362075 -5460499872422693597 -23265605 -943759021439519007 -70713826 -816186278 -2207492642904016905 -644154222 -60817815 -806290300 -3473534 -1873618501936022824 -13307798926833551183 -1873618527730926929 -11349795265056081195 -567018319 -9388513449772451585 -165610142 -2625321576501808484 -7290339324003420579 +70058456 +2625321597996894992 +104464968 +563217229 +9391897711091583990 +12714212 +161809033 +24183115 +196215461 +4662073803102881076 +5564423899624572258 +1930668198955452820 +1873618497636337289 +2785415326238575484 +14418466534433295118 +15292499491370961900 +17305802226190387588 +1413046597527538184 +11547019543992076059 +18412545960275738681 +72876542 +6671860954713623381 +818348984 +7073102484926630551 +4844858457232050089 +4063367 +1436145094782551981 +95814162 +8697110475982376165 +15532291 +61407645 +23971751058934778 +13418544886826534789 +17616192489740896443 +8486888319115725460 +5941764217869305943 +5566476498434524382 +17083693235326683482 +12583654612056476062 15287141244205140113 -41025899 -9870724567730368 -5569296739846327213 -98370083 -1531970550 -219257244681 -2065251783916127931 -6151097665987347595 -1407386597 -3973490993339565383 -12463417266756127924 -17631161371525515669 -21233971 -3232498753 -4767727591020628301 -8972557000702888938 -1873618458945784014 -15290525376551717170 -1559626750 -68682184 -12689613402799605860 -527434500 -517538547 -3542979343701772038 -447112610911 -163578521 -326737659857 -30458205707109873 -2625321606595479619 -498702419026 -555090760 -11846037961957312985 +10329316755526125416 +545915701 +6881458 +23689855034002659 +12734096628671909131 +11199980773228349986 +98632231 +12818875419963886521 +6848542126596623056 +5941764183477191834 +3186488476490139978 +3875793754648151904 +14319322726341872694 +17090754651615726815 +3221822110943152678 +5516046735301085409 2286775792223980496 -2676819007 -11599686562536949325 -3968978683605551949 -5831598103022077418 -15175534989820758889 -3812049126336301758 -545194794 -12348736218027264207 -12743882002561631754 -12318365723906541324 -8882845388820581451 -12769623874203027091 -1732546160493595960 -10430737389551487761 -9512531412808567772 -21433723812579518 -812123024 -9140909979694467183 -4025048830681353606 -1873618489039455401 -18331530485106038 -5516046791188875281 -6156456003434055463 -12474564753552836994 -17621561863500597513 -104202820 -29612220986426501 -1996555300 -2625321610894247837 -17489156252859434801 -103179363763095696 -15920335005095365860 -13112992413209136128 -2034107431 -17291573824845253535 -9772926989806013640 -819987397 -17170714 -1873618467543321286 -16156684754098128751 -6925759830950740072 -7274680 -16161820259100396848 -3698377064120454404 -10296839827164892306 -13913370016116443160 -1363739614 -92275213 -210659444315 -1784112314702629632 -5461104765611674055 -507299956084 -13237708552781955078 -197067432 -4211147846 -14657391675119111356 -25035091 -1735459858 -15139069 -14426056237756189706 -12771845711499103316 -9940375093616053431 -6523880655054768550 -62587308 -10967349376607587326 -1873618497636993704 -15290807392954681807 -5243033 -1133620917580466754 -1873618523431898109 -11613165301442872555 -282067642 -9870724569498781 -2141513421469058406 -14318336791419094928 -5885976069999102359 -6153917830015027393 -214958212644 -548995910 -90243587 -16101055855214332856 -9409295256684857617 -539099930 -30458248699119542 -23003457 -252379820 -6173800107753209956 -70451678 -13107433 -815924131 -1873618476140856959 -3188833133853148985 -3211386 -60555668 -5514354727165429372 -18430745393540238720 -5566476498435442740 -8821966780582857359 -806028152 -31022281504130688 -15273884660262766886 -17153706162049649384 -15568274631689570656 -98107936 -9870724567468020 -2625321602296449309 +20587696099952690 +6886936648282539655 +6013889919468112625 +2625321606595479619 +1370042529145686776 +365428606574 +339635275824 +101450287 +17625510063045740642 +214957950334 +6213874949885069218 +812516243 +5463642874544129714 +10906583479868327250 +15744000533156660854 +5885543833259674054 +18413391983689269329 +1873618476140792146 +6177363174264606048 +827351178595273968 +10488220504998020326 +12517601 +5354604868299326678 +7734678113259293802 +3055188874828713383 +477206348880 +196018851 +517145329 +1801651221 +104268357 +505676503 +9870724568714358 +10531295842117158093 +15215179494928287321 +18411417881767641102 +11678577273375754735 +50011031689890353 +1873618441748677997 +9839328478246341893 +2704904949959166469 +18413109993081143373 +15289397310941235057 +31304323701671300 +61211034 +15335680 +164430493 +1884114794138700522 +497025749 +3866756 +4131548702199581670 +17761874897365304540 +17619012653768771484 +16542141154387102177 +4451048243670025981 +2973047420892220660 +6155298040667702671 +6684847 5250413516934940017 -10377197347619277484 -546964288 +98435620 +2625321585099935141 +15293345523383077603 +3324580943442478547 +545719090 +23689855033805297 +6829167320236755019 +5991347923196709309 +12903069678853164419 +8098722631875955846 +17142588721119759321 +6151097721875664077 +5352348827359053328 +491193030 +812319634 +2295119206548507606 +514130660 2429420595 -68420036 -13840095604897025041 -11075790 +2625321606595283106 +10757572347027851837 +10668197763104573447 +1873618476140594617 +18411981914573045794 +14847634415788362123 +451651625195343029 +4278715465 +746324852 +69665238 +15288551330518206781 +35258719 +23789896 +12320990 +161415815 +1491796976 +1812923415 +9870724568517151 +104071746 +5460499803636172954 +10592171188278987146 +9388513432576593267 +2704904949958969710 +16038494049632258844 +28202057290482949 +5303893093062347743 +5780604350074062990 +13674941621707869313 +15881445561639371975 +11405246090117384413 +61014424 +3670145 +1685722535145180234 +8834282535679560676 +95420943 +15139069 +3205882223899445065 +255984301 +1735459858 +1192315303887243384 +20869665212206112 +6925759830950740072 +883931539946605906 +5299098848607995194 +1445774942907271091 +4445946672738010859 +63832509 +17620986833073014515 +545522479 +98239009 +17045009756596405420 +6488236 +7536133444401891169 +820773835 +13968724050119231192 +5701610621477129021 +3068049059797011246 +20775215 +2625321606595086582 +29048166685607288 +15618641120352995308 +5831598115918776853 +812123024 +313841551493 +5880738612678821404 1873618506234530930 -517276402 +32432303331018178 +16219982623696489082 +12258209558853782455 +16436648502583690678 +9387385384162626351 +4151361015346562251 +3542979343701772038 +18412545968873930811 +6741138607599781046 +1709507593 +12124379 +451412624470 +516752111 +161219206 +9523554809025136564 +17951898368652543383 +69468627 +814941090 +92406286 +103875135 +9870724568320021 +2523959969279970191 +5144036663261072615 +30740239306197230 +2089265852158774334 +18331517588211470 +1873618501936549084 +6364097443417820330 +1873618441748286746 +27638058876667848 +828143439367899804 31304293607146613 -10225919150420460684 -32714392818354350 -163316374 -17480593072628501093 -3653991426073234491 -28202143271093720 -2625321606595217579 -669516658 -11075097734987253589 -544932649 -5248951136269502637 -24535874148371011 -5247593352907000017 -13750803869111880047 -821756878 -5565348488711963913 -18940198 -23407778443822783 -811860878 -3910652327921846506 -2372569380647405649 -6151097721875664077 -8481290603310483360 -15289115311734721621 -5197393238738928914 -8858552325786961082 -15270695523793439937 -103940672 +1580068669843704469 +5565348480114297669 +72286714 +164037275 +3473534 +14942458 +356832249381 +806290300 +60817815 6206603741566403719 -151388766 -2531021385567766485 -7563081637033018620 -13044533461222491710 -6154199872212897041 -9126223058424237061 -1160107295621122785 -32714349826081871 -6152225697206437786 -4333982245204396969 -7012532 -5411521012994803182 -5249797159683425776 -570557265 -17619527108083517000 -3758799224970808644 -11069796609748044689 -210659181949 -14926165161459649868 -7570985824906512457 -3234866947851553000 -1906986264008723742 -24772943 -1873618446046923526 +12240192446106372977 +5942328186188203485 +1493907215601306869 +30740204914083091 +1873618463243635741 +1873618523431898109 +2341393787733871788 +1873618549225229533 +129168850403198609 +5728764487730398405 +10015828607276288922 +12057002331826554305 +10159392401199270768 +12142525752872799042 +2676033356038473537 +494403323033 +292346005443 +223556143025 +10911952793442192048 +820577224 +6291625 +1394017249 +98042399 +12163381674616883890 +1992588707391932346 +109394696450803010 +17760542 +545325868 +12318365723906541324 7516607870825792868 -14876921 -72221177 -18411699906768535578 -1495925747 -62325160 -288043895627 -31304259214443724 -3685635809078676834 -4980885 -313838798363 -13951205954302051853 -464309454125 -7151957518376504179 -6153353870293665804 -365428606574 -14319322726341872694 -3493083035910933027 -214957950334 -13222096480399396057 -22741311 -538837783 -12845285 -1675756474409617568 -7676326031729298383 -1873618476140594617 -70189530 -2861086850442987769 -12590629664748537952 -15501473033754248808 -1733166096 -2949238 -5833854255738587405 -6405261049027955879 -60293520 -6364097417622914469 -50397573 -15289397310941170468 -1436145094782551981 -9870724567205432 -155189878 -7996312456522828750 -2413828615876118471 -1818166298 -97845788 -2625321602296187261 +18411699880973959188 +2396555433535145871 +4074350515307087985 +18172096623373846790 +23407778443822783 +18413391992287461459 +6284197438710222140 +13819010092172884 +15636771529559117046 +530117487457144076 +7241607903360452069 +17113993018971653874 +6155045921420412650 +17869638717220195611 +8695136395555507435 +548143940 +1992881785903908578 +15741861301866530650 +18411417890365833232 +5726358144768542273 +18413110001679335503 +16149105318148965958 +6366353527348595732 +6155045912821630127 +18067928153034001057 +7888341864134085054 +8856014216854897981 +11202456151687629452 +6152225744495577231 +69272016 +631243623 +210659378559 +3541851256594893702 +23396678 +11927769 +9870724568123690 +103678524 +92209676 +17297538988880889355 +1873618501936351339 +1519546451849645365 +5438906422044199526 +2626514825137096412 +15740334315622960494 +8912366315847026281 +5461104800004441485 +326737923180 +6388664954993575829 +14264208172476401284 +14745847 +3276923 +576717661 +806093689 +1815348248 +152371807 +2625321593698126810 +9870724570940976 +72090103 +60621205 +5569296726948055802 +4502324021620638916 +2599235317101562153 +12665415616966166285 +5197393238738928914 +3701600990787603378 +9654763076979264499 +12808641794728789765 +2676033356038276482 +18412263913779363880 +3865299044899163405 +6877319166685482198 4451323549999957434 -3544953467117898450 +15287141188316891641 +17563932 +155189878 +292345808939 40501610 -6364097443417820330 -1543385872365455415 -12606726616442537392 -16436379939763522008 -7562235540534921217 -546702141 -20709678 -18413109962987470918 -10939233345785957508 -1384869222252743071 +97845788 +6095014 +63439289 +2791055594105669609 +28484146776247610 14383042897579063 -245051624454 -813630359 -5881866613803452649 -1455946274504313841 -68157888 -10813643 -4502606072414800438 -9388513432576593267 -517014256 -16739161091967945306 -6203168539198949844 -20305658202031811 -15122676476569913436 -48365955 -5941764144784016877 -12601357272775920269 -5900805793554762144 -163054228 -6155327937823509637 -95814162 -2625321606594955469 -544670501 -11092808190891527547 -6365225423046182853 -3545799490531822688 -5991347927496329957 -2676033356038473537 -6928358494714596151 -18895516000586505 -18413109993081143373 -1317798870 -3242943116712479419 -8468495303965871404 -10215782083327823122 -295544243748734701 -7536133444401891169 -13880529192106527090 -18412263930975748140 -103678524 -8816997365064994109 -5513226652957347114 -13427220419978791304 -4279895118 -2581508047683782932 -151126621 -16436648502584675667 -5245789596497153220 -18411417868870352907 -1574831104 -5512098613140196086 -16646420 -16881311723980129501 -580191075 -6750384 -460010423829 -17142588721119759321 -5411521012994540776 -13331692090551241408 -2236213724530672835 -10512763733196344280 -91750922 -493159123 -210658919829 -5353476789791099071 -2973047420892220660 -102615266471184862 -817431474 -71959029 -14614773 -29330157293667421 -18411417898964025362 -8854886129749066875 -62063012 -1631882651478526261 -1873618497636468806 -1626046306171619904 -4718737 -6971710725545264615 -15463390673086056969 -5996988225456246061 -2625321597997156982 -1258091056198584472 -2365498112266798670 -12258209558853782455 -548471621 -200191596416994196 +5199085482290645376 +1818166298 +8843457619279611284 +4076606659425995504 +10441809166173275876 +17306856587979066781 +918014392040164136 +1873618458945456185 +12237654281284815334 +1873618484738787248 +3101815889301670444 +20023641798084435 +17404805271631431757 +10554335258691243263 +7239351853821397993 +12012735189037878155 +12893049762838873864 +5565348523104797810 +4078298792234977417 +18411981923171237924 +15636380174699072146 +1440671446449589035 +112132697 +429916882098 +3822179681402096264 +1881294612915292853 +16508579235574254010 +32432389312220424 +11911353550167017696 +3493395603981665996 +15287423196122254433 +6104586261132347910 +1873618450346674286 +2848264744227112681 +681145240220010584 +6366353527348399255 +437798118096833445 +16872667624306444468 +516358893 +15515140725455259155 +527827717 +103481913 +210659181949 +1938490399 +23200068 +160825986 +69075405 +7460569593843485201 +3172873313800750756 +9870724567926898 +14383326641327005 +4452458274095237609 +1330643932 +11731158 +4025048830681353606 +4530582984922301900 +10233718743719545342 +1873618471842024407 +2487491354099451134 +15292499491369977714 +11078361536363433136 +7513578521803359945 +15662612681012938353 +2146416200305806198 +342928503145892901 +7746405201714873917 5565348480113903112 -10159392401199270768 -538575636 +60424594 +14549236 +15897908900500866947 +33560403333875446 +3080312 +1005889956380019628 +817365937 +163644058 +507708124 +71893492 +2625321593697930351 +9870724570745030 +17750109864738752812 +17419818910382754661 +15475002888547338265 +16224960573811657069 +18412827946584768572 +7880043043777809442 +27638084672424186 +5246977012853376412 +6366353484357502971 +5407707525201267705 +359800716494834349 +447360420122266222 +2676033356038079832 +12463417266756127924 +6053028402293443390 +820184006 +97649177 +63242678 +28484176870181368 +5898403 +33278412725750974 +5293539447540681024 +4504298175131421894 +6313103561496791450 +544932649 +2597848126 +17783567759008991682 +9195012299735698785 +3491703471172619422 +8722536002903082945 +1873618514832721746 +2676958769323838072 +4000515045253449269 +9298403582666148514 +5780604337176709161 +11701191021079496730 +17943317531894613402 +5299098874403555921 5782296448490211725 -15289115277341755866 -12583138 -4959080478982475006 -4237766475632413481 -2687090 -60031373 -11241814380293784908 -18413674017288355935 -10162787574158199843 -5625593289148533238 -605557034314828631 -2625321602295925195 -97583640 -16546579671803956126 -546439994 -13513914891881875478 -18412827955182960702 -18142877345697171235 -8716776878113885241 -5991347923197297866 -21715680028265805 -5299098848608717979 -2686971790050919863 -10551496 -2676033351739442523 -5246976935469649046 -4236074403011431549 -5561348123192067576 -516752111 -13525196865559988902 -451412624470 -6813843502384089093 -3452050537366752044 -2723374776553770162 -105448017 -14284319595218536933 -356832576945 -1987904546 +13965057806789381527 +3880024017885400135 +43123062 +811533196 +1133620917580466754 +17096567568145714575 +7462549834646555859 +4223816177647290930 +1873618450346477252 +9232147856523987724 +6517011693716180143 +6219166245997316001 +29330122900898936 +17782439637510195701 +16892239439269464715 +8072726556923202784 +15862817677379702068 2789363555876800106 -17063697102470777209 -6584302816815089825 -5727354422913010657 -13944415416121166662 -28311895 -11906248855590275274 -3707523343842937215 -18412827985276633157 -821232589 -18415907 -2676033356038210923 -17257283880273643533 -18331556279224644 -9117971362513815455 -18411981923171237924 -309541536868 -113312346 -46072191 -103416376 -27920126869375123 -160760449 -361131345578 -9234597529149245860 -14835085562484362568 -4585257123188181630 -1413046597527538184 -6208295874376239521 -13217980679449939250 -1966081057 -6101795981361546864 -16384272 -10370417990725208293 -4196703391028741586 -6488236 -63832509 -5153885660580611393 -6155045912821630127 -5197393273132877515 -2625321593698126810 -10720606758114626648 -9870724570745030 -30740204914804024 -91488775 -7792373120121047026 -3579577413 -5458848587100981064 -755605599842665887 -17404805271631431757 +11534547 +279448847671 +210658985303 +252379820 +539099930 +814351263 +160629376 +9870724567730368 +103285302 +68878794 +14268291611706526293 +23003457 +16876615841046071902 +16269555352897260337 +1873618446048496233 +10161648493728303880 +10430737389551487761 +13735950183222348532 +1991460714865167155 +9870724570547380 417019921504 -9386257335747873389 +572110149897422243 +2883701 817169327 -18413391979390173264 +5240852582657493474 +518980348 +60227983 +4618470194090937269 +1459422188 +232154335723 +3773122177597967623 71696881 -8328637003859953646 -14665059300281706 -6101796011455220816 -4456589 -13070886371126478108 -8733200714257204941 -10913926882465549337 -29330183088310857 -61800865 +2625321593697733840 +331038328206 +163447447 +18411699889572151318 +13044533461223476582 +18413392000885653589 +16436379939763522008 +12314601354656483126 +5539270545646881104 +11507341268100646834 +102615266471184862 +31304259214443724 +7731878007432940921 +7401639761433855789 +9450798976826149302 +5701792 +5245848925746498573 +15104099179857577674 +108921430 +17170714 +5411573444917201071 +544736038 +468609401971 +3758799224970808644 +63046067 +819987397 +18411417898964025362 +14322803714593785119 +3062219857732765097 +2207210695286917386 +10532987970627045461 +1873618458945062288 +684134257893509654 +14101293042239958 +5015996636573993090 +6098975770044925746 +850088361543927300 +157614716 +111739480 +219257572663 +19988781 +30740222110861163 +8618954206935976415 +6206321690772243584 +1873618450346281005 +5405598659939206416 +15872788267758849077 +5572365145471912335 +4625631396377398109 +17619527108083517000 +493028049 +9870724567533791 +1559626750 +19177592590632702 +91619849 +2625321602296318353 +515965674 +103088691 +68682184 +527434500 +1990332636357069057 +899112529018292807 +6570315963541227654 +16038494049631274933 +15920335005095365860 +28202143271093720 14949273699027977966 +18412263922377556010 +5782296461386581535 +13001682102565734253 +12972952285742288 +2703776923039566000 +2687090 +11775490430040476325 +14156017 +2686971790050919863 +17489156252859434801 +105906772 +60031373 +11241814380293784908 +71500270 +5734260728554980678 +5197393273133271298 +17648172288953812474 +1873618493336979326 +683965395648908415 +18331539082773742 +32150304123324262 +17422075106091075868 1873618523431110190 -3573803894998305775 -5569296709751605280 -5835546375651263675 -9870724568714358 -42008942 -1746899701160150410 -9664889374910385451 -7406761759861377295 -2625321597996894992 -365428082633 +10628953736434486617 +14512708438227029368 +18411981931769430054 +16886908734816455284 +62849456 +9131616131521448314 +5505181 +11364576519499679975 +33560368941368890 +544539427 +39911783 +33560399035500221 +533070599 +578945889 +8097653480026868144 +154600049 +16974104 +17957750408840481687 +285938493736356261 +5991347927496329957 +10377197347619277484 +15131353489256221185 +15287987228927396675 +14282027259104724924 +8070528080642443989 +17128487303121020 +219257375260 +42729843 +811139977 +6365225478934037607 +460010423829 +490013379 +13850612818404510827 +2207492698791414354 +7515799761807542411 +1873618480440216958 11888218815508973537 -6311975551774360856 -1408369638 -6101795942670075923 -15515140772745448064 -27638058877519937 -13361048879788721990 -2430665780 -22217020 -538313489 -927164962728314711 -69665238 -27638084672424186 -2573543627316201844 -12320990 -2424942 -18413392009483845719 -3660444556051220001 -18412545947378450486 -154665586 -9870724566681132 -546177847 -2229804632046437624 -5245848917148372136 -15906307047154976446 -827351178595273968 -5780604350074062990 -6350640494756627870 -9198943117821938833 -2676033351739180486 -1192315303887243384 -67633599 -6205475723246636047 -17419818910382754661 -162529937 -17083693235326683482 -105185869 -8912366315847026281 -5249797202674912471 -2446394423 -1461650414 -257426098 -17299513133793348673 -4451048243670025981 -14597841535548131734 -14130457194541352666 -15290525359355331959 -9195012299735698785 -524354306 -429916226796 -6153353788611431303 -1728578573 -6153071806602085789 -2676033356037948725 -8257735 -2785415326238575484 -1873618489038408278 -8072726556923202784 -7731878007432940921 -16271603835638319461 -11229884474259868248 -5835546388547569431 -2704904949958969710 -103154228 -2625321589399096275 -6887529782530082437 -45810044 -16365628939578247566 -4408861808311732424 -3554388240579364748 -3431353251379022211 -4131548706499659810 -3229097897723824621 -818938814 -16122124 -10831084194895235709 -6226088 -6366071472254485645 -10441809166173275876 -9538952396691934382 -5994450030541998229 -6835382734606174906 -4397798273518472097 -2625321593697864817 -9870724570481756 -17782439637510195701 -31304332299601191 -4074350515307087985 -10758418391935682553 -11405246090117384413 -196018851 -17943317531894613402 -15289397375426759758 -1801651221 -12716605781588708278 -5353476789790574588 -1873618450346936800 -14462121002204464918 -2785415309041207732 -71434733 -10770155859627543824 -1873618476141841211 -5780604362970367638 -2530739313276357975 -14090480 -5567604589840172352 -296644709200 -11266915032714840583 -4194441 -2200512120787569683 -2549492329236335496 -6211116016906930204 -99090988 -9625506809262378259 -13237708535585570818 -490103571663 -14541340640523322842 -9870724568450966 -1793158821936040552 -9486667438472824267 -21954873 -538051341 -1398211555 -5408700909154273182 -5356297014005859746 -8444237263823374707 -69403090 -2599235317101562153 -15897859265386515143 -6097847713031849822 -2162794 -9796067026192895123 -13117159209037203716 -164299420 -17088031212435737557 -8099682237308012832 -8971880411373045432 -3099205763721988894 -9870724566418979 -545915701 -13237708565679243273 -4449074137450482853 -18115860927276518423 -5247593352907982888 +10754752208794748192 +4770547841029572913 +2236213724530672835 +12085352355710699032 +2625321602296121720 +11141327 +68485573 +22610237 +279448454880 +573113178 +9870724567336570 +17097308613030775025 +45547899 +102892081 +538706709 +813958043 +2150364429944620611 +15290243360149735302 +1004761907965660269 +13427220419978791304 +18412827955182960702 +2116750858326574509 +11847668763332905754 +15530553734630409457 +6366353492955694732 +5875369269012203157 +7528870385169533979 +71303659 +816776108 +417019528294 +48365955 +2490479 +518587129 +59834762 +163054228 +9870724570154139 +5300226909920168653 +1493907215600323645 +1873618523430913566 +6293435910568086045 +4661227814082512385 +9231865831523354279 +4562124381333884039 +5994450030542718433 +8468495303965871404 +6151097734773868363 +5308570 +51184007 +16777494 +62652845 +7410231625909407077 +8336200085500660803 +10377426660276898779 +15108492788614827244 +5405598728725859379 +5349367342193968413 +1873618489038801706 +12851509922494416016 +3812049113439014303 +14151987057237756511 +10744889200825601240 +9304480456320748248 +19595563 +219257178788 +15798241638577276499 +3017170418691476659 +8857706336766199103 +13957562954616997312 +8126661 +30740222110467489 +4662355883991631380 +18413674000091971675 +6203168539198949844 +12480382642832672298 +14814059355306855043 +10229733804179524009 +6887529782530082437 +10905173350565414454 16533468055605152863 +3758799212073651272 +240752528220 +68288962 +1318388695 +6350640494756627870 +5462796894122411284 +813761433 +10944716 +2625321602295925195 +538510099 +18411699898170343448 +13880529192106527090 +18413392009483845719 +25099937047839912 +10440328872292254866 +6835382734606174906 +3686437022462641529 +816579498 +541328159 +2293868 +71107048 +105513554 +151388766 +9870724569957729 +5197393273132877515 +5882159627828332650 +7851156332894489575 +11510172448171493799 +9250794030848869727 +8327325764367420682 +16778219695595128445 +8733200714257204941 +16580883 +13513632858283052077 +1461650414 +2625321589399162008 +819397570 +8423108281783224429 +5111959 +1473119215 +257426098 +62456234 +39518566 +12622921449567619867 +10531295803425490030 +5566476498435574920 1873618458944474091 -19923244 -3188833116656765520 -2676033351738918494 -4501477955215362649 -17621268784989013395 -14581169549127125939 -6206321707968234614 -33278352538406314 -516227820 +1873618489038604579 +18613366323088485 +3008657884776564221 +11621189233770302317 +5464488953846367762 +475082778886408323 +6155327937823509637 +9956242218935388443 +11065487246536017596 +2676033351739311464 +14361095630442006439 +810746758 +283181761 +2625321610894509848 +546964288 +6365225423046182853 +7930050 +6262673798362565305 +1840738151924108521 +8483828720842049762 +9013091190501541709 +8294669686619703163 +9288263741171697848 +15520597512816297356 +2792183694107936667 +9227353569080969220 +2429880031182916564 +5833854255738521265 +18412263930975748140 +2430665780 +22217020 +18301216972082383618 +11964228788262537512 +159842942 +28766150282773591 +538313489 +813564822 +7032232753418799293 +12348736218027264207 +15290243360149343057 +6406389097441592980 +2964529530791004471 +18613559784442970 +1873618476141841211 +5991347884505041337 +6101796011455220816 +6366071455058494624 +6155045908522469290 +8412057600244518110 +3478039985316562895 +12718336251608304605 +70910437 +4211147846 +197067432 +14443179094226111164 +2192639020 +9870724569761068 +105316943 +25035091 +162661010 +518193910 +5303047078245827995 +1903640920853056624 +18092519415945890646 +4127600455366674792 +6474545510181176536 +7731877951544692100 +11084138473134491150 +2625321589398965240 +1495860210 +154010219 +16384272 +15043322265989680207 +6204347601746593065 +4915348 +62259623 +468608617008 +1966081057 +1192315299587689576 +17256155806064642777 +1873618489038408278 +12662636664722033563 +1654120425802828663 +25099894056749168 +5299098874402571932 +2676033351739114988 +489423554 +30671195 +5411521012994803182 +42140016 +7733439 +2625321610894313322 +7329667560521271617 +6206321690771457172 +5967447917778832244 +2284412389694637269 +2572415553107265488 +18412827963781152832 +16904712944498838074 +15289397349632182266 +29330122899915877 +27356081166681957 +6173800107753209956 +538116878 +10551496 +3919394969679695174 +9870724578216632 +492241614 +8816997369364548341 +4662355849599126556 +16567374854657149772 +12884708026702235763 +6364097417622914469 +1873618532029106835 +8861613698626554738 6890349946557761313 -1411918553413126104 -162267790 -2474797953316292924 -1694703987789596868 -18172096623373846790 -28766090095429261 -1223976979390989739 -3221822110943152678 -104923721 -15185362616787929146 -10003084053115964048 -2625321585100065781 -437798118096833445 -1815348248 -31304323701802109 -152371807 -14046027923586223423 -2021331689141374237 -20869691006257762 -13044533461223476582 -16778219695595128445 -12057002331826554305 -17465760298758178660 -7576852735584046364 -129168850403198609 -820708298 -17891616 -1873618489038145001 -7995587 -11911353550167017696 -4522983015860209939 -12612941966326959190 -102892081 -2625321589398833886 -45547899 -11548493110908749415 -4076606693818764590 -7851156332894489575 -12779163922391107832 -5991347884505304103 -1095239150174145285 -3863606920688567965 -10771469979967884371 -15859976 -14312864964518020808 -17245750799710423012 -5963940 -10655291933708585535 -4162099616697747321 -63308215 -1873618519131818153 -30176189305784773 +5837238474067478018 +5780604294184830225 +11214563466576463780 +29612216687004362 +5516046782590617836 +10156853965084755435 +6151097683183797493 +11613165301442872555 +1986666427421953426 +6155045882728942511 +7033448275620070919 +2907303882175415846 +1320813529 +1584595969 +105120332 +7465404271946632160 +70713826 +24838480 +162464400 +12451287838412704489 +816186278 +644154222 +3735453693364143828 +9870724569564298 +1309344723 +21715680028329254 +13044533461222491710 +1873618497636993704 +3445982126355516078 +7529998377695250462 +12237654319976351671 +4534407021717882867 +3431353251379022211 +494159375523777824 +1136798196293306910 +16426766960960540026 +819004351 +12356593998396393868 +16187661 +3307734082 +14273081993166850387 +4718737 +434977997061097911 +62063012 +2625321589398768544 +39125348 +30458248699315998 +17858552114457937219 +5903884228619468800 +16872385650894636566 +10504814416598927327 +12213481117926952067 +18413674008690163805 +14101026494875963 +4709060078846741586 +2676033351738918494 +9714916620294556051 +13237708535585570818 +810353539 +2625321610894116800 53412232 +434216307724 +7536828 +41943405 +6770804071406897080 +821822415 318140582948 -15611911946388048179 +6365225453139920066 +4502324038816629924 +4030203865610717075 +18411699906768535578 +15290807392954681807 +11966722661119888545 +8618954206934993224 +12189960762281954023 +32432333423379563 +18413392018082037849 +6004915412369541960 +14546784569801180959 +745740842898098858 +15289397293744523027 +5299098870104394759 +9257009393629660721 +5900805793554762144 +6155045917120857525 +21823800 +1317798870 +537920267 +1730675726 +1535706104 +9870724566550039 +14648423506775771515 +10531295876509927029 +3973490993339565383 +14312864964518020808 +14824583848163281869 +16940553195690134509 +1873618476141446514 +5778348218852443426 +5758903550139959418 +27356016680241600 +13940760354079114484 +5645056620059298667 +347984565637089693 +815989668 +9870724569368358 +5887799994573980828 +162267790 +517800693 +70517215 +15925946803693423456 +2625321597997353452 +16572875051796793000 +575144796 +104923721 +13172970 +14426056237756189706 +5909364179964069981 +5459976691403654584 +4397798273518472097 +27920040887059601 +1873618527730926929 +1873618467542665344 +18613585580197092 +32714392818354350 +18613499598604650 +5780604289886653255 +3865299049198390675 +22279760122415532 +18412545930182066226 +50397573 +153616999 +2625321589398571980 +1736311827 +15991050 +14665059300281706 +4522126 +7792373120121047026 +30458248699119542 +13951205954302381098 +17785259844527786731 +6444189713816225654 +747829823970020707 +8698802578697685482 +14477731067643038195 +18412263939573940270 +14318336791419094928 +15291371425760087333 +12109395139072755174 +30277976 +99090988 +282591932 +546374457 +490103571663 +15580874172203795679 +810156929 +7340217 +638124907 +259654328 +18809125 +18056758355458722638 +5679882735784101879 +7563081637033018620 +8520914754064026558 +283748271730 +67502526 +9870724566353399 +7242736046355514492 +572130134 +514786024 +214958409445 +29048192479791616 +2625321576501808484 +5354604872597767596 +29048106498198701 +2575517759332551933 +6311975551774360856 +14036340911856223966 +32150286927595340 +17291573824845253535 +14926165161459649868 12640696470018459947 -30176223702288623 -9870724570219682 -33278412725750974 -1409876968 -28766150282773591 -1873618450346674286 +17498716255300421272 +3968978683605551949 +16377260960560187819 +19177532404009207 +2625321597997156982 +24445261 +5245848878456439955 +421319345246 +5510538272098551989 +70320604 +3249068390006196153 +5888081980883929307 +1836516380 +12976359 +236453760381 +2141513421469058406 +1873618497636600365 +11878630053446878902 +6156456003434055463 +27638058877519937 +18413109962987470918 +6288511205539515238 +4770547828131824981 +4160689491693538063 +14836382508930370955 +12751507524739009261 +10427987387505837891 +2605266760616185153 +2524806001290315567 +33560429128451329 +4325515 +669516658 +15794439 +807142269 +5303047104041388600 +818611132 +61669791 +12644080653952551280 +6045857707735386835 +11229983338076703492 +2845029447323880298 +18412827972379344962 +6767393152337644543 +2673382969485886910 +15185362616787929146 +17490170188584258190 +4047541379259827663 +15680489859993767209 +546177847 +7143606 +637928298 +7276444624641068235 +12287601267178473523 +31022238513759415 +17698252132056434004 +1732546160493595960 +7036226112429884975 +2676033644081056812 +548995910 +90243587 +571933524 +812778389 +9870724566156739 +214958212644 +1873618446046923526 +3493083035910933027 +15291935501556190620 +14650572868605052119 +6971710725545264615 +17302333254828493968 +6098975847429179176 +4504298213822565083 +505938649 +3579577413 +2786543383251193103 +70123993 +47186305 +2352415791 +4279174221 +2625321597996960522 +1538130937 +161874570 +17082847207615236134 +6206321707968234614 +8854886129749066875 +10908568553618343357 +2785415326238639918 +1873618527730534170 +1873618441748940565 +5745384143842643344 +18413674017288355935 +16044698410491643447 +9181531069949872018 +10905173367761798655 +13237708544183762948 +3757107087862401328 +1311572948 +2034107431 +15597828 +2538734651 +5727354392818878727 +4128904 +818414521 +95879699 +5727354422913010657 +5245848874158263187 +9664889374910385451 +18411699915366727708 +14851060135220743194 +17958290734101235336 +9319686106503382840 +89657146100418951 +11349795265056081195 +14540810596246030644 +5779476284463187670 +18415907 +156041850 +259261111 +821232589 +809763710 +98697768 +6946995 +5941764153383128192 +17684252729367202593 +10233694917695638297 +970700105235760464 +21715753112570631 +17953636526298302297 +6262673798361580735 +5847102830955857465 +3313969578832561394 +2974323816123992770 +13271165719268362246 +17083693200934636558 +6101795934071424788 +16990917635978692369 +812581780 +16327183209838150989 +21233971 +1535116279 +214958016090 +2625321606595545096 +3232498753 +1500709877 +514392806 +5831598146013367591 +4502324004423927097 +3099205763721988894 15290243360148359553 -14036340911856223966 -6365225461738636619 -816645035 -417019398489 -6206321673575531611 -12057284352529139627 -71172585 -13828334 -7528870385169533979 -5832726134240118664 -2785415334835848520 -2572415553107265488 +1873618476140856959 +3295137431799204142 +14130457194541352666 +8910392170935354895 +3967850626592737364 +18412545938780258356 +12583138 +505742040 +4278977611 +540148509 +24052042 +196084388 +563086155 +104333894 +2625321597996763849 +16324853745603185849 +13586095437453200186 +15804734059994287439 +18005251247539029895 +13516735047310051359 +3493677603186412637 +10159956468397444373 +5249797099496672683 +17763448248357489818 +18412263948172132400 61276571 +7630443591734791098 3932293 -9870724568188981 +72745468 +95683088 +15401217 +4076606693818764590 +15986098390340470919 +1873618519131556994 +9386257309953099582 +8501910827968825512 +168849237244054062 +6750384 +545784627 +2625321585100000596 +1652810939277510396 +580191075 +98501157 +5198803303557629187 +3297856681506178941 +3935742187522887052 +2601013084734032090 +11500631658516907905 +8021450341214588326 +14977809576148535095 +4127600472563058730 +16965951797418331227 +27356081165698156 +491258567 +12804866717273491655 +1408762855 +2573543666009114673 +2200512120787569683 +2625321606595348609 +21037361 +14462121002204464918 +5619444426388998007 +3973491023432910866 +12103109825679658143 +7260902865540482639 +5566476571519223063 +18413109971585663048 +17791918762976347730 +16365628939578247566 +4449074137450482853 +11214563466575480865 +7239069803025663720 +17952462371364276975 +9512531412808567772 +11075097734987253589 +2373415502940997016 +16874702537456224943 +517014256 +2573543627316201844 +4278781002 +69730775 +9870724568582655 +12386527 +12743882002561631754 +10906583475570214623 +104137283 +35324256 +10167863869407233224 +18412827980977537092 +363084051790629688 +11694336983993944146 +1873618441748546884 +32432320525830439 +12654580528992553525 +7241043922144659849 +9391897706793274792 +152830562 +1402930148 +164299420 +5303047073946667464 +3735682 +61079961 +15204606 1873618549225491555 -2360543918673038210 -98828841 -12512221777814685432 -17939922315943150958 -6045857707735386835 -21692726 -4502324038816629924 -11490081257974859839 -17639632887023929831 -1316357237551401394 -6101795994259359091 -11796695 -69140942 -18411699889572151318 -12074216556992400767 -1320813529 -8618954206934993224 -164037275 -4160546838840674266 -12591757708863407913 -555549513 -9870724566156739 -154141293 -32714414313178248 -545653553 -223556471268 -12613788024133322735 -812581780 -5778348150066318224 -1500709877 -6741138607599781046 -9227353569080969220 -515965674 -13884327378110449525 -18411699919665823773 -16340493341965880015 -162005644 -620757861 -21997756618049241 -17007720368052373541 -13001845694847518363 -227855238971 -17629469 -1737950228 -9288263741171697848 -20305615210743190 -1873618489037883086 -18613533990193666 -7733439 -313841551493 -15288551330518206781 -17302333254828493968 -6153071832396467338 +3188833116656765520 +31586327206235137 +820839372 +464309454125 +18022689 +545588016 +17205553309096938840 +313838798363 +223556406340 +98304546 +15463390673086056969 +4240022615453076686 +10831084194895235709 +11549275701007551889 +155648632 +6553773 +534119176 +4222974949961697922 +8326286517935867839 +1873618454645114642 +1146796961722731823 +5509410202188647833 +1873618514833377412 +3242943116712479419 +29330157293667421 +8882845388820581451 +12608147700378373379 +14465116522071263669 +5461104757014004985 +9649086479758069023 +2625321606595152102 +513999587 +20840752 +2148672322930150296 +10646954815923686447 +10831360821402142464 +313841615983 +10139438201185111279 +16881311723980129501 +18413674025886548065 +2785415274648570354 +5353476789791099071 2979056014524680527 -8857706336766199103 -2625321589398571980 -45285754 -5991347884505041337 -4502324004423927097 -16874702537456224943 -14911447610171655366 +6366071515245381876 +8610102806501591788 +10333839787251271664 +13237708552781955078 +451412690018 +16101055855214332856 +9870724568385196 +12189916 +23658823 +195691169 +5155859771100236117 +69534164 +35127645 +103940672 +11069796609748044689 13944990587222231178 -3308118261903721908 -18413109975884759113 -8412057600244518110 -15597828 -2538734651 -818414521 -17082847207615236134 -18276979644936029994 -5701792 -63046067 -5882159696614657105 -1410790466305853323 -18412263913779363880 -32714379920475611 -539325825270679628 -1873618519131556994 -13536993689470216 -9870724569957729 -43254135 -5153885686374731086 -9387385384162626351 -8336200085500660803 -5303047104041388600 -5512098595943810546 -5717788221838658971 -2324121364801391676 -12012735189037878155 -2192639020 -1873618476141316771 -70910437 -3670145 -2219404100148201532 -2544580112253650683 -61014424 -6155045921420412650 -18412263943873036335 -1873618549225229533 -9870724567926898 -98566694 +27920101074341046 +17298949057997047589 +2908260051937332390 +6364097413323754682 +12350988444867431112 +1223976979390989739 +5782296431293302176 +11098517635487303139 +13525196865559988902 +2374936041605498895 +15007995 +1574765567 +519635711 +5831598103022077418 +576979807 +817824692 +634323816 +3539071 +2446394423 +6206321673575531611 +2360543918673038210 +27638024484621167 +11340219378265033230 +6366071472254485645 +4562124351240801677 29894215892535509 -155910777 -6366353527348399255 -9956242218935388443 -31586340104504804 -219257441372 -13522668389390157414 -18411417881767641102 -11534547 -279448847671 -7242736046355514492 -68878794 -814351263 -1192315299587689576 -2524775482 -34124461934314600 -507839197 -5539270545646881104 -4974759074281293673 -5337229686545450161 -153879145 -12644080653952551280 -30458205707308380 +6153353844499089111 +13070886371126478108 +9181481831755875838 +18067928196024961188 +6981729909914862956 +63701435 +6357162 +15288269305517836796 +17299513133793348673 545391405 -17877509356004052233 +17826079 +820642761 +98107936 +8854886172739175692 +9082058141968173941 +1873618484739049815 +11514789185312918199 +5778348197355914873 +11130039777759856047 +294416195335096411 +846140170598090257 +2571498445011814318 +18412545947378450486 +1408369638 +2625321606594955469 +5245848947242502849 +365428082633 +5245848917148372136 +10859426818132543221 +15524263781940136850 +2578187325 +17564225130023161250 +811991951 +1694703987789596868 +1873618450346936800 +12105446909435186010 +14975681650483333306 +32432303330887118 +29612220986426501 +11644189250161151139 17520266449292560845 -11065487246536017596 -2011949215506761725 -6155045882728942511 -812319634 -1130753852548581517 -573047641 -5299098874402571932 -18413674000091971675 -18331556280207363 -17269866578628118199 -15289397293744523027 -161743496 -10649664295314066054 -6051485356288903427 -4347925833116091776 -30458188511970924 -104399431 -10184384893691038634 -7401639761433855789 -1308623824 -563151692 -2625321610894444316 -7239069803025663720 -11434534198373320614 -1873618441748613384 -5622264654903379074 -29330122899915877 -15636380174699072146 -820184006 -2597848126 -10233694917695638297 -14585410861575638263 -7471291 -85348920764927349 -6366353492955694732 -18413674030185644130 -4127600472562141528 -35127645 -5780604337176709161 -541328159 -2524806001290315567 -13850612818404510827 -18412827968080248897 -15335680 -3493395603981665996 -17858552114457937219 -62783919 -3875793754648151904 -5564423899624572258 -292345154665 -3489447322753895731 -18411981905974853664 -5439644 -42991988 -9870724569695611 -12269921124804135698 -559088458 -33278386930321618 -15289397353931868100 -214958409445 -6219166245997316001 -15289397379726773461 -30458248699315998 -23200068 -12163381674616883890 -70648289 -9000175594581527004 -806224763 -89657146100418951 -15475002888547338265 -3407997 -60752278 -18411981936068526119 -14267039342724252928 +92275213 +335336768790 +69337553 +7290339324003420579 +17621268802185464283 +161088132 +9870724568188981 +516621038 +11993306 +507299956084 +210659444315 +103744061 +13151687854617134836 +8659114857360722535 +825323275339564903 +103179363763488430 +684134210602468610 +1873618501936418049 +6205475723246636047 +5516046752497929091 +15885957841278600403 +2477484405147109478 +16875205763331852041 +72155640 +472907842721 +14471968401314024391 +806159226 +1712194570 +576783198 +1815413785 +2446197814 +14811384 +507970270 +8929038315166239946 +3342460 +3220426554520570467 +2625321593698192308 +5677488692584514734 +21433663625497129 +2435475427475262665 +16940455997476965252 +6153071806602085789 +5865888353649363875 +17465760298758178660 +13263754581809432790 +8716776809328151764 +13112992413209136128 +6153353788611431303 +3784724792312663401 +12590629664748537952 +2676033356038342054 +14219872676477209184 +11327137566841769230 +63504826 +97911325 +9339868219275806468 13726068525522684375 -1873618527730862181 -4504298213822565083 -155648632 -98304546 -9870724567665640 -13681696359428851594 -219257178788 -24535844054893958 -50011031689890353 -10532987940533372886 -11272401 -23407795639356361 -68616647 -814089116 -15635925519041823968 -1998521381 -163512984 -797977540607610221 -32150286927595340 -4709060078846741586 -5967447917778832244 -5885976078596834724 -2625321606595414132 -153616999 -1744643526947965735 -17461812017531651650 -987047180239768912 -30740239306197230 -15288833278135765839 -525337347 -5885976155981547843 -18413391992287461459 -10532987970627045461 -56689033 -5722409915131627177 -114033243 -10159956468397444373 -18412545930182066226 -5349367342193968413 -13819010092172884 -104137283 -17953636526298302297 -2224234517276395067 -2789363555875490728 -2625321610894182276 -12426051065400527122 -9355193091131312182 -30740222110861163 -14361095630442006439 -3137288237381257087 -17105177 -819921860 -7209143 -1727529996 -810025856 -805679481429165719 -17298949057997047589 -21997713627284659 -16120716880803858984 -33560368941433940 -1535706104 -10229733804179524009 -18412545960275738681 -9714916620294556051 -4078298775038527628 -5461104765611607541 -210659378559 -92209676 -13418544886826534789 -14264208172476401284 -1917322269 -197001895 -24969554 -5405598728725530322 -15073532 -817890229 -72417787 -1873618471842024407 -17091318705916150977 -5946696443085589628 -5177496 -5847102830955857465 -62521771 -1873618523431831649 +2011949215506761725 +1737950228 +6160551 +9830100417878166271 +155255415 +17629469 +8140646021471143544 +545194794 +8510103668314541335 +18411417868870352907 5835546371351184527 -14824583848163281869 -42729843 -9870724569433729 -5780604315680310424 -16385074671182940805 -214958147231 -3007753865419557454 -491586249 -17943317531893566468 -1801912319444323213 -22937920 -539034393 -27356055371580547 -1873618476140792146 -5198803303557629187 -6103488088376871190 -13041896 -1733362705 -70386141 -2306802734 -643826540 +18413109980183855178 +5249797172580910311 +10532987940533372886 +32714379920409891 +1873618514832984063 +13702827714901707594 +29330157293274228 +220421203678071202 +5565348467217401524 +313841222762 +570950482 +13012951802393594980 +6209141854797957852 +5717788221838658971 +5460499872422693597 +8444237263823374707 +2544580112253650683 +32432303330691092 +14986955239351847842 +4392112055939237960 +16285378285009240167 +6205475671656957491 +11266915032714840583 +15289397375426759758 +17284241873202253123 +1783548230307677653 +195297952 +69140942 +23265605 +11796695 +210659247559 +17257283845880874759 +451412296787 +92078603 +160891523 +539362075 +103547450 +9870724567992379 +11331649863678691999 +12613788024133322735 +13944415416121166662 +15895039144349470066 +8816997365064994109 +1732546121802517809 +13221120945827219803 +3863606942184311140 +12562453432512743836 +7562235583526800081 +9870724570810095 +71959029 +232154598652 +14614773 3145849 -14637903957824965363 519242494 -60490131 +2625321593697995819 +1133620930477295468 +817431474 805962615 -5784522635265967958 -1873618527730601376 -18301216972082383618 -11644189250161151139 -2625321602296383846 -9870724567402585 -98042399 -15741861301866530650 -494403323033 -6729754102968812754 -546898751 -6208295835683456476 -33560403333875446 -14409153078548760239 -15530271666638163275 -1873618458945456185 +4131548706499659810 +60490131 +503001777494 +6206321673575138470 +1258091056198584472 +3573803894998305775 +10967349376607587326 +1873618523431569790 +6153071806601889790 +12749251354825264418 +9625506809262378259 +2676033356038145381 +15635925519041823968 +5885976078596834724 +9484411285755463284 +532291916112267238 +18411981901675757599 +1703347206 +33560368941827284 +5303047039553965447 +40370537 +97714714 +155058804 +6261263733545503259 +5963940 +63308215 +1130753852548581517 +5570988833963444820 +18157949162008873831 +8021450371307931626 +2861086850442987769 +1873618489039455401 +18413674034484740195 +1873618458945324208 +32714349826081871 +18424247431471827427 +1842511416005692464 +6589396841525218018 +5782296448490276391 +13237708561380147208 +27356055371580547 +5462796868326918190 +1860700038481053299 +5458848587100981064 +3580814869236944221 +5566476545725106758 +28202091681875145 +5915592292141435844 +11434534198373320614 +15740733274947783803 +10161648502327149991 +15287141235608259625 +12779163922391107832 +68944331 +814416800 +1823671323 +23068994 +210659050964 +46006654 +516227820 +11600084 +103350839 +361129707266 +13750803869111880047 +103179363763095696 +1873618501936022824 +2933734509745341832 +7230168968130792223 +14517406836956661503 +17619012718254098754 +12406930521299355297 +4408861808311732424 +2949238 +9870724570613070 +60293520 +503001580666 +14947075702982868 +1998521381 +2625321593697799226 +14418163 +163512984 +71762418 +5722409915131627177 +11599686562536949325 +1873618493337242815 16951650337051970851 -5144036663261072615 -813826970 -12133908888583014197 -68354499 -11010253 -279448324634 -14749580058850363919 -6633286351216577743 -2089265852158774334 -8929038315166239946 -31586271318836879 -13678484518713821516 -105906772 -96010773 -2625321606595152102 -153354852 -10831360821402142464 -5652457623480305518 -8503320935775669540 -16483453074211931840 -363084051790629688 -544867112 -258146996 -5944020284604679310 -5782296431293302176 -28484176870181368 -23407778443758207 -3973491023432910866 -5778348175860436286 -1873618514834032208 -5438906422044199526 -103875135 -7697026996393675938 -1709507593 -161219206 -13237708548482859013 -3701601059573925529 -879419277503368073 -3822179681402096264 +2676033356037948725 +18412545955976642616 5565348445721659362 -532291916112267238 -256115374 -1460339693 -13351948495571782591 -14665351642484132 -3008657884776564221 -2341393787733871788 -16904712944497920326 -3967850626592737364 -16843031 -4131548702199581670 -6946995 -809763710 -1928986057181235415 -11964228788262537512 -2989761681675848960 -1873618519132801026 -7276444624641068235 -5994450030542718433 -12284124821458521275 -111739480 -4076606646528706921 -13650504529854072320 -15804734059994287439 -14425661019905001872 -2395604016 -14465116522071263669 -210659116497 -15290243360149343057 -15777957523720635747 -10167863869407233224 -18331517588211470 -12884708026702235763 -14811384 -72155640 -7042731044489660311 -15288269305517836796 -5675796551176948530 -14264208198271043974 -1495860210 -5787083718919720300 -25099894056749168 -683965395648908415 -62259623 -4915348 -12974919760129952993 -6155045917120857525 -1873618523431569790 -9013091190501541709 -4392112055939237960 -2625321597997353452 -15897908900500866947 -6177363174264606048 -15872788267758849077 -491324104 -33560399034844286 -22675774 -17542946455516547053 -2431124533 -538772246 -27920040887322186 -8704274751914773568 -12085352355710699032 -6153353775713551670 -70123993 -27356081166223293 -7885152524183078888 -60227983 -2883701 -11700344903086704893 -7329667560521271617 -518980348 -5833854255738521265 -8618954206935976415 -3901910077209972079 -1713308683 -1992881785903908578 -4530582984922301900 -16130159995999161574 -155124341 -2625321602296121720 -1884114794138700522 -5778348218852443426 -97780251 -4240022615453076686 -6097847786116483627 -6361518319333476776 -30540122 -28484146776247610 -546636604 -5741055947585816645 -6100103891543657570 -8807886331112851129 -813564822 -10223260478367337870 -746324852 -15287423226215073909 -11226550812567014265 -1491796976 -8097653480026868144 -5995296157134227520 -1873618532029106835 -1539245050 -48300418 -331037869860 -95748625 -6314795724398267312 -5888081980883929307 -544604964 -34124418943289166 -5245848947242502849 -32432363517642192 -2676033356038407648 -811533196 -1317733333 -8920676095134336910 -17149817495305717193 -918014392040164136 -103612987 -8695136395555507435 -18349504802666319185 -14847634415788362123 -1584661506 -4287350266942457603 -525512494730316455 -5881302580997523790 -1574765567 -3784125305237867347 -819397570 -8326286517935867839 -16149105318148965958 -16580883 -6684847 -18411699902469439513 -11229983338076703492 -15292499491369977714 -339635406848 -9870724570940976 +5767329 +5250413516934022944 +97518103 +63111604 +579208034 +544801575 +17236251 +258081459 +17953567922355439196 +30458188512103543 +15287987228927658628 +4930631980557601532 +20305658202031811 +2120987217453057458 +6209987959894902621 +7151957518376504179 +12552846396214610071 +1793158821936040552 +5461104787107351969 +559088458 +14386655907412249373 +547619651 +2141783083 +12606726616442537392 +1923875870 +811402123 +570557265 +42991988 100 101 102 diff --git a/python/cudf/cudf/utils/hash_vocab_utils.py b/python/cudf/cudf/utils/hash_vocab_utils.py index 66c9dd5135f..83b59ec53ca 100644 --- a/python/cudf/cudf/utils/hash_vocab_utils.py +++ b/python/cudf/cudf/utils/hash_vocab_utils.py @@ -69,8 +69,7 @@ def _get_space_util(bins, init_bins): return sum(_new_bin_length(len(b)) for b in bins) + 2 * init_bins -def _pick_initial_a_b(data, max_constant, init_bins): - rng = np.random.default_rng(seed=0) +def _pick_initial_a_b(data, max_constant, init_bins, rng): while True: a = rng.integers(2**12, 2**15) b = rng.integers(2**12, 2**15) @@ -87,8 +86,7 @@ def _pick_initial_a_b(data, max_constant, init_bins): return bins, a, b -def _find_hash_for_internal(hash_bin): - rng = np.random.default_rng(seed=0) +def _find_hash_for_internal(hash_bin, rng): if not hash_bin: return [[], 0, 0] @@ -110,11 +108,11 @@ def _find_hash_for_internal(hash_bin): return bins, a, b -def _perfect_hash(integers, max_constant): +def _perfect_hash(integers, rng, max_constant): num_top_level_bins = len(integers) // 4 init_bins, init_a, init_b = _pick_initial_a_b( - integers, max_constant, num_top_level_bins + integers, max_constant, num_top_level_bins, rng ) flattened_bins = [] @@ -129,7 +127,7 @@ def _perfect_hash(integers, max_constant): for i, b in enumerate(init_bins): if i % 500 == 0: print(f"Processing bin {i} / {len(init_bins)} of size = {len(b)}") - internal_table, coeff_a, coeff_b = _find_hash_for_internal(b) + internal_table, coeff_a, coeff_b = _find_hash_for_internal(b, rng) bin_length = len(internal_table) max_bin_length = max(bin_length, max_bin_length) internal_table_coeffs[i] = ( @@ -247,7 +245,7 @@ def hash_vocab( """ Write the vocab vocabulary hashtable to the output_path """ - _ = np.random.default_rng(seed=0) + rng = np.random.default_rng(seed=1243342) vocab = _load_vocab_dict(vocab_path) keys = list(map(_sdbm_hash, vocab.keys())) @@ -266,7 +264,7 @@ def hash_vocab( hash_table, inner_table_coeffs, offsets_into_ht, - ) = _perfect_hash(keys, 10) + ) = _perfect_hash(keys, rng, 10) _pack_keys_and_values(hash_table, hashed_vocab) _store_func( From bc73f31fc7c771155a7779f6c97e8c3da1fcbe2c Mon Sep 17 00:00:00 2001 From: galipremsagar Date: Mon, 14 Oct 2024 19:18:30 +0000 Subject: [PATCH 13/21] update --- .pre-commit-config.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 88ecf4f287c..c983e6bc51e 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -101,6 +101,12 @@ repos: entry: 'default_rng\(\)' language: pygrep types: [python] + - id: no-np-random-seed + name: no-np-random-seed + description: 'Enforce that default_rng is used instead of np.random.seed' + entry: 'random.seed\(' + language: pygrep + types: [python] - id: cmake-format name: cmake-format entry: ./cpp/scripts/run-cmake-format.sh cmake-format From 0939ba1506412d8748adaaf865c7f34ad6f4b461 Mon Sep 17 00:00:00 2001 From: galipremsagar Date: Mon, 14 Oct 2024 19:22:44 +0000 Subject: [PATCH 14/21] update --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index c983e6bc51e..9dd64b0c959 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -104,7 +104,7 @@ repos: - id: no-np-random-seed name: no-np-random-seed description: 'Enforce that default_rng is used instead of np.random.seed' - entry: 'random.seed\(' + entry: '.random.seed\(' language: pygrep types: [python] - id: cmake-format From 8f4efb7079d1fef01482ef2ab94f40d2358001dd Mon Sep 17 00:00:00 2001 From: galipremsagar Date: Mon, 14 Oct 2024 19:22:56 +0000 Subject: [PATCH 15/21] update --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 9dd64b0c959..4aa196ec497 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -104,7 +104,7 @@ repos: - id: no-np-random-seed name: no-np-random-seed description: 'Enforce that default_rng is used instead of np.random.seed' - entry: '.random.seed\(' + entry: 'np.random.seed\(' language: pygrep types: [python] - id: cmake-format From de0813c8571e71b9806f856619c4ad47008cc4a8 Mon Sep 17 00:00:00 2001 From: galipremsagar Date: Mon, 14 Oct 2024 19:28:27 +0000 Subject: [PATCH 16/21] update notebook --- python/cudf/cudf_pandas_tests/data/repr_slow_down_test.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/cudf/cudf_pandas_tests/data/repr_slow_down_test.ipynb b/python/cudf/cudf_pandas_tests/data/repr_slow_down_test.ipynb index cc03574155e..94904fd83d4 100644 --- a/python/cudf/cudf_pandas_tests/data/repr_slow_down_test.ipynb +++ b/python/cudf/cudf_pandas_tests/data/repr_slow_down_test.ipynb @@ -18,7 +18,7 @@ "import numpy as np\n", "import pandas as pd\n", "\n", - "np.random.seed(0)\n", + "rng = np.random.default_rng(seed=0)\n", "\n", "num_rows = 25_000_000\n", "num_columns = 12\n", From 3158d9c8a42bee40a31feeb9fa94bda9fed16250 Mon Sep 17 00:00:00 2001 From: GALI PREM SAGAR Date: Tue, 15 Oct 2024 15:47:31 -0500 Subject: [PATCH 17/21] Apply suggestions from code review Co-authored-by: Charles Blackmon-Luca <20627856+charlesbluca@users.noreply.github.com> --- pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/pyproject.toml b/pyproject.toml index 0240992fe1a..661c68ee62e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -90,6 +90,7 @@ select = [ "UP007", # Import from `collections.abc` instead: `Callable` "UP035", + # usage of legacy `np.random` function calls "NPY002", ] ignore = [ From a02907b49c75767105a0411a85af2cf83754ae8e Mon Sep 17 00:00:00 2001 From: galipremsagar Date: Tue, 15 Oct 2024 20:49:48 +0000 Subject: [PATCH 18/21] address reviews --- python/cudf/cudf/testing/_utils.py | 2 +- python/cudf/cudf/testing/dataset_generator.py | 5 +- python/cudf/cudf/tests/test_binops.py | 4 +- python/cudf/cudf/tests/test_column.py | 2 +- python/cudf/cudf/tests/test_dataframe.py | 28 ++++++++-- python/cudf/cudf/tests/test_groupby.py | 2 +- python/cudf/cudf/tests/test_index.py | 56 +++++++++---------- python/cudf/cudf/tests/test_orc.py | 5 +- python/cudf/cudf/tests/test_rank.py | 23 ++++---- python/cudf/cudf/tests/test_reductions.py | 2 +- python/cudf/cudf/tests/test_reshape.py | 47 +++++++--------- python/cudf/cudf/tests/test_series.py | 18 +++--- 12 files changed, 101 insertions(+), 93 deletions(-) diff --git a/python/cudf/cudf/testing/_utils.py b/python/cudf/cudf/testing/_utils.py index 8a30b0ae6d6..a5dc8a5498c 100644 --- a/python/cudf/cudf/testing/_utils.py +++ b/python/cudf/cudf/testing/_utils.py @@ -210,7 +210,7 @@ def _get_args_kwars_for_assert_exceptions(func_args_and_kwargs): def gen_rand(dtype, size, **kwargs): - rng = np.random.default_rng(seed=0) + rng = np.random.default_rng(seed=kwargs.get("seed", 0)) dtype = cudf.dtype(dtype) if dtype.kind == "f": res = rng.random(size=size).astype(dtype) diff --git a/python/cudf/cudf/testing/dataset_generator.py b/python/cudf/cudf/testing/dataset_generator.py index 4cc5b00f63e..99b686406fb 100644 --- a/python/cudf/cudf/testing/dataset_generator.py +++ b/python/cudf/cudf/testing/dataset_generator.py @@ -55,8 +55,11 @@ def __init__( self.cardinality = cardinality self.null_frequency = null_frequency if generator is None: + rng = np.random.default_rng(seed=0) self.generator = lambda: [ - np.random.default_rng(seed=0).integers(0, 100) + _generate_string( + string.ascii_letters, rng, rng.integers(4, 8).item() + ) for _ in range(100) ] else: diff --git a/python/cudf/cudf/tests/test_binops.py b/python/cudf/cudf/tests/test_binops.py index 206374a83cd..949fa909b5b 100644 --- a/python/cudf/cudf/tests/test_binops.py +++ b/python/cudf/cudf/tests/test_binops.py @@ -588,7 +588,7 @@ def test_series_cmpop_mixed_dtype(cmpop, lhs_dtype, rhs_dtype, obj_class): ) def test_series_reflected_ops_scalar(func, dtype, obj_class): # create random series - random_series = utils.gen_rand(dtype, 100, low=10) + random_series = utils.gen_rand(dtype, 100, low=10, seed=12) # gpu series gs = Series(random_series) @@ -644,7 +644,7 @@ def test_series_reflected_ops_cudf_scalar(funcs, dtype, obj_class): cpu_func, gpu_func = funcs # create random series - random_series = utils.gen_rand(dtype, 100, low=10) + random_series = utils.gen_rand(dtype, 100, low=10, seed=12) # gpu series gs = Series(random_series) diff --git a/python/cudf/cudf/tests/test_column.py b/python/cudf/cudf/tests/test_column.py index c5b3191edd1..65947efc2df 100644 --- a/python/cudf/cudf/tests/test_column.py +++ b/python/cudf/cudf/tests/test_column.py @@ -31,7 +31,7 @@ @pytest.fixture(params=dtypes, ids=dtypes) def pandas_input(request): dtype = request.param - rng = np.random.default_rng(seed=None) + rng = np.random.default_rng(seed=0) size = 100 def random_ints(dtype, size): diff --git a/python/cudf/cudf/tests/test_dataframe.py b/python/cudf/cudf/tests/test_dataframe.py index b26e6b3e9b2..3b13ff569e3 100644 --- a/python/cudf/cudf/tests/test_dataframe.py +++ b/python/cudf/cudf/tests/test_dataframe.py @@ -63,9 +63,6 @@ pytest_xfail = pytest.mark.skipif -rng = np.random.default_rng(seed=0) - - @contextmanager def _hide_ufunc_warnings(eval_str): # pandas raises warnings for some inputs to the following ufuncs: @@ -1241,6 +1238,7 @@ def test_empty_dataframe_to_cupy(): df = cudf.DataFrame() nelem = 123 + rng = np.random.default_rng(seed=0) for k in "abc": df[k] = rng.random(nelem) @@ -1253,6 +1251,7 @@ def test_dataframe_to_cupy(): df = cudf.DataFrame() nelem = 123 + rng = np.random.default_rng(seed=0) for k in "abcd": df[k] = rng.random(nelem) @@ -1282,6 +1281,7 @@ def test_dataframe_to_cupy_null_values(): na = -10000 refvalues = {} + rng = np.random.default_rng(seed=0) for k in "abcd": df[k] = data = rng.random(nelem) bitmask = utils.random_bitmask(nelem) @@ -1324,6 +1324,7 @@ def test_dataframe_append_empty(): def test_dataframe_setitem_from_masked_object(): + rng = np.random.default_rng(seed=0) ary = rng.standard_normal(100) mask = np.zeros(100, dtype=bool) mask[:20] = True @@ -2225,7 +2226,7 @@ def test_dataframe_transpose(nulls, num_cols, num_rows, dtype): # against pandas nullable types as they are the ones that closely # resemble `cudf` dtypes behavior. pdf = pd.DataFrame() - + rng = np.random.default_rng(seed=0) null_rep = np.nan if dtype in ["float32", "float64"] else None np_dtype = dtype dtype = np.dtype(dtype) @@ -2709,6 +2710,7 @@ def test_iteritems(gdf): def test_quantile(q, numeric_only): ts = pd.date_range("2018-08-24", periods=5, freq="D") td = pd.to_timedelta(np.arange(5), unit="h") + rng = np.random.default_rng(seed=0) pdf = pd.DataFrame( {"date": ts, "delta": td, "val": rng.standard_normal(len(ts))} ) @@ -2847,6 +2849,7 @@ def test_cuda_array_interface(dtype): @pytest.mark.parametrize("nchunks", [1, 2, 5, 10]) @pytest.mark.parametrize("data_type", dtypes) def test_from_arrow_chunked_arrays(nelem, nchunks, data_type): + rng = np.random.default_rng(seed=0) np_list_data = [ rng.integers(0, 100, nelem).astype(data_type) for i in range(nchunks) ] @@ -4104,6 +4107,7 @@ def test_ndim(): ], ) def test_dataframe_round(decimals): + rng = np.random.default_rng(seed=0) gdf = cudf.DataFrame( { "floats": np.arange(0.5, 10.5, 1), @@ -5817,6 +5821,7 @@ def test_memory_usage(deep, index, set_index): @pytest_xfail def test_memory_usage_string(): rows = int(100) + rng = np.random.default_rng(seed=0) df = pd.DataFrame( { "A": np.arange(rows, dtype="int32"), @@ -5843,6 +5848,7 @@ def test_memory_usage_string(): def test_memory_usage_cat(): rows = int(100) + rng = np.random.default_rng(seed=0) df = pd.DataFrame( { "A": np.arange(rows, dtype="int32"), @@ -5876,6 +5882,7 @@ def test_memory_usage_list(): def test_memory_usage_multi(rows): # We need to sample without replacement to guarantee that the size of the # levels are always the same. + rng = np.random.default_rng(seed=0) df = pd.DataFrame( { "A": np.arange(rows, dtype="int32"), @@ -6704,8 +6711,16 @@ def test_dataframe_init_1d_list(data, columns): (cupy.array([11, 123, -2342, 232]), ["z"], [0, 1, 1, 0]), (cupy.array([11, 123, -2342, 232]), ["z"], [1, 2, 3, 4]), (cupy.array([11, 123, -2342, 232]), ["z"], ["a", "z", "d", "e"]), - (rng.standard_normal(size=(2, 4)), ["a", "b", "c", "d"], ["a", "b"]), - (rng.standard_normal(size=(2, 4)), ["a", "b", "c", "d"], [1, 0]), + ( + np.random.default_rng(seed=0).standard_normal(size=(2, 4)), + ["a", "b", "c", "d"], + ["a", "b"], + ), + ( + np.random.default_rng(seed=0).standard_normal(size=(2, 4)), + ["a", "b", "c", "d"], + [1, 0], + ), (cupy.random.randn(2, 4), ["a", "b", "c", "d"], ["a", "b"]), (cupy.random.randn(2, 4), ["a", "b", "c", "d"], [1, 0]), ], @@ -6879,6 +6894,7 @@ def test_dataframe_info_basic(): memory usage: 859.0+ bytes """ ) + rng = np.random.default_rng(seed=0) df = pd.DataFrame( rng.standard_normal(size=(10, 10)), index=["a", "2", "3", "4", "5", "6", "7", "8", "100", "1111"], diff --git a/python/cudf/cudf/tests/test_groupby.py b/python/cudf/cudf/tests/test_groupby.py index 6b9fad8e0b7..6b222841622 100644 --- a/python/cudf/cudf/tests/test_groupby.py +++ b/python/cudf/cudf/tests/test_groupby.py @@ -1323,7 +1323,7 @@ def test_empty_groupby(func): def test_groupby_unsupported_columns(): - rng = np.random.default_rng(seed=0) + rng = np.random.default_rng(seed=12) pd_cat = pd.Categorical( pd.Series(rng.choice(["a", "b", 1], 3), dtype="category") ) diff --git a/python/cudf/cudf/tests/test_index.py b/python/cudf/cudf/tests/test_index.py index 40dbf7a1813..24d42d9eb4c 100644 --- a/python/cudf/cudf/tests/test_index.py +++ b/python/cudf/cudf/tests/test_index.py @@ -2645,23 +2645,20 @@ def test_isin_multiindex(data, values, level, err): ) -rng = np.random.default_rng(seed=0) - -range_data = [ - range(rng.integers(0, 100)), - range(9, 12, 2), - range(20, 30), - range(100, 1000, 10), - range(0, 10, -2), - range(0, -10, 2), - range(0, -10, -2), -] - - -@pytest.fixture(params=range_data) +@pytest.fixture( + params=[ + range(np.random.default_rng(seed=0).integers(0, 100)), + range(9, 12, 2), + range(20, 30), + range(100, 1000, 10), + range(0, 10, -2), + range(0, -10, 2), + range(0, -10, -2), + ] +) def rangeindex(request): """Create a cudf RangeIndex of different `nrows`""" - return RangeIndex(request.param) + return cudf.RangeIndex(request.param) @pytest.mark.parametrize( @@ -2832,21 +2829,20 @@ def test_rangeindex_append_return_rangeindex(): assert_eq(result, expected) -index_data = [ - range(rng.integers(0, 100)), - range(0, 10, -2), - range(0, -10, 2), - range(0, -10, -2), - range(0, 1), - [1, 2, 3, 1, None, None], - [None, None, 3.2, 1, None, None], - [None, "a", "3.2", "z", None, None], - pd.Series(["a", "b", None], dtype="category"), - np.array([1, 2, 3, None], dtype="datetime64[s]"), -] - - -@pytest.fixture(params=index_data) +@pytest.fixture( + params=[ + range(np.random.default_rng(seed=0).integers(0, 100)), + range(0, 10, -2), + range(0, -10, 2), + range(0, -10, -2), + range(0, 1), + [1, 2, 3, 1, None, None], + [None, None, 3.2, 1, None, None], + [None, "a", "3.2", "z", None, None], + pd.Series(["a", "b", None], dtype="category"), + np.array([1, 2, 3, None], dtype="datetime64[s]"), + ] +) def index(request): """Create a cudf Index of different dtypes""" return cudf.Index(request.param) diff --git a/python/cudf/cudf/tests/test_orc.py b/python/cudf/cudf/tests/test_orc.py index a259209bed9..41c1c3ccb20 100644 --- a/python/cudf/cudf/tests/test_orc.py +++ b/python/cudf/cudf/tests/test_orc.py @@ -703,6 +703,7 @@ def test_orc_chunked_write_statistics(tmpdir, datadir, nrows, stats_freq): has_nulls=True, low=0, high=max_char_length, + seed=0, ) for dtype in supported_stat_types } @@ -985,7 +986,7 @@ def test_orc_string_stream_offset_issue(): def generate_list_struct_buff(size=100_000): rd = random.Random(1) - rng = np.random.default_rng(seed=0) + rng = np.random.default_rng(seed=1) buff = BytesIO() @@ -1132,7 +1133,7 @@ def gen_map_buff(size): from pyarrow import orc rd = random.Random(1) - rng = np.random.default_rng(seed=0) + rng = np.random.default_rng(seed=1) buff = BytesIO() diff --git a/python/cudf/cudf/tests/test_rank.py b/python/cudf/cudf/tests/test_rank.py index 4e33f91b09b..1d9c6690f14 100644 --- a/python/cudf/cudf/tests/test_rank.py +++ b/python/cudf/cudf/tests/test_rank.py @@ -125,24 +125,21 @@ def test_rank_error_arguments(pdf): ) -rng = np.random.default_rng(seed=0) - -sort_group_args = [ - np.full((3,), np.nan), - 100 * rng.random(10), - np.full((3,), np.inf), - np.full((3,), -np.inf), -] -sort_dtype_args = [np.int32, np.int64, np.float32, np.float64] - - @pytest.mark.filterwarnings("ignore:invalid value encountered in cast") @pytest.mark.parametrize( "elem,dtype", list( product( - combinations_with_replacement(sort_group_args, 4), - sort_dtype_args, + combinations_with_replacement( + [ + np.full((3,), np.nan), + 100 * np.random.default_rng(seed=0).random(10), + np.full((3,), np.inf), + np.full((3,), -np.inf), + ], + 4, + ), + [np.int32, np.int64, np.float32, np.float64], ) ), ) diff --git a/python/cudf/cudf/tests/test_reductions.py b/python/cudf/cudf/tests/test_reductions.py index 7513bef69da..e0bc8f32c9b 100644 --- a/python/cudf/cudf/tests/test_reductions.py +++ b/python/cudf/cudf/tests/test_reductions.py @@ -62,7 +62,7 @@ def test_sum_string(): ) @pytest.mark.parametrize("nelem", params_sizes) def test_sum_decimal(dtype, nelem): - data = [str(x) for x in gen_rand("int64", nelem) / 100] + data = [str(x) for x in gen_rand("int64", nelem, seed=0) / 100] expected = pd.Series([Decimal(x) for x in data]).sum() got = cudf.Series(data).astype(dtype).sum() diff --git a/python/cudf/cudf/tests/test_reshape.py b/python/cudf/cudf/tests/test_reshape.py index 0b4e5c83569..26386abb05d 100644 --- a/python/cudf/cudf/tests/test_reshape.py +++ b/python/cudf/cudf/tests/test_reshape.py @@ -35,9 +35,6 @@ pytest_xfail = pytest.mark.skipif -rng = np.random.default_rng(seed=0) - - @pytest.mark.parametrize("num_id_vars", [0, 1, 2]) @pytest.mark.parametrize("num_value_vars", [0, 1, 2]) @pytest.mark.parametrize("num_rows", [1, 2, 100]) @@ -49,6 +46,7 @@ def test_melt(nulls, num_id_vars, num_value_vars, num_rows, dtype): pdf = pd.DataFrame() id_vars = [] + rng = np.random.default_rng(seed=0) for i in range(num_id_vars): colname = "id" + str(i) data = rng.integers(0, 26, num_rows).astype(dtype) @@ -138,6 +136,7 @@ def test_df_stack(nulls, num_cols, num_rows, dtype): pytest.skip(reason="nulls not supported in dtype: " + dtype) pdf = pd.DataFrame() + rng = np.random.default_rng(seed=0) for i in range(num_cols): colname = str(i) data = rng.integers(0, 26, num_rows).astype(dtype) @@ -277,7 +276,7 @@ def test_df_stack_multiindex_column_axis_pd_example(level): ], names=["exp", "animal", "hair_length"], ) - + rng = np.random.default_rng(seed=0) df = pd.DataFrame(rng.standard_normal(size=(4, 4)), columns=columns) with expect_warning_if(PANDAS_GE_220, FutureWarning): @@ -305,6 +304,7 @@ def test_interleave_columns(nulls, num_cols, num_rows, dtype): pytest.skip(reason="nulls not supported in dtype: " + dtype) pdf = pd.DataFrame(dtype=dtype) + rng = np.random.default_rng(seed=0) for i in range(num_cols): colname = str(i) data = pd.Series(rng.integers(0, 26, num_rows)).astype(dtype) @@ -339,6 +339,7 @@ def test_tile(nulls, num_cols, num_rows, dtype, count): pytest.skip(reason="nulls not supported in dtype: " + dtype) pdf = pd.DataFrame(dtype=dtype) + rng = np.random.default_rng(seed=0) for i in range(num_cols): colname = str(i) data = pd.Series(rng.integers(num_cols, 26, num_rows)).astype(dtype) @@ -715,8 +716,12 @@ def test_pivot_duplicate_error(): @pytest.mark.parametrize( - "data", - [ + "aggfunc", ["mean", "count", {"D": "sum", "E": "count"}] +) +@pytest.mark.parametrize("fill_value", [0]) +def test_pivot_table_simple(aggfunc, fill_value): + rng = np.random.default_rng(seed=0) + pdf = pd.DataFrame( { "A": ["one", "one", "two", "three"] * 6, "B": ["A", "B", "C"] * 8, @@ -724,14 +729,7 @@ def test_pivot_duplicate_error(): "D": rng.standard_normal(size=24), "E": rng.standard_normal(size=24), } - ], -) -@pytest.mark.parametrize( - "aggfunc", ["mean", "count", {"D": "sum", "E": "count"}] -) -@pytest.mark.parametrize("fill_value", [0]) -def test_pivot_table_simple(data, aggfunc, fill_value): - pdf = pd.DataFrame(data) + ) expected = pd.pivot_table( pdf, values=["D", "E"], @@ -740,7 +738,7 @@ def test_pivot_table_simple(data, aggfunc, fill_value): aggfunc=aggfunc, fill_value=fill_value, ) - cdf = cudf.DataFrame(data) + cdf = cudf.DataFrame.from_pandas(pdf) actual = cudf.pivot_table( cdf, values=["D", "E"], @@ -753,8 +751,12 @@ def test_pivot_table_simple(data, aggfunc, fill_value): @pytest.mark.parametrize( - "data", - [ + "aggfunc", ["mean", "count", {"D": "sum", "E": "count"}] +) +@pytest.mark.parametrize("fill_value", [0]) +def test_dataframe_pivot_table_simple(aggfunc, fill_value): + rng = np.random.default_rng(seed=0) + pdf = pd.DataFrame( { "A": ["one", "one", "two", "three"] * 6, "B": ["A", "B", "C"] * 8, @@ -762,14 +764,7 @@ def test_pivot_table_simple(data, aggfunc, fill_value): "D": rng.standard_normal(size=24), "E": rng.standard_normal(size=24), } - ], -) -@pytest.mark.parametrize( - "aggfunc", ["mean", "count", {"D": "sum", "E": "count"}] -) -@pytest.mark.parametrize("fill_value", [0]) -def test_dataframe_pivot_table_simple(data, aggfunc, fill_value): - pdf = pd.DataFrame(data) + ) expected = pdf.pivot_table( values=["D", "E"], index=["A", "B"], @@ -777,7 +772,7 @@ def test_dataframe_pivot_table_simple(data, aggfunc, fill_value): aggfunc=aggfunc, fill_value=fill_value, ) - cdf = cudf.DataFrame(data) + cdf = cudf.DataFrame.from_pandas(pdf) actual = cdf.pivot_table( values=["D", "E"], index=["A", "B"], diff --git a/python/cudf/cudf/tests/test_series.py b/python/cudf/cudf/tests/test_series.py index e7e45c574cc..7f0a4902ed1 100644 --- a/python/cudf/cudf/tests/test_series.py +++ b/python/cudf/cudf/tests/test_series.py @@ -27,8 +27,6 @@ gen_rand, ) -rng = np.random.default_rng(seed=0) - def _series_na_data(): return [ @@ -521,7 +519,7 @@ def test_series_factorize_sort(data, sort): @pytest.mark.parametrize("nulls", ["none", "some"]) def test_series_datetime_value_counts(data, nulls, normalize, dropna): psr = data.copy() - + rng = np.random.default_rng(seed=0) if len(data) > 0: if nulls == "one": p = rng.integers(0, len(data)) @@ -548,7 +546,7 @@ def test_series_datetime_value_counts(data, nulls, normalize, dropna): @pytest.mark.parametrize("num_elements", [10, 100, 1000]) def test_categorical_value_counts(dropna, normalize, num_elements): # create categorical series - rng = np.random.default_rng(seed=0) + rng = np.random.default_rng(seed=12) pd_cat = pd.Categorical( pd.Series( rng.choice(list(ascii_letters + digits), num_elements), @@ -588,6 +586,7 @@ def test_categorical_value_counts(dropna, normalize, num_elements): @pytest.mark.parametrize("dropna", [True, False]) @pytest.mark.parametrize("normalize", [True, False]) def test_series_value_counts(dropna, normalize): + rng = np.random.default_rng(seed=0) for size in [10**x for x in range(5)]: arr = rng.integers(low=-1, high=10, size=size) mask = arr != -1 @@ -716,8 +715,8 @@ def test_series_mode(gs, dropna): @pytest.mark.parametrize( "arr", [ - rng.normal(-100, 100, 1000), - rng.integers(-50, 50, 1000), + np.random.default_rng(seed=0).normal(-100, 100, 1000), + np.random.default_rng(seed=0).integers(-50, 50, 1000), np.zeros(100), np.repeat([-0.6459412758761901], 100), np.repeat(np.nan, 100), @@ -733,7 +732,7 @@ def test_series_round(arr, decimals): expected = pser.round(decimals) assert_eq(result, expected) - + rng = np.random.default_rng(seed=0) # with nulls, maintaining existing null mask arr = arr.astype("float64") # for pandas nulls arr.ravel()[rng.choice(arr.shape[0], arr.shape[0] // 2, replace=False)] = ( @@ -1728,7 +1727,7 @@ def test_series_truncate_datetimeindex(): [], [0, 12, 14], [0, 14, 12, 12, 3, 10, 12, 14], - rng.integers(-100, 100, 200), + np.random.default_rng(seed=0).integers(-100, 100, 200), pd.Series([0.0, 1.0, None, 10.0]), [None, None, None, None], [np.nan, None, -1, 2, 3], @@ -1737,7 +1736,7 @@ def test_series_truncate_datetimeindex(): @pytest.mark.parametrize( "values", [ - rng.integers(-100, 100, 10), + np.random.default_rng(seed=0).integers(-100, 100, 10), [], [np.nan, None, -1, 2, 3], [1.0, 12.0, None, None, 120], @@ -1748,6 +1747,7 @@ def test_series_truncate_datetimeindex(): ], ) def test_isin_numeric(data, values): + rng = np.random.default_rng(seed=0) index = rng.integers(0, 100, len(data)) psr = pd.Series(data, index=index) gsr = cudf.Series.from_pandas(psr, nan_as_null=False) From 4a9e9442d0c35ed73739db4903f4f89da66a23dd Mon Sep 17 00:00:00 2001 From: galipremsagar Date: Tue, 15 Oct 2024 20:53:55 +0000 Subject: [PATCH 19/21] merge into one --- .pre-commit-config.yaml | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 4aa196ec497..0f87220b089 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -95,16 +95,15 @@ repos: entry: 'pytest\.xfail' language: pygrep types: [python] - - id: no-unseeded-default-rng - name: no-unseeded-default-rng - description: 'Enforce that no non-seeded default_rng is used' - entry: 'default_rng\(\)' - language: pygrep - types: [python] - - id: no-np-random-seed - name: no-np-random-seed - description: 'Enforce that default_rng is used instead of np.random.seed' - entry: 'np.random.seed\(' + - id: use-only-default-rng + name: use-only-default-rng + description: 'Enforce that `default_rng` is used instead of `np.random.seed` and it must be seeded.' + entry: | + (?x) + # no unseeded default_rng + |default_rng\(\) + # no np.random.seed + |np.random.seed\( language: pygrep types: [python] - id: cmake-format From b8f964b0a304af6a84dd61ca6d3e918e47b43ecf Mon Sep 17 00:00:00 2001 From: galipremsagar Date: Tue, 15 Oct 2024 21:12:02 +0000 Subject: [PATCH 20/21] address reviews --- .pre-commit-config.yaml | 15 ++++----- python/cudf/cudf/tests/test_categorical.py | 2 +- python/cudf/cudf/tests/test_dataframe.py | 10 +++--- python/cudf/cudf/tests/test_stats.py | 32 +++++++++---------- python/cudf/cudf/tests/test_string.py | 12 +++++-- python/cudf/cudf/utils/hash_vocab_utils.py | 4 +-- .../cudf_pandas_tests/test_cudf_pandas.py | 2 +- .../cudf/cudf_pandas_tests/test_profiler.py | 2 +- .../tests/test_stumpy_distributed.py | 4 +-- 9 files changed, 44 insertions(+), 39 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 0f87220b089..174dc72bf02 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -95,15 +95,14 @@ repos: entry: 'pytest\.xfail' language: pygrep types: [python] - - id: use-only-default-rng - name: use-only-default-rng - description: 'Enforce that `default_rng` is used instead of `np.random.seed` and it must be seeded.' + - id: no-unseeded-default-rng + name: no-unseeded-default-rng + description: 'Enforce that no non-seeded default_rng is used and default_rng is used instead of np.random.seed' entry: | - (?x) - # no unseeded default_rng - |default_rng\(\) - # no np.random.seed - |np.random.seed\( + # Check for usage of default_rng without seeding + default_rng\(\)| + # Check for usage of np.random.seed + np.random.seed\( language: pygrep types: [python] - id: cmake-format diff --git a/python/cudf/cudf/tests/test_categorical.py b/python/cudf/cudf/tests/test_categorical.py index 7d6c6c7d7b0..db41f689255 100644 --- a/python/cudf/cudf/tests/test_categorical.py +++ b/python/cudf/cudf/tests/test_categorical.py @@ -252,7 +252,7 @@ def test_cat_series_binop_error(): @pytest.mark.parametrize("num_elements", [10, 100, 1000]) def test_categorical_unique(num_elements): # create categorical series - rng = np.random.default_rng(seed=0) + rng = np.random.default_rng(seed=12) pd_cat = pd.Categorical( pd.Series( rng.choice( diff --git a/python/cudf/cudf/tests/test_dataframe.py b/python/cudf/cudf/tests/test_dataframe.py index 3b13ff569e3..7c3547c59d6 100644 --- a/python/cudf/cudf/tests/test_dataframe.py +++ b/python/cudf/cudf/tests/test_dataframe.py @@ -3903,7 +3903,7 @@ def test_select_dtype_datetime_with_frequency(): def test_dataframe_describe_exclude(): - rng = np.random.default_rng(seed=0) + rng = np.random.default_rng(seed=12) data_length = 10000 df = cudf.DataFrame() @@ -3919,7 +3919,7 @@ def test_dataframe_describe_exclude(): def test_dataframe_describe_include(): - rng = np.random.default_rng(seed=0) + rng = np.random.default_rng(seed=12) data_length = 10000 df = cudf.DataFrame() @@ -3934,7 +3934,7 @@ def test_dataframe_describe_include(): def test_dataframe_describe_default(): - rng = np.random.default_rng(seed=0) + rng = np.random.default_rng(seed=12) data_length = 10000 df = cudf.DataFrame() @@ -3948,7 +3948,7 @@ def test_dataframe_describe_default(): def test_series_describe_include_all(): - rng = np.random.default_rng(seed=0) + rng = np.random.default_rng(seed=12) data_length = 10000 df = cudf.DataFrame() @@ -3971,7 +3971,7 @@ def test_series_describe_include_all(): def test_dataframe_describe_percentiles(): - rng = np.random.default_rng(seed=0) + rng = np.random.default_rng(seed=12) data_length = 10000 sample_percentiles = [0.0, 0.1, 0.33, 0.84, 0.4, 0.99] diff --git a/python/cudf/cudf/tests/test_stats.py b/python/cudf/cudf/tests/test_stats.py index a4ff042e37c..27de0ed42e5 100644 --- a/python/cudf/cudf/tests/test_stats.py +++ b/python/cudf/cudf/tests/test_stats.py @@ -19,8 +19,6 @@ interpolation_methods = ["linear", "lower", "higher", "midpoint", "nearest"] -rng = np.random.default_rng(seed=0) - @pytest.mark.parametrize("method", methods) @pytest.mark.parametrize("dtype", params_dtypes) @@ -86,6 +84,7 @@ def test_series_std(ddof): def test_series_unique(): + rng = np.random.default_rng(seed=0) for size in [10**x for x in range(5)]: arr = rng.integers(low=-1, high=10, size=size) mask = arr != -1 @@ -131,6 +130,7 @@ def test_series_nunique(nan_as_null, dropna): def test_series_scale(): + rng = np.random.default_rng(seed=0) arr = pd.Series(rng.integers(low=-10, high=10, size=100)) sr = cudf.Series(arr) @@ -231,8 +231,8 @@ def test_misc_quantiles(data, q): @pytest.mark.parametrize( "data", [ - {"data": rng.normal(-100, 100, 1000)}, - {"data": rng.integers(-50, 50, 1000)}, + {"data": np.random.default_rng(seed=0).normal(-100, 100, 1000)}, + {"data": np.random.default_rng(seed=0).integers(-50, 50, 1000)}, {"data": (np.zeros(100))}, {"data": np.repeat(np.nan, 100)}, {"data": np.array([1.123, 2.343, np.nan, 0.0])}, @@ -282,8 +282,8 @@ def test_kurt_skew_error(op): @pytest.mark.parametrize( "data", [ - cudf.Series(rng.normal(-100, 100, 1000)), - cudf.Series(rng.integers(-50, 50, 1000)), + cudf.Series(np.random.default_rng(seed=0).normal(-100, 100, 1000)), + cudf.Series(np.random.default_rng(seed=0).integers(-50, 50, 1000)), cudf.Series(np.zeros(100)), cudf.Series(np.repeat(np.nan, 100)), cudf.Series(np.array([1.123, 2.343, np.nan, 0.0])), @@ -346,8 +346,8 @@ def test_series_median(dtype, num_na): @pytest.mark.parametrize( "data", [ - rng.normal(-100, 100, 1000), - rng.integers(-50, 50, 1000), + np.random.default_rng(seed=0).normal(-100, 100, 1000), + np.random.default_rng(seed=0).integers(-50, 50, 1000), np.zeros(100), np.array([1.123, 2.343, np.nan, 0.0]), np.array([-2, 3.75, 6, None, None, None, -8.5, None, 4.2]), @@ -381,8 +381,8 @@ def test_series_pct_change(data, periods, fill_method): @pytest.mark.parametrize( "data1", [ - rng.normal(-100, 100, 1000), - rng.integers(-50, 50, 1000), + np.random.default_rng(seed=0).normal(-100, 100, 1000), + np.random.default_rng(seed=0).integers(-50, 50, 1000), np.zeros(100), np.repeat(np.nan, 100), np.array([1.123, 2.343, np.nan, 0.0]), @@ -395,8 +395,8 @@ def test_series_pct_change(data, periods, fill_method): @pytest.mark.parametrize( "data2", [ - rng.normal(-100, 100, 1000), - rng.integers(-50, 50, 1000), + np.random.default_rng(seed=0).normal(-100, 100, 1000), + np.random.default_rng(seed=0).integers(-50, 50, 1000), np.zeros(100), np.repeat(np.nan, 100), np.array([1.123, 2.343, np.nan, 0.0]), @@ -425,8 +425,8 @@ def test_cov1d(data1, data2): @pytest.mark.parametrize( "data1", [ - rng.normal(-100, 100, 1000), - rng.integers(-50, 50, 1000), + np.random.default_rng(seed=0).normal(-100, 100, 1000), + np.random.default_rng(seed=0).integers(-50, 50, 1000), np.zeros(100), np.repeat(np.nan, 100), np.array([1.123, 2.343, np.nan, 0.0]), @@ -439,8 +439,8 @@ def test_cov1d(data1, data2): @pytest.mark.parametrize( "data2", [ - rng.normal(-100, 100, 1000), - rng.integers(-50, 50, 1000), + np.random.default_rng(seed=0).normal(-100, 100, 1000), + np.random.default_rng(seed=0).integers(-50, 50, 1000), np.zeros(100), np.repeat(np.nan, 100), np.array([1.123, 2.343, np.nan, 0.0]), diff --git a/python/cudf/cudf/tests/test_string.py b/python/cudf/cudf/tests/test_string.py index 02e2ee96aca..e25f99d7bee 100644 --- a/python/cudf/cudf/tests/test_string.py +++ b/python/cudf/cudf/tests/test_string.py @@ -133,9 +133,14 @@ def test_string_get_item(ps_gs, item): np.array([False] * 5), cupy.asarray(np.array([True] * 5)), cupy.asarray(np.array([False] * 5)), - rng.integers(0, 2, 5).astype("bool").tolist(), - rng.integers(0, 2, 5).astype("bool"), - cupy.asarray(rng.integers(0, 2, 5).astype("bool")), + np.random.default_rng(seed=0) + .integers(0, 2, 5) + .astype("bool") + .tolist(), + np.random.default_rng(seed=0).integers(0, 2, 5).astype("bool"), + cupy.asarray( + np.random.default_rng(seed=0).integers(0, 2, 5).astype("bool") + ), ], ) def test_string_bool_mask(ps_gs, item): @@ -1079,6 +1084,7 @@ def test_string_set_scalar(scalar): def test_string_index(): + rng = np.random.default_rng(seed=0) pdf = pd.DataFrame(rng.random(size=(5, 5))) gdf = cudf.DataFrame.from_pandas(pdf) stringIndex = ["a", "b", "c", "d", "e"] diff --git a/python/cudf/cudf/utils/hash_vocab_utils.py b/python/cudf/cudf/utils/hash_vocab_utils.py index 83b59ec53ca..896a3809c67 100644 --- a/python/cudf/cudf/utils/hash_vocab_utils.py +++ b/python/cudf/cudf/utils/hash_vocab_utils.py @@ -108,7 +108,7 @@ def _find_hash_for_internal(hash_bin, rng): return bins, a, b -def _perfect_hash(integers, rng, max_constant): +def _perfect_hash(integers, max_constant, rng): num_top_level_bins = len(integers) // 4 init_bins, init_a, init_b = _pick_initial_a_b( @@ -264,7 +264,7 @@ def hash_vocab( hash_table, inner_table_coeffs, offsets_into_ht, - ) = _perfect_hash(keys, rng, 10) + ) = _perfect_hash(keys, 10, rng) _pack_keys_and_values(hash_table, hashed_vocab) _store_func( diff --git a/python/cudf/cudf_pandas_tests/test_cudf_pandas.py b/python/cudf/cudf_pandas_tests/test_cudf_pandas.py index 693bd0c8d22..7aefdc386bb 100644 --- a/python/cudf/cudf_pandas_tests/test_cudf_pandas.py +++ b/python/cudf/cudf_pandas_tests/test_cudf_pandas.py @@ -1142,7 +1142,7 @@ def test_private_method_result_wrapped(): def test_numpy_var(): - rng = np.random.default_rng(seed=0) + rng = np.random.default_rng(seed=42) data = rng.random(1000) psr = pd.Series(data) sr = xpd.Series(data) diff --git a/python/cudf/cudf_pandas_tests/test_profiler.py b/python/cudf/cudf_pandas_tests/test_profiler.py index b20c3fff346..a5c29bd93a2 100644 --- a/python/cudf/cudf_pandas_tests/test_profiler.py +++ b/python/cudf/cudf_pandas_tests/test_profiler.py @@ -23,7 +23,7 @@ reason="function names change across versions of pandas, so making sure it only runs on latest version of pandas", ) def test_profiler(): - rng = np.random.default_rng(seed=0) + rng = np.random.default_rng(seed=42) with Profiler() as profiler: df = pd.DataFrame( { diff --git a/python/cudf/cudf_pandas_tests/third_party_integration_tests/tests/test_stumpy_distributed.py b/python/cudf/cudf_pandas_tests/third_party_integration_tests/tests/test_stumpy_distributed.py index a81d1d01aa2..0777d982ac2 100644 --- a/python/cudf/cudf_pandas_tests/third_party_integration_tests/tests/test_stumpy_distributed.py +++ b/python/cudf/cudf_pandas_tests/third_party_integration_tests/tests/test_stumpy_distributed.py @@ -31,14 +31,14 @@ def dask_client(): def test_1d_distributed(dask_client): - rng = np.random.default_rng(seed=0) + rng = np.random.default_rng(seed=42) ts = pd.Series(rng.random(100)) m = 10 return stumpy.stumped(dask_client, ts, m) def test_multidimensional_distributed_timeseries(dask_client): - rng = np.random.default_rng(seed=0) + rng = np.random.default_rng(seed=42) # Each row represents data from a different dimension while each column represents # data from the same dimension your_time_series = rng.random(3, 1000) From 2350a4663f0acb851969a2cf8cf54b784505a6d0 Mon Sep 17 00:00:00 2001 From: galipremsagar Date: Wed, 16 Oct 2024 20:44:19 +0000 Subject: [PATCH 21/21] fix struct data type corruption --- python/cudf/cudf/core/column/struct.py | 7 +------ python/cudf/cudf/tests/test_struct.py | 12 ++++++++---- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/python/cudf/cudf/core/column/struct.py b/python/cudf/cudf/core/column/struct.py index 2fda3b2c434..8f16ba4e15b 100644 --- a/python/cudf/cudf/core/column/struct.py +++ b/python/cudf/cudf/core/column/struct.py @@ -68,12 +68,7 @@ def base_size(self): return self.size + self.offset def to_arrow(self) -> pa.Array: - children = [ - pa.nulls(len(child)) - if len(child) == child.null_count - else child.to_arrow() - for child in self.children - ] + children = [child.to_arrow() for child in self.children] pa_type = pa.struct( { diff --git a/python/cudf/cudf/tests/test_struct.py b/python/cudf/cudf/tests/test_struct.py index e91edc9eec6..899d78c999b 100644 --- a/python/cudf/cudf/tests/test_struct.py +++ b/python/cudf/cudf/tests/test_struct.py @@ -50,10 +50,14 @@ def test_struct_for_field(key, expect): assert_eq(expect, got) -@pytest.mark.parametrize("input_obj", [[{"a": 1, "b": cudf.NA, "c": 3}]]) -def test_series_construction_with_nulls(input_obj): - expect = pa.array(input_obj, from_pandas=True) - got = cudf.Series(input_obj).to_arrow() +def test_series_construction_with_nulls(): + fields = [ + pa.array([1], type=pa.int64()), + pa.array([None], type=pa.int64()), + pa.array([3], type=pa.int64()), + ] + expect = pa.StructArray.from_arrays(fields, ["a", "b", "c"]) + got = cudf.Series(expect).to_arrow() assert expect == got