Skip to content

Commit

Permalink
Run black in newest version
Browse files Browse the repository at this point in the history
  • Loading branch information
teaVeloper committed Feb 7, 2022
1 parent d9dfc1e commit bd959b5
Show file tree
Hide file tree
Showing 11 changed files with 42 additions and 42 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,8 @@ def put_arrow_to_omnisci(cls, table, name=None):
cpu_count = os.cpu_count()
if cpu_count is not None:
fragment_size = table.num_rows // cpu_count
fragment_size = min(fragment_size, 2 ** 25)
fragment_size = max(fragment_size, 2 ** 18)
fragment_size = min(fragment_size, 2**25)
fragment_size = max(fragment_size, 2**18)
else:
fragment_size = 0
else:
Expand Down
2 changes: 1 addition & 1 deletion modin/test/pandas/dataframe/test_binary.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def test_math_functions(other, axis, op):

@pytest.mark.parametrize(
"other",
[lambda df: df[: -(2 ** 4)], lambda df: df[df.columns[0]].reset_index(drop=True)],
[lambda df: df[: -(2**4)], lambda df: df[df.columns[0]].reset_index(drop=True)],
ids=["check_missing_value", "check_different_index"],
)
@pytest.mark.parametrize("fill_value", [None, 3.0])
Expand Down
32 changes: 16 additions & 16 deletions modin/test/pandas/dataframe/test_join_sort.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,20 +64,20 @@ def test_combine(data):
"test_data, test_data2",
[
(
np.random.uniform(0, 100, size=(2 ** 6, 2 ** 6)),
np.random.uniform(0, 100, size=(2 ** 7, 2 ** 6)),
np.random.uniform(0, 100, size=(2**6, 2**6)),
np.random.uniform(0, 100, size=(2**7, 2**6)),
),
(
np.random.uniform(0, 100, size=(2 ** 7, 2 ** 6)),
np.random.uniform(0, 100, size=(2 ** 6, 2 ** 6)),
np.random.uniform(0, 100, size=(2**7, 2**6)),
np.random.uniform(0, 100, size=(2**6, 2**6)),
),
(
np.random.uniform(0, 100, size=(2 ** 6, 2 ** 6)),
np.random.uniform(0, 100, size=(2 ** 6, 2 ** 7)),
np.random.uniform(0, 100, size=(2**6, 2**6)),
np.random.uniform(0, 100, size=(2**6, 2**7)),
),
(
np.random.uniform(0, 100, size=(2 ** 6, 2 ** 7)),
np.random.uniform(0, 100, size=(2 ** 6, 2 ** 6)),
np.random.uniform(0, 100, size=(2**6, 2**7)),
np.random.uniform(0, 100, size=(2**6, 2**6)),
),
],
)
Expand Down Expand Up @@ -162,20 +162,20 @@ def test_join(test_data, test_data2):
"test_data, test_data2",
[
(
np.random.uniform(0, 100, size=(2 ** 6, 2 ** 6)),
np.random.uniform(0, 100, size=(2 ** 7, 2 ** 6)),
np.random.uniform(0, 100, size=(2**6, 2**6)),
np.random.uniform(0, 100, size=(2**7, 2**6)),
),
(
np.random.uniform(0, 100, size=(2 ** 7, 2 ** 6)),
np.random.uniform(0, 100, size=(2 ** 6, 2 ** 6)),
np.random.uniform(0, 100, size=(2**7, 2**6)),
np.random.uniform(0, 100, size=(2**6, 2**6)),
),
(
np.random.uniform(0, 100, size=(2 ** 6, 2 ** 6)),
np.random.uniform(0, 100, size=(2 ** 6, 2 ** 7)),
np.random.uniform(0, 100, size=(2**6, 2**6)),
np.random.uniform(0, 100, size=(2**6, 2**7)),
),
(
np.random.uniform(0, 100, size=(2 ** 6, 2 ** 7)),
np.random.uniform(0, 100, size=(2 ** 6, 2 ** 6)),
np.random.uniform(0, 100, size=(2**6, 2**7)),
np.random.uniform(0, 100, size=(2**6, 2**6)),
),
],
)
Expand Down
6 changes: 3 additions & 3 deletions modin/test/pandas/dataframe/test_reduce.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,12 +165,12 @@ def test_describe(data, percentiles):
@pytest.mark.parametrize("datetime_is_numeric", [True, False, None])
def test_2195(datetime_is_numeric, has_numeric_column):
data = {
"categorical": pd.Categorical(["d"] * 10 ** 2),
"date": [np.datetime64("2000-01-01")] * 10 ** 2,
"categorical": pd.Categorical(["d"] * 10**2),
"date": [np.datetime64("2000-01-01")] * 10**2,
}

if has_numeric_column:
data.update({"numeric": [5] * 10 ** 2})
data.update({"numeric": [5] * 10**2})

modin_df, pandas_df = pd.DataFrame(data), pandas.DataFrame(data)

Expand Down
6 changes: 3 additions & 3 deletions modin/test/pandas/dataframe/test_reduction.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,12 +165,12 @@ def test_describe(data, percentiles):
@pytest.mark.parametrize("datetime_is_numeric", [True, False, None])
def test_2195(datetime_is_numeric, has_numeric_column):
data = {
"categorical": pd.Categorical(["d"] * 10 ** 2),
"date": [np.datetime64("2000-01-01")] * 10 ** 2,
"categorical": pd.Categorical(["d"] * 10**2),
"date": [np.datetime64("2000-01-01")] * 10**2,
}

if has_numeric_column:
data.update({"numeric": [5] * 10 ** 2})
data.update({"numeric": [5] * 10**2})

modin_df, pandas_df = pd.DataFrame(data), pandas.DataFrame(data)

Expand Down
2 changes: 1 addition & 1 deletion modin/test/pandas/test_concat.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ def test_ignore_index_concat():


def test_concat_non_subscriptable_keys():
frame_data = np.random.randint(0, 100, size=(2 ** 10, 2 ** 6))
frame_data = np.random.randint(0, 100, size=(2**10, 2**6))
df = pd.DataFrame(frame_data).add_prefix("col")
pdf = pandas.DataFrame(frame_data).add_prefix("col")

Expand Down
10 changes: 5 additions & 5 deletions modin/test/pandas/test_groupby.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def wrapper(obj1, obj2, *args, **kwargs):

@pytest.mark.parametrize("as_index", [True, False])
def test_mixed_dtypes_groupby(as_index):
frame_data = np.random.randint(97, 198, size=(2 ** 6, 2 ** 4))
frame_data = np.random.randint(97, 198, size=(2**6, 2**4))
pandas_df = pandas.DataFrame(frame_data).add_prefix("col")
# Convert every other column to string
for col in pandas_df.iloc[
Expand Down Expand Up @@ -885,13 +885,13 @@ def test_simple_col_groupby():


@pytest.mark.parametrize(
"by", [np.random.randint(0, 100, size=2 ** 8), lambda x: x % 3, None]
"by", [np.random.randint(0, 100, size=2**8), lambda x: x % 3, None]
)
@pytest.mark.parametrize("as_index_series_or_dataframe", [0, 1, 2])
def test_series_groupby(by, as_index_series_or_dataframe):
if as_index_series_or_dataframe <= 1:
as_index = as_index_series_or_dataframe == 1
series_data = np.random.randint(97, 198, size=2 ** 8)
series_data = np.random.randint(97, 198, size=2**8)
modin_series = pd.Series(series_data)
pandas_series = pandas.Series(series_data)
else:
Expand Down Expand Up @@ -1292,7 +1292,7 @@ def eval_shift(modin_groupby, pandas_groupby):


def test_groupby_on_index_values_with_loop():
length = 2 ** 6
length = 2**6
data = {
"a": np.random.randint(0, 100, size=length),
"b": np.random.randint(0, 100, size=length),
Expand Down Expand Up @@ -1332,7 +1332,7 @@ def test_groupby_on_index_values_with_loop():
],
)
def test_groupby_multiindex(groupby_kwargs):
frame_data = np.random.randint(0, 100, size=(2 ** 6, 2 ** 4))
frame_data = np.random.randint(0, 100, size=(2**6, 2**4))
modin_df = pd.DataFrame(frame_data)
pandas_df = pandas.DataFrame(frame_data)

Expand Down
2 changes: 1 addition & 1 deletion modin/test/pandas/test_series.py
Original file line number Diff line number Diff line change
Expand Up @@ -3456,7 +3456,7 @@ def sort_sensitive_comparator(df1, df2):
)

# from issue #2365
arr = np.random.rand(2 ** 6)
arr = np.random.rand(2**6)
arr[::10] = np.nan
eval_general(
*create_test_series(arr),
Expand Down
6 changes: 3 additions & 3 deletions modin/test/pandas/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@
random_state = np.random.RandomState(seed=42)

DATASET_SIZE_DICT = {
"Small": (2 ** 2, 2 ** 3),
"Normal": (2 ** 6, 2 ** 8),
"Big": (2 ** 7, 2 ** 12),
"Small": (2**2, 2**3),
"Normal": (2**6, 2**8),
"Big": (2**7, 2**12),
}

# Size of test dataframes
Expand Down
4 changes: 2 additions & 2 deletions modin/test/test_envvar_npartitions.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
@pytest.mark.parametrize("num_partitions", [2, 4, 6, 8, 10])
def test_set_npartitions(num_partitions):
NPartitions.put(num_partitions)
data = np.random.randint(0, 100, size=(2 ** 16, 2 ** 8))
data = np.random.randint(0, 100, size=(2**16, 2**8))
df = pd.DataFrame(data)
part_shape = df._query_compiler._modin_frame._partitions.shape
assert part_shape[0] == num_partitions and part_shape[1] == min(num_partitions, 8)
Expand All @@ -31,7 +31,7 @@ def test_set_npartitions(num_partitions):
@pytest.mark.parametrize("right_num_partitions", [2, 4, 6, 8, 10])
def test_runtime_change_npartitions(left_num_partitions, right_num_partitions):
NPartitions.put(left_num_partitions)
data = np.random.randint(0, 100, size=(2 ** 16, 2 ** 8))
data = np.random.randint(0, 100, size=(2**16, 2**8))
left_df = pd.DataFrame(data)
part_shape = left_df._query_compiler._modin_frame._partitions.shape
assert part_shape[0] == left_num_partitions and part_shape[1] == min(
Expand Down
10 changes: 5 additions & 5 deletions modin/test/test_partition_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@

@pytest.mark.parametrize("axis", [None, 0, 1])
def test_unwrap_partitions(axis):
data = np.random.randint(0, 100, size=(2 ** 16, 2 ** 8))
data = np.random.randint(0, 100, size=(2**16, 2**8))
df = pd.DataFrame(data)

if axis is None:
Expand Down Expand Up @@ -108,8 +108,8 @@ def test_unwrap_partitions(axis):
@pytest.mark.parametrize("index", [None, "index"])
@pytest.mark.parametrize("axis", [None, 0, 1])
def test_from_partitions(axis, index, columns, row_lengths, column_widths):
num_rows = 2 ** 16
num_cols = 2 ** 8
num_rows = 2**16
num_cols = 2**8
data = np.random.randint(0, 100, size=(num_rows, num_cols))
df1, df2 = pandas.DataFrame(data), pandas.DataFrame(data)
expected_df = pandas.concat([df1, df2], axis=1 if axis is None else axis)
Expand Down Expand Up @@ -157,8 +157,8 @@ def test_from_partitions(axis, index, columns, row_lengths, column_widths):
@pytest.mark.parametrize("index", ["original_idx", "new_idx"])
@pytest.mark.parametrize("axis", [None, 0, 1])
def test_from_partitions_mismatched_labels(axis, index, columns):
num_rows = 2 ** 16
num_cols = 2 ** 8
num_rows = 2**16
num_cols = 2**8
expected_df = pd.DataFrame(np.random.randint(0, 100, size=(num_rows, num_cols)))
partitions = unwrap_partitions(expected_df, axis=axis)

Expand Down

0 comments on commit bd959b5

Please sign in to comment.