repo_id stringlengths 21 96 | file_path stringlengths 31 155 | content stringlengths 1 92.9M | __index_level_0__ int64 0 0 |
|---|---|---|---|
rapidsai_public_repos/cudf/python/cudf/cudf | rapidsai_public_repos/cudf/python/cudf/cudf/tests/test_udf_masked_ops.py | # Copyright (c) 2021-2023, NVIDIA CORPORATION.
import math
import operator
import numpy as np
import pytest
from numba import cuda
import cudf
from cudf.core.missing import NA
from cudf.core.udf._ops import (
arith_ops,
bitwise_ops,
comparison_ops,
unary_ops,
)
from cudf.core.udf.api import Masked
fro... | 0 |
rapidsai_public_repos/cudf/python/cudf/cudf | rapidsai_public_repos/cudf/python/cudf/cudf/tests/test_pack.py | # Copyright (c) 2021-2023, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agre... | 0 |
rapidsai_public_repos/cudf/python/cudf/cudf | rapidsai_public_repos/cudf/python/cudf/cudf/tests/test_apply_rows.py | # Copyright (c) 2019-2022, NVIDIA CORPORATION.
import pytest
import cudf
from cudf.core.column import column
from cudf.testing._utils import assert_eq, gen_rand_series
def _kernel_multiply(a, b, out):
for i, (x, y) in enumerate(zip(a, b)):
out[i] = x * y
@pytest.mark.parametrize("dtype", ["float32", "... | 0 |
rapidsai_public_repos/cudf/python/cudf/cudf | rapidsai_public_repos/cudf/python/cudf/cudf/tests/test_doctests.py | # Copyright (c) 2022-2023, NVIDIA CORPORATION.
import contextlib
import doctest
import inspect
import io
import itertools
import os
import numpy as np
import pytest
import cudf
pytestmark = pytest.mark.filterwarnings("ignore::FutureWarning")
# modules that will be searched for doctests
tests = [cudf, cudf.core.grou... | 0 |
rapidsai_public_repos/cudf/python/cudf/cudf | rapidsai_public_repos/cudf/python/cudf/cudf/tests/test_cut.py | # Copyright (c) 2021-2022, NVIDIA CORPORATION.
"""
Test related to Cut
"""
import numpy as np
import pandas as pd
import pytest
from cudf.core.cut import cut
from cudf.testing._utils import assert_eq
@pytest.mark.parametrize(
"x", [[1, 7, 5, 4, 6, 3], [1, 7], np.array([1, 7, 5, 4, 6, 3])]
)
@pytest.mark.parame... | 0 |
rapidsai_public_repos/cudf/python/cudf/cudf | rapidsai_public_repos/cudf/python/cudf/cudf/tests/test_rolling.py | # Copyright (c) 2021-2023, NVIDIA CORPORATION.
import math
from contextlib import contextmanager
import numpy as np
import pandas as pd
import pytest
import cudf
from cudf.core._compat import PANDAS_GE_150
from cudf.testing._utils import (
_create_pandas_series_float64_default,
assert_eq,
)
from cudf.testing... | 0 |
rapidsai_public_repos/cudf/python/cudf/cudf | rapidsai_public_repos/cudf/python/cudf/cudf/tests/test_api_types.py | # Copyright (c) 2018-2023, NVIDIA CORPORATION.
import numpy as np
import pandas as pd
import pytest
from pandas.api import types as pd_types
import cudf
from cudf.api import types
@pytest.mark.parametrize(
"obj, expect",
(
# Base Python objects.
(bool(), False),
(int(), False),
... | 0 |
rapidsai_public_repos/cudf/python/cudf/cudf | rapidsai_public_repos/cudf/python/cudf/cudf/tests/test_unaops.py | # Copyright (c) 2019-2023, NVIDIA CORPORATION.
import itertools
import operator
import re
import numpy as np
import pandas as pd
import pytest
import cudf
from cudf import Series
from cudf.testing import _utils as utils
_unaops = [operator.abs, operator.invert, operator.neg, np.ceil, np.floor]
@pytest.mark.parame... | 0 |
rapidsai_public_repos/cudf/python/cudf/cudf | rapidsai_public_repos/cudf/python/cudf/cudf/tests/test_column_accessor.py | # Copyright (c) 2020, NVIDIA CORPORATION.
import pandas as pd
import pytest
import cudf
from cudf.core.column_accessor import ColumnAccessor
from cudf.testing._utils import assert_eq
simple_test_data = [
{},
{"a": []},
{"a": [1]},
{"a": ["a"]},
{"a": [1, 2, 3], "b": ["a", "b", "c"]},
]
mi_test_... | 0 |
rapidsai_public_repos/cudf/python/cudf/cudf | rapidsai_public_repos/cudf/python/cudf/cudf/tests/test_hdf.py | # Copyright (c) 2018-2023, NVIDIA CORPORATION.
import os
from string import ascii_letters
import numpy as np
import pandas as pd
import pytest
import cudf
from cudf.testing._utils import DATETIME_TYPES, NUMERIC_TYPES, assert_eq
try:
import tables # noqa F401
except ImportError:
pytest.skip(
"PyTabl... | 0 |
rapidsai_public_repos/cudf/python/cudf/cudf | rapidsai_public_repos/cudf/python/cudf/cudf/tests/test_struct.py | # Copyright (c) 2020-2023, NVIDIA CORPORATION.
import numpy as np
import pandas as pd
import pyarrow as pa
import pytest
import cudf
from cudf.core.dtypes import StructDtype
from cudf.testing._utils import DATETIME_TYPES, TIMEDELTA_TYPES, assert_eq
@pytest.mark.parametrize(
"data",
[
[{}],
[... | 0 |
rapidsai_public_repos/cudf/python/cudf/cudf | rapidsai_public_repos/cudf/python/cudf/cudf/tests/test_timedelta.py | # Copyright (c) 2020-2023, NVIDIA CORPORATION.
import datetime
import operator
import cupy as cp
import numpy as np
import pandas as pd
import pytest
import cudf
from cudf.testing import _utils as utils
from cudf.testing._utils import assert_eq, assert_exceptions_equal
_TIMEDELTA_DATA = [
[1000000, 200000, 3000... | 0 |
rapidsai_public_repos/cudf/python/cudf/cudf | rapidsai_public_repos/cudf/python/cudf/cudf/tests/test_repr.py | # Copyright (c) 2019-2023, NVIDIA CORPORATION.
import textwrap
import cupy as cp
import numpy as np
import pandas as pd
import pytest
from hypothesis import given, settings, strategies as st
import cudf
from cudf.testing import _utils as utils
from cudf.utils.dtypes import np_dtypes_to_pandas_dtypes
repr_categories... | 0 |
rapidsai_public_repos/cudf/python/cudf/cudf | rapidsai_public_repos/cudf/python/cudf/cudf/tests/test_binops.py | # Copyright (c) 2018-2023, NVIDIA CORPORATION.
import decimal
import operator
import random
import warnings
from itertools import combinations_with_replacement, product
import cupy as cp
import numpy as np
import pandas as pd
import pytest
import cudf
from cudf import Series
from cudf.core._compat import PANDAS_GE_1... | 0 |
rapidsai_public_repos/cudf/python/cudf/cudf | rapidsai_public_repos/cudf/python/cudf/cudf/tests/test_factorize.py | # Copyright (c) 2018-2023, NVIDIA CORPORATION.
import cupy as cp
import numpy as np
import pandas as pd
import pytest
import cudf
from cudf import DataFrame, Index
from cudf.testing._utils import assert_eq
@pytest.mark.parametrize("ncats,nelem", [(2, 2), (2, 10), (10, 100)])
def test_factorize_series_obj(ncats, nel... | 0 |
rapidsai_public_repos/cudf/python/cudf/cudf | rapidsai_public_repos/cudf/python/cudf/cudf/tests/test_array_ufunc.py | # Copyright (c) 2020-2023, NVIDIA CORPORATION.
import operator
import warnings
from contextlib import contextmanager
from functools import reduce
import cupy as cp
import numpy as np
import pytest
import cudf
from cudf.core._compat import PANDAS_GE_150
from cudf.testing._utils import assert_eq, set_random_null_mask_... | 0 |
rapidsai_public_repos/cudf/python/cudf/cudf | rapidsai_public_repos/cudf/python/cudf/cudf/tests/test_mvc.py | # Copyright (c) 2023, NVIDIA CORPORATION.
import subprocess
import sys
import pytest
IS_CUDA_11 = False
IS_CUDA_12 = False
try:
from ptxcompiler.patch import safe_get_versions
except ModuleNotFoundError:
from cudf.utils._ptxcompiler import safe_get_versions
# do not test cuda 12 if pynvjitlink isn't present
... | 0 |
rapidsai_public_repos/cudf/python/cudf/cudf | rapidsai_public_repos/cudf/python/cudf/cudf/tests/test_compile_udf.py | # Copyright (c) 2021, NVIDIA CORPORATION.
from numba import types
from cudf.utils import cudautils
def setup_function():
cudautils._udf_code_cache.clear()
def assert_cache_size(size):
assert cudautils._udf_code_cache.currsize == size
def test_first_compile_sets_cache_entry():
# The first compilation... | 0 |
rapidsai_public_repos/cudf/python/cudf/cudf | rapidsai_public_repos/cudf/python/cudf/cudf/tests/test_rank.py | # Copyright (c) 2020-2023, NVIDIA CORPORATION.
from itertools import chain, combinations_with_replacement, product
import numpy as np
import pandas as pd
import pytest
from cudf import DataFrame
from cudf.testing._utils import assert_eq, assert_exceptions_equal
@pytest.fixture
def pdf():
return pd.DataFrame(
... | 0 |
rapidsai_public_repos/cudf/python/cudf/cudf | rapidsai_public_repos/cudf/python/cudf/cudf/tests/test_reductions.py | # Copyright (c) 2020-2023, NVIDIA CORPORATION.
from decimal import Decimal
from itertools import product
import numpy as np
import pandas as pd
import pytest
import cudf
from cudf import Series
from cudf.core.dtypes import Decimal32Dtype, Decimal64Dtype, Decimal128Dtype
from cudf.testing import _utils as utils
from... | 0 |
rapidsai_public_repos/cudf/python/cudf/cudf | rapidsai_public_repos/cudf/python/cudf/cudf/tests/test_replace.py | # Copyright (c) 2020-2023, NVIDIA CORPORATION.
import re
from decimal import Decimal
import numpy as np
import pandas as pd
import pytest
import cudf
from cudf.core._compat import PANDAS_GE_134, PANDAS_GE_150
from cudf.core.dtypes import Decimal32Dtype, Decimal64Dtype, Decimal128Dtype
from cudf.testing._utils import... | 0 |
rapidsai_public_repos/cudf/python/cudf/cudf | rapidsai_public_repos/cudf/python/cudf/cudf/tests/test_search.py | # Copyright (c) 2018-2023, NVIDIA CORPORATION.
import cupy
import numpy as np
import pandas as pd
import pytest
import cudf
from cudf.testing._utils import assert_eq, gen_rand, random_bitmask
@pytest.mark.parametrize("side", ["left", "right"])
@pytest.mark.parametrize("obj_class", ["series", "index", "column"])
@pyt... | 0 |
rapidsai_public_repos/cudf/python/cudf/cudf | rapidsai_public_repos/cudf/python/cudf/cudf/tests/test_quantiles.py | # Copyright (c) 2020-2023, NVIDIA CORPORATION.
import re
import pandas as pd
import pytest
import cudf
from cudf.testing._utils import assert_eq, assert_exceptions_equal
def test_single_q():
q = 0.5
pdf = pd.DataFrame({"a": [4, 24, 13, 8, 7]})
gdf = cudf.from_pandas(pdf)
pdf_q = pdf.quantile(q, i... | 0 |
rapidsai_public_repos/cudf/python/cudf/cudf | rapidsai_public_repos/cudf/python/cudf/cudf/tests/test_dlpack.py | # Copyright (c) 2019-2022, NVIDIA CORPORATION.
import itertools
from contextlib import ExitStack as does_not_raise
import cupy
import numpy as np
import pytest
from packaging import version
import cudf
from cudf.testing._utils import assert_eq
nelems = [0, 3, 10]
dtype = [np.uint16, np.int32, np.float64]
nulls = ["... | 0 |
rapidsai_public_repos/cudf/python/cudf/cudf | rapidsai_public_repos/cudf/python/cudf/cudf/tests/test_datetime.py | # Copyright (c) 2019-2023, NVIDIA CORPORATION.
import datetime
import operator
import cupy as cp
import numpy as np
import pandas as pd
import pyarrow as pa
import pytest
import cudf
import cudf.testing.dataset_generator as dataset_generator
from cudf import DataFrame, Series
from cudf.core._compat import PANDAS_GE_... | 0 |
rapidsai_public_repos/cudf/python/cudf/cudf | rapidsai_public_repos/cudf/python/cudf/cudf/tests/test_interpolate.py | # Copyright (c) 2021-2022, NVIDIA CORPORATION.
import pytest
import cudf
from cudf.testing._utils import assert_eq, assert_exceptions_equal
@pytest.mark.parametrize(
"data",
[
# basics
{"A": [1.0, 2.0, 3.0], "B": [4.0, 5.0, 6.0]},
{"A": [1.0, None, 3.0], "B": [4.0, None, 6.0]},
... | 0 |
rapidsai_public_repos/cudf/python/cudf/cudf | rapidsai_public_repos/cudf/python/cudf/cudf/tests/test_duplicates.py | # Copyright (c) 2020-2023, NVIDIA CORPORATION.
import itertools
import random
import numpy as np
import pandas as pd
import pytest
import cudf
from cudf import concat
from cudf.testing._utils import (
_create_pandas_series_float64_default,
assert_eq,
assert_exceptions_equal,
)
# TODO: PANDAS 1.0 support... | 0 |
rapidsai_public_repos/cudf/python/cudf/cudf | rapidsai_public_repos/cudf/python/cudf/cudf/tests/test_sparse_df.py | # Copyright (c) 2018-2023, NVIDIA CORPORATION.
import numpy as np
from cudf import Series
def test_to_dense_array():
data = np.random.random(8)
mask = np.asarray([0b11010110]).astype(np.byte)
sr = Series.from_masked_array(data=data, mask=mask, null_count=3)
assert sr.has_nulls
assert sr.null_co... | 0 |
rapidsai_public_repos/cudf/python/cudf/cudf | rapidsai_public_repos/cudf/python/cudf/cudf/tests/conftest.py | # Copyright (c) 2019-2022, NVIDIA CORPORATION.
import itertools
import os
import pathlib
import cupy as cp
import numpy as np
import pytest
import rmm # noqa: F401
import cudf
from cudf.testing._utils import assert_eq
_CURRENT_DIRECTORY = str(pathlib.Path(__file__).resolve().parent)
@pytest.fixture(scope="sessi... | 0 |
rapidsai_public_repos/cudf/python/cudf/cudf | rapidsai_public_repos/cudf/python/cudf/cudf/tests/test_stats.py | # Copyright (c) 2018-2023, NVIDIA CORPORATION.
from concurrent.futures import ThreadPoolExecutor
import cupy as cp
import numpy as np
import pandas as pd
import pytest
import cudf
from cudf.datasets import randomdata
from cudf.testing._utils import (
_create_cudf_series_float64_default,
_create_pandas_series... | 0 |
rapidsai_public_repos/cudf/python/cudf/cudf | rapidsai_public_repos/cudf/python/cudf/cudf/tests/test_column.py | # Copyright (c) 2020-2023, NVIDIA CORPORATION.
import cupy as cp
import numpy as np
import pandas as pd
import pyarrow as pa
import pytest
import cudf
from cudf._lib.transform import mask_to_bools
from cudf.core.column.column import as_column
from cudf.testing._utils import assert_eq, assert_exceptions_equal
from cud... | 0 |
rapidsai_public_repos/cudf/python/cudf/cudf | rapidsai_public_repos/cudf/python/cudf/cudf/tests/test_extension_compilation.py | # Copyright (c) 2021-2023, NVIDIA CORPORATION.
import operator
import cupy as cp
import numpy as np
import pytest
from numba import cuda, types
from numba.cuda import compile_ptx
from numba.np.numpy_support import from_dtype
from cudf import NA
from cudf.core.udf.api import Masked
from cudf.core.udf.masked_typing imp... | 0 |
rapidsai_public_repos/cudf/python/cudf/cudf | rapidsai_public_repos/cudf/python/cudf/cudf/tests/test_string.py | # Copyright (c) 2018-2023, NVIDIA CORPORATION.
import json
import re
import urllib.parse
from contextlib import ExitStack as does_not_raise
from decimal import Decimal
from sys import getsizeof
import cupy
import numpy as np
import pandas as pd
import pyarrow as pa
import pytest
import cudf
from cudf import concat
f... | 0 |
rapidsai_public_repos/cudf/python/cudf/cudf | rapidsai_public_repos/cudf/python/cudf/cudf/tests/test_onehot.py | # Copyright (c) 2018-2023, NVIDIA CORPORATION.
from string import ascii_lowercase
import numpy as np
import pandas as pd
import pytest
import cudf
from cudf.testing._utils import assert_eq
pytestmark = pytest.mark.spilling
@pytest.mark.parametrize(
"data, index",
[
(np.arange(10), None),
(... | 0 |
rapidsai_public_repos/cudf/python/cudf/cudf | rapidsai_public_repos/cudf/python/cudf/cudf/tests/test_query.py | # Copyright (c) 2018-2022, NVIDIA CORPORATION.
import datetime
import inspect
from itertools import product
import numpy as np
import pandas as pd
import pytest
import cudf
from cudf import DataFrame
from cudf.testing._utils import assert_eq
from cudf.utils import queryutils
_params_query_parser = []
_params_query... | 0 |
rapidsai_public_repos/cudf/python/cudf/cudf | rapidsai_public_repos/cudf/python/cudf/cudf/tests/test_query_mask.py | # Copyright (c) 2019-2022, NVIDIA CORPORATION.
import numpy as np
import pandas as pd
import pytest
import cudf
from cudf.testing._utils import assert_eq
_data = [
{"a": [0, 1.0, 2.0, None, np.nan, None, 3, 5]},
{"a": [0, 1.0, 2.0, None, 3, np.nan, None, 4]},
{"a": [0, 1.0, 2.0, None, 3, np.nan, None, 4,... | 0 |
rapidsai_public_repos/cudf/python/cudf/cudf | rapidsai_public_repos/cudf/python/cudf/cudf/tests/test_join_order.py | # Copyright (c) 2023, NVIDIA CORPORATION.
import itertools
import operator
import string
from collections import defaultdict
import numpy as np
import pytest
import cudf
from cudf.core._compat import PANDAS_GE_220
from cudf.testing._utils import assert_eq
@pytest.fixture(params=[False, True], ids=["unsorted", "sor... | 0 |
rapidsai_public_repos/cudf/python/cudf/cudf | rapidsai_public_repos/cudf/python/cudf/cudf/tests/test_dataframe_copy.py | # Copyright (c) 2018-2023, NVIDIA CORPORATION.
from copy import copy, deepcopy
import cupy as cp
import numpy as np
import pandas as pd
import pytest
from cudf.core.dataframe import DataFrame
from cudf.testing._utils import ALL_TYPES, assert_eq, assert_neq
"""
DataFrame copy expectations
* A shallow copy constructs ... | 0 |
rapidsai_public_repos/cudf/python/cudf/cudf | rapidsai_public_repos/cudf/python/cudf/cudf/tests/test_buffer.py | # Copyright (c) 2020-2023, NVIDIA CORPORATION.
import cupy as cp
import pytest
from cudf.core.buffer import Buffer, as_buffer
pytestmark = pytest.mark.spilling
arr_len = 10
@pytest.mark.parametrize(
"data",
[
(cp.zeros(arr_len), True),
(cp.zeros((1, arr_len)), True),
(cp.zeros((1, ... | 0 |
rapidsai_public_repos/cudf/python/cudf/cudf | rapidsai_public_repos/cudf/python/cudf/cudf/tests/test_concat.py | # Copyright (c) 2018-2023, NVIDIA CORPORATION.
from decimal import Decimal
import numpy as np
import pandas as pd
import pytest
import cudf as gd
from cudf.api.types import is_categorical_dtype
from cudf.core._compat import PANDAS_GE_150, PANDAS_LT_140
from cudf.core.dtypes import Decimal32Dtype, Decimal64Dtype, Dec... | 0 |
rapidsai_public_repos/cudf/python/cudf/cudf | rapidsai_public_repos/cudf/python/cudf/cudf/tests/test_dask.py | # Copyright (c) 2019, NVIDIA CORPORATION.
import pytest
import cudf
is_dataframe_like = pytest.importorskip(
"dask.dataframe.utils"
).is_dataframe_like
is_index_like = pytest.importorskip("dask.dataframe.utils").is_index_like
is_series_like = pytest.importorskip("dask.dataframe.utils").is_series_like
def test_... | 0 |
rapidsai_public_repos/cudf/python/cudf/cudf | rapidsai_public_repos/cudf/python/cudf/cudf/tests/test_index.py | # Copyright (c) 2018-2023, NVIDIA CORPORATION.
"""
Test related to Index
"""
import operator
import re
import numpy as np
import pandas as pd
import pyarrow as pa
import pytest
import cudf
from cudf.api.extensions import no_default
from cudf.api.types import is_bool_dtype
from cudf.core._compat import PANDAS_GE_133,... | 0 |
rapidsai_public_repos/cudf/python/cudf/cudf | rapidsai_public_repos/cudf/python/cudf/cudf/tests/test_seriesmap.py | # Copyright (c) 2020-2023, NVIDIA CORPORATION.
from itertools import product
from math import floor
import numpy as np
import pandas as pd
import pytest
import cudf
from cudf import Series
from cudf.testing._utils import assert_eq, assert_exceptions_equal
def test_series_map_basic():
gd1 = cudf.Series(["cat", ... | 0 |
rapidsai_public_repos/cudf/python/cudf/cudf | rapidsai_public_repos/cudf/python/cudf/cudf/tests/test_gcs.py | # Copyright (c) 2020-2022, NVIDIA CORPORATION.
import io
import os
import numpy as np
import pandas as pd
import pytest
import cudf
from cudf.testing._utils import assert_eq
gcsfs = pytest.importorskip("gcsfs")
TEST_PROJECT = "cudf-gcs-test-project"
TEST_BUCKET = "cudf-gcs-test-bucket"
@pytest.fixture
def pdf(sc... | 0 |
rapidsai_public_repos/cudf/python/cudf/cudf | rapidsai_public_repos/cudf/python/cudf/cudf/tests/test_scan.py | # Copyright (c) 2021-2022, NVIDIA CORPORATION.
from itertools import product
import numpy as np
import pandas as pd
import pytest
import cudf
from cudf.core.dtypes import Decimal32Dtype, Decimal64Dtype, Decimal128Dtype
from cudf.testing._utils import (
INTEGER_TYPES,
NUMERIC_TYPES,
assert_eq,
gen_ran... | 0 |
rapidsai_public_repos/cudf/python/cudf/cudf | rapidsai_public_repos/cudf/python/cudf/cudf/tests/test_offset.py | # Copyright (c) 2021, NVIDIA CORPORATION.
import re
import numpy as np
import pytest
from cudf import DateOffset
INT64MAX = np.iinfo("int64").max
@pytest.mark.parametrize("period", [1.5, 0.5, "string", "1", "1.0"])
@pytest.mark.parametrize("freq", ["years", "months"])
def test_construction_invalid(period, freq):
... | 0 |
rapidsai_public_repos/cudf/python/cudf/cudf | rapidsai_public_repos/cudf/python/cudf/cudf/tests/test_setitem.py | # Copyright (c) 2018-2023, NVIDIA CORPORATION.
import numpy as np
import pandas as pd
import pytest
import cudf
from cudf.core._compat import PANDAS_GE_150
from cudf.testing._utils import assert_eq, assert_exceptions_equal
@pytest.mark.parametrize("df", [pd.DataFrame({"a": [1, 2, 3]})])
@pytest.mark.parametrize("ar... | 0 |
rapidsai_public_repos/cudf/python/cudf/cudf | rapidsai_public_repos/cudf/python/cudf/cudf/tests/test_csv.py | # Copyright (c) 2018-2023, NVIDIA CORPORATION.
import codecs
import gzip
import os
import re
import shutil
from collections import OrderedDict
from io import BytesIO, StringIO
from pathlib import Path
import cupy as cp
import numpy as np
import pandas as pd
import pytest
from pyarrow import fs as pa_fs
import cudf
f... | 0 |
rapidsai_public_repos/cudf/python/cudf/cudf | rapidsai_public_repos/cudf/python/cudf/cudf/tests/test_array_function.py | # Copyright (c) 2018-2023, NVIDIA CORPORATION.
import numpy as np
import pandas as pd
import pytest
import cudf
from cudf.testing._utils import assert_eq
# To determine if NEP18 is available in the current version of NumPy we simply
# attempt to concatenate an object with `__array_function__` defined and see if
# Nu... | 0 |
rapidsai_public_repos/cudf/python/cudf/cudf | rapidsai_public_repos/cudf/python/cudf/cudf/tests/test_indexing.py | # Copyright (c) 2021-2023, NVIDIA CORPORATION.
from datetime import datetime
from itertools import combinations
import cupy
import numpy as np
import pandas as pd
import pytest
import cudf
from cudf.testing import _utils as utils
from cudf.testing._utils import (
INTEGER_TYPES,
assert_eq,
assert_exceptio... | 0 |
rapidsai_public_repos/cudf/python/cudf/cudf | rapidsai_public_repos/cudf/python/cudf/cudf/tests/test_copying.py | # Copyright (c) 2020-2023, NVIDIA CORPORATION.
import cupy as cp
import numpy as np
import pandas as pd
import pytest
import cudf
from cudf import Series
from cudf.testing._utils import NUMERIC_TYPES, OTHER_TYPES, assert_eq
@pytest.mark.parametrize("dtype", NUMERIC_TYPES + OTHER_TYPES)
def test_repeat(dtype):
a... | 0 |
rapidsai_public_repos/cudf/python/cudf/cudf | rapidsai_public_repos/cudf/python/cudf/cudf/tests/test_dropna.py | # Copyright (c) 2020-2023, NVIDIA CORPORATION.
import numpy as np
import pandas as pd
import pytest
import cudf
from cudf.testing._utils import (
_create_pandas_series_float64_default,
assert_eq,
)
@pytest.mark.parametrize(
"data",
[
[],
[1.0, 2, None, 4],
["one", "two", "thr... | 0 |
rapidsai_public_repos/cudf/python/cudf/cudf | rapidsai_public_repos/cudf/python/cudf/cudf/tests/test_reshape.py | # Copyright (c) 2021-2023, NVIDIA CORPORATION.
import re
from itertools import chain
import numpy as np
import pandas as pd
import pytest
import cudf
from cudf import melt as cudf_melt
from cudf.core.buffer.spill_manager import get_global_manager
from cudf.testing._utils import (
ALL_TYPES,
DATETIME_TYPES,
... | 0 |
rapidsai_public_repos/cudf/python/cudf/cudf | rapidsai_public_repos/cudf/python/cudf/cudf/tests/test_series.py | # Copyright (c) 2020-2023, NVIDIA CORPORATION.
import decimal
import hashlib
import operator
import re
from collections import OrderedDict, defaultdict
from string import ascii_letters, digits
import cupy as cp
import numpy as np
import pandas as pd
import pyarrow as pa
import pytest
import cudf
from cudf.core._comp... | 0 |
rapidsai_public_repos/cudf/python/cudf/cudf | rapidsai_public_repos/cudf/python/cudf/cudf/tests/test_spilling.py | # Copyright (c) 2022-2023, NVIDIA CORPORATION.
import importlib
import random
import time
import warnings
import weakref
from concurrent.futures import ThreadPoolExecutor
from typing import List, Tuple
import cupy
import numpy as np
import pandas
import pandas.testing
import pytest
import rmm
import cudf
import cud... | 0 |
rapidsai_public_repos/cudf/python/cudf/cudf | rapidsai_public_repos/cudf/python/cudf/cudf/tests/test_dtypes.py | # Copyright (c) 2020-2023, NVIDIA CORPORATION.
import numpy as np
import pandas as pd
import pyarrow as pa
import pytest
import cudf
from cudf.core._compat import PANDAS_GE_150
from cudf.core.column import ColumnBase
from cudf.core.dtypes import (
CategoricalDtype,
Decimal32Dtype,
Decimal64Dtype,
Deci... | 0 |
rapidsai_public_repos/cudf/python/cudf/cudf | rapidsai_public_repos/cudf/python/cudf/cudf/tests/test_orc.py | # Copyright (c) 2019-2023, NVIDIA CORPORATION.
import datetime
import decimal
import os
import random
from io import BytesIO
from string import ascii_lowercase
import numpy as np
import pandas as pd
import pyarrow as pa
import pytest
import cudf
from cudf.io.orc import ORCWriter
from cudf.testing import assert_frame... | 0 |
rapidsai_public_repos/cudf/python/cudf/cudf | rapidsai_public_repos/cudf/python/cudf/cudf/tests/test_groupby.py | # Copyright (c) 2018-2023, NVIDIA CORPORATION.
import collections
import datetime
import itertools
import operator
import string
import textwrap
from decimal import Decimal
from functools import partial
import numpy as np
import pandas as pd
import pytest
from numba import cuda
from numpy.testing import assert_array_... | 0 |
rapidsai_public_repos/cudf/python/cudf/cudf | rapidsai_public_repos/cudf/python/cudf/cudf/tests/test_contains.py | # Copyright (c) 2019-2022, NVIDIA CORPORATION.
import datetime
import numpy as np
import pandas as pd
import pytest
import cudf
from cudf import Series
from cudf.core.index import RangeIndex, as_index
from cudf.testing._utils import (
DATETIME_TYPES,
NUMERIC_TYPES,
TIMEDELTA_TYPES,
assert_eq,
)
def... | 0 |
rapidsai_public_repos/cudf/python/cudf/cudf | rapidsai_public_repos/cudf/python/cudf/cudf/tests/test_s3.py | # Copyright (c) 2020-2023, NVIDIA CORPORATION.
import os
import socket
from contextlib import contextmanager
from io import BytesIO
import numpy as np
import pandas as pd
import pyarrow.fs as pa_fs
import pytest
from fsspec.core import get_fs_token_paths
import cudf
from cudf.testing._utils import assert_eq
moto = ... | 0 |
rapidsai_public_repos/cudf/python/cudf/cudf | rapidsai_public_repos/cudf/python/cudf/cudf/tests/test_cuda_apply.py | # Copyright (c) 2018-2022, NVIDIA CORPORATION.
"""
Test method that apply GPU kernel to a frame.
"""
import numpy as np
import pytest
from numba import cuda
from cudf import DataFrame
from cudf.testing._utils import assert_eq
@pytest.mark.parametrize("nelem", [1, 2, 64, 128, 129])
def test_df_apply_rows(nelem):
... | 0 |
rapidsai_public_repos/cudf/python/cudf/cudf | rapidsai_public_repos/cudf/python/cudf/cudf/tests/test_list.py | # Copyright (c) 2020-2023, NVIDIA CORPORATION.
import functools
import operator
import numpy as np
import pandas as pd
import pyarrow as pa
import pytest
import cudf
from cudf import NA
from cudf._lib.copying import get_element
from cudf.api.types import is_scalar
from cudf.testing._utils import (
DATETIME_TYPES... | 0 |
rapidsai_public_repos/cudf/python/cudf/cudf | rapidsai_public_repos/cudf/python/cudf/cudf/tests/test_serialize.py | # Copyright (c) 2018-2023, NVIDIA CORPORATION.
import pickle
import msgpack
import numpy as np
import pandas as pd
import pytest
import cudf
from cudf.core._compat import PANDAS_GE_200
from cudf.testing import _utils as utils
from cudf.testing._utils import assert_eq
@pytest.mark.parametrize(
"df",
[
... | 0 |
rapidsai_public_repos/cudf/python/cudf/cudf | rapidsai_public_repos/cudf/python/cudf/cudf/tests/test_udf_binops.py | # Copyright (c) 2018-2022, NVIDIA CORPORATION.
import numpy as np
import pytest
from numba.cuda import compile_ptx
from numba.np import numpy_support
import rmm
import cudf
from cudf import Series, _lib as libcudf
from cudf.utils import dtypes as dtypeutils
_driver_version = rmm._cuda.gpu.driverGetVersion()
_runtim... | 0 |
rapidsai_public_repos/cudf/python/cudf/cudf | rapidsai_public_repos/cudf/python/cudf/cudf/tests/test_multiindex.py | # Copyright (c) 2019-2023, NVIDIA CORPORATION.
"""
Test related to MultiIndex
"""
import itertools
import operator
import pickle
import re
from contextlib import contextmanager
from io import BytesIO
import cupy as cp
import numpy as np
import pandas as pd
import pytest
import cudf
from cudf.api.extensions import no... | 0 |
rapidsai_public_repos/cudf/python/cudf/cudf | rapidsai_public_repos/cudf/python/cudf/cudf/tests/test_pickling.py | # Copyright (c) 2018-2023, NVIDIA CORPORATION.
import pickle
import numpy as np
import pandas as pd
import pytest
from cudf import DataFrame, GenericIndex, RangeIndex, Series
from cudf.core.buffer import as_buffer
from cudf.testing._utils import assert_eq
pytestmark = pytest.mark.spilling
def check_serialization(... | 0 |
rapidsai_public_repos/cudf/python/cudf/cudf | rapidsai_public_repos/cudf/python/cudf/cudf/tests/test_hdfs.py | # Copyright (c) 2020-2022, NVIDIA CORPORATION.
import os
from io import BytesIO
import fastavro
import numpy as np
import pandas as pd
import pyarrow as pa
import pytest
import cudf
from cudf.testing._utils import assert_eq
if not os.environ.get("RUN_HDFS_TESTS"):
pytestmark = pytest.mark.skip("Env not configur... | 0 |
rapidsai_public_repos/cudf/python/cudf/cudf | rapidsai_public_repos/cudf/python/cudf/cudf/tests/test_applymap.py | # Copyright (c) 2018-2022, NVIDIA CORPORATION.
import pytest
from cudf import NA, DataFrame
from cudf.testing import _utils as utils
@pytest.mark.parametrize(
"data",
[
{"a": [1, 2, 3], "b": [4, 5, 6]},
{"a": [1, 2, 3], "b": [1.0, 2.0, 3.0]},
{"a": [1, 2, 3], "b": [True, False, True]... | 0 |
rapidsai_public_repos/cudf/python/cudf/cudf | rapidsai_public_repos/cudf/python/cudf/cudf/tests/test_categorical.py | # Copyright (c) 2018-2023, NVIDIA CORPORATION.
import operator
import string
import warnings
from contextlib import contextmanager
from textwrap import dedent
import numpy as np
import pandas as pd
import pytest
import cudf
from cudf.core._compat import PANDAS_GE_134
from cudf.testing._utils import (
NUMERIC_TYP... | 0 |
rapidsai_public_repos/cudf/python/cudf/cudf | rapidsai_public_repos/cudf/python/cudf/cudf/tests/test_feather.py | # Copyright (c) 2018-2023, NVIDIA CORPORATION.
import os
from string import ascii_letters
import numpy as np
import pandas as pd
import pyarrow as pa
import pytest
import cudf
from cudf.testing._utils import NUMERIC_TYPES, assert_eq
@pytest.fixture(params=[0, 1, 10, 100])
def pdf(request):
types = NUMERIC_TYPE... | 0 |
rapidsai_public_repos/cudf/python/cudf/cudf | rapidsai_public_repos/cudf/python/cudf/cudf/tests/test_cuda_array_interface.py | # Copyright (c) 2019-2023, NVIDIA CORPORATION.
import types
from contextlib import ExitStack as does_not_raise
import cupy
import numpy as np
import pandas as pd
import pytest
from numba import cuda
import cudf
from cudf.core.buffer.spill_manager import get_global_manager
from cudf.testing._utils import DATETIME_TYP... | 0 |
rapidsai_public_repos/cudf/python/cudf/cudf | rapidsai_public_repos/cudf/python/cudf/cudf/tests/test_options.py | # Copyright (c) 2022-2023, NVIDIA CORPORATION.
from contextlib import redirect_stdout
from io import StringIO
import pytest
import cudf
@pytest.fixture(scope="class", autouse=False)
def empty_option_environment():
old_option_environment = cudf.options._OPTIONS
cudf.options._OPTIONS = {}
yield
cudf.... | 0 |
rapidsai_public_repos/cudf/python/cudf/cudf | rapidsai_public_repos/cudf/python/cudf/cudf/tests/test_resampling.py | # Copyright (c) 2021-2022, NVIDIA CORPORATION.
import numpy as np
import pandas as pd
import pytest
import cudf
from cudf.testing._utils import assert_eq
def assert_resample_results_equal(lhs, rhs, **kwargs):
assert_eq(
lhs.sort_index(),
rhs.sort_index(),
check_dtype=False,
check... | 0 |
rapidsai_public_repos/cudf/python/cudf/cudf | rapidsai_public_repos/cudf/python/cudf/cudf/tests/test_transform.py | # Copyright (c) 2018-2022, NVIDIA CORPORATION.
import numpy as np
import pytest
from cudf import Series
from cudf.testing._utils import NUMERIC_TYPES
supported_types = NUMERIC_TYPES
def _generic_function(a):
return a**3
@pytest.mark.parametrize("dtype", supported_types)
@pytest.mark.parametrize(
"udf,te... | 0 |
rapidsai_public_repos/cudf/python/cudf/cudf | rapidsai_public_repos/cudf/python/cudf/cudf/tests/test_testing.py | # Copyright (c) 2020-2022, NVIDIA CORPORATION.
import numpy as np
import pandas as pd
import pyarrow as pa
import pytest
import cudf
from cudf.core.column.column import as_column, full
from cudf.testing import (
assert_frame_equal,
assert_index_equal,
assert_series_equal,
)
from cudf.testing._utils import... | 0 |
rapidsai_public_repos/cudf/python/cudf/cudf | rapidsai_public_repos/cudf/python/cudf/cudf/tests/pytest.ini | # Copyright (c) 2022, NVIDIA CORPORATION.
[pytest]
markers =
spilling: mark benchmark a good candidate to run with `CUDF_SPILL=ON`
xfail_strict = true
filterwarnings =
error
ignore:::.*xdist.*
ignore:::.*pytest.*
| 0 |
rapidsai_public_repos/cudf/python/cudf/cudf | rapidsai_public_repos/cudf/python/cudf/cudf/tests/test_monotonic.py | # Copyright (c) 2019-2023, NVIDIA CORPORATION.
"""
Tests related to is_unique and is_monotonic attributes
"""
import numpy as np
import pandas as pd
import pytest
import cudf
from cudf import Index, MultiIndex, Series
from cudf.core.index import (
CategoricalIndex,
DatetimeIndex,
GenericIndex,
RangeIn... | 0 |
rapidsai_public_repos/cudf/python/cudf/cudf | rapidsai_public_repos/cudf/python/cudf/cudf/tests/test_datasets.py | # Copyright (c) 2019-2022, NVIDIA CORPORATION.
import numpy as np
import cudf as gd
from cudf.testing._utils import assert_eq
def test_dataset_timeseries():
gdf1 = gd.datasets.timeseries(
dtypes={"x": int, "y": float}, freq="120s", nulls_frequency=0.3, seed=1
)
gdf2 = gd.datasets.timeseries(
... | 0 |
rapidsai_public_repos/cudf/python/cudf/cudf | rapidsai_public_repos/cudf/python/cudf/cudf/tests/test_df_protocol.py | # Copyright (c) 2021-2023, NVIDIA CORPORATION.
from typing import Any, Tuple
import cupy as cp
import pandas as pd
import pytest
import cudf
from cudf.core._compat import PANDAS_GE_150
from cudf.core.buffer import as_buffer
from cudf.core.column import as_column, build_column
from cudf.core.df_protocol import (
... | 0 |
rapidsai_public_repos/cudf/python/cudf/cudf | rapidsai_public_repos/cudf/python/cudf/cudf/tests/test_decimal.py | # Copyright (c) 2021-2023, NVIDIA CORPORATION.
import decimal
from decimal import Decimal
import numpy as np
import pyarrow as pa
import pytest
from packaging import version
import cudf
from cudf.core.column import Decimal32Column, Decimal64Column, NumericalColumn
from cudf.core.dtypes import Decimal32Dtype, Decimal... | 0 |
rapidsai_public_repos/cudf/python/cudf/cudf | rapidsai_public_repos/cudf/python/cudf/cudf/tests/test_pandas_interop.py | # Copyright (c) 2018-2021, NVIDIA CORPORATION.
import numpy as np
import pandas as pd
import cudf
from cudf import DataFrame
from cudf.testing._utils import assert_eq
def test_to_pandas():
df = DataFrame()
df["a"] = np.arange(5, dtype=np.int32)
df["b"] = np.arange(10, 15, dtype=np.float64)
df["c"] =... | 0 |
rapidsai_public_repos/cudf/python/cudf/cudf | rapidsai_public_repos/cudf/python/cudf/cudf/tests/test_joining.py | # Copyright (c) 2018-2023, NVIDIA CORPORATION.
from itertools import combinations, product, repeat
import numpy as np
import pandas as pd
import pytest
import cudf
from cudf.core.dtypes import CategoricalDtype, Decimal64Dtype, Decimal128Dtype
from cudf.testing._utils import (
INTEGER_TYPES,
NUMERIC_TYPES,
... | 0 |
rapidsai_public_repos/cudf/python/cudf/cudf | rapidsai_public_repos/cudf/python/cudf/cudf/tests/test_string_udfs.py | # Copyright (c) 2022-2023, NVIDIA CORPORATION.
import numba
import numpy as np
import pandas as pd
import pytest
from numba import cuda
from numba.core.typing import signature as nb_signature
from numba.types import CPointer, void
import rmm
import cudf
from cudf._lib.strings_udf import (
column_from_udf_string_... | 0 |
rapidsai_public_repos/cudf/python/cudf/cudf | rapidsai_public_repos/cudf/python/cudf/cudf/tests/test_custom_accessor.py | # Copyright (c) 2020-2023, NVIDIA CORPORATION.
import pandas as pd
import pytest
import cudf as gd
from cudf.testing._utils import assert_eq
@gd.api.extensions.register_dataframe_accessor("point")
@pd.api.extensions.register_dataframe_accessor("point")
class PointsAccessor:
def __init__(self, obj):
self... | 0 |
rapidsai_public_repos/cudf/python/cudf/cudf | rapidsai_public_repos/cudf/python/cudf/cudf/tests/test_json.py | # Copyright (c) 2018-2023, NVIDIA CORPORATION.
import copy
import gzip
import itertools
import os
from io import BytesIO, StringIO
from pathlib import Path
import numpy as np
import pandas as pd
import pyarrow as pa
import pytest
import cudf
from cudf.testing._utils import (
DATETIME_TYPES,
NUMERIC_TYPES,
... | 0 |
rapidsai_public_repos/cudf/python/cudf/cudf | rapidsai_public_repos/cudf/python/cudf/cudf/tests/test_numpy_interop.py | # Copyright (c) 2019-2022, NVIDIA CORPORATION.
import numpy as np
import pytest
from cudf import DataFrame, Series
from cudf.testing._utils import assert_eq
def test_to_records_noindex():
df = DataFrame()
df["a"] = aa = np.arange(10, dtype=np.int32)
df["b"] = bb = np.arange(10, 20, dtype=np.float64)
... | 0 |
rapidsai_public_repos/cudf/python/cudf/cudf/tests | rapidsai_public_repos/cudf/python/cudf/cudf/tests/dataframe/test_sorting.py | # Copyright (c) 2023, NVIDIA CORPORATION.
| 0 |
rapidsai_public_repos/cudf/python/cudf/cudf/tests | rapidsai_public_repos/cudf/python/cudf/cudf/tests/dataframe/test_constructing.py | # Copyright (c) 2023, NVIDIA CORPORATION.
| 0 |
rapidsai_public_repos/cudf/python/cudf/cudf/tests | rapidsai_public_repos/cudf/python/cudf/cudf/tests/dataframe/test_conversion.py | # Copyright (c) 2023, NVIDIA CORPORATION.
import pandas as pd
import cudf
from cudf.testing._utils import assert_eq
def test_convert_dtypes():
data = {
"a": [1, 2, 3],
"b": [1, 2, 3],
"c": [1.1, 2.2, 3.3],
"d": [1.0, 2.0, 3.0],
"e": [1.0, 2.0, 3.0],
"f": ["a", "b",... | 0 |
rapidsai_public_repos/cudf/python/cudf/cudf/tests | rapidsai_public_repos/cudf/python/cudf/cudf/tests/dataframe/test_reindexing.py | # Copyright (c) 2023, NVIDIA CORPORATION.
| 0 |
rapidsai_public_repos/cudf/python/cudf/cudf/tests | rapidsai_public_repos/cudf/python/cudf/cudf/tests/dataframe/test_timeseries.py | # Copyright (c) 2023, NVIDIA CORPORATION.
| 0 |
rapidsai_public_repos/cudf/python/cudf/cudf/tests | rapidsai_public_repos/cudf/python/cudf/cudf/tests/dataframe/test_computation.py | # Copyright (c) 2023, NVIDIA CORPORATION.
| 0 |
rapidsai_public_repos/cudf/python/cudf/cudf/tests | rapidsai_public_repos/cudf/python/cudf/cudf/tests/dataframe/test_io_serialization.py | # Copyright (c) 2023, NVIDIA CORPORATION.
| 0 |
rapidsai_public_repos/cudf/python/cudf/cudf/tests | rapidsai_public_repos/cudf/python/cudf/cudf/tests/dataframe/test_missing.py | # Copyright (c) 2023, NVIDIA CORPORATION.
| 0 |
rapidsai_public_repos/cudf/python/cudf/cudf/tests | rapidsai_public_repos/cudf/python/cudf/cudf/tests/dataframe/test_indexing.py | # Copyright (c) 2023, NVIDIA CORPORATION.
| 0 |
rapidsai_public_repos/cudf/python/cudf/cudf/tests | rapidsai_public_repos/cudf/python/cudf/cudf/tests/dataframe/test_attributes.py | # Copyright (c) 2023, NVIDIA CORPORATION.
| 0 |
rapidsai_public_repos/cudf/python/cudf/cudf/tests | rapidsai_public_repos/cudf/python/cudf/cudf/tests/dataframe/test_function_application.py | # Copyright (c) 2023, NVIDIA CORPORATION.
| 0 |
rapidsai_public_repos/cudf/python/cudf/cudf/tests | rapidsai_public_repos/cudf/python/cudf/cudf/tests/dataframe/test_binary_operations.py | # Copyright (c) 2023, NVIDIA CORPORATION.
| 0 |
rapidsai_public_repos/cudf/python/cudf/cudf/tests | rapidsai_public_repos/cudf/python/cudf/cudf/tests/dataframe/test_selecting.py | # Copyright (c) 2023, NVIDIA CORPORATION.
| 0 |
rapidsai_public_repos/cudf/python/cudf/cudf/tests | rapidsai_public_repos/cudf/python/cudf/cudf/tests/dataframe/test_reshaping.py | # Copyright (c) 2023, NVIDIA CORPORATION.
| 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.