Repository: modin-project/modin

Issue:
Replace typo "scaler" with "scalar".
There's a [TODO](https://github.com/modin-project/modin/blob/25ea7fdcd3d7d61d8d80e775de0dbb031f5850c1/modin/pandas/indexing.py#L43) to replace several instances of "scaler" with "scalar" in modin/pandas/indexing.py. Also do the same in some test files.


Discussion:

Resolving patch:
diff --git a/modin/pandas/indexing.py b/modin/pandas/indexing.py
--- a/modin/pandas/indexing.py
+++ b/modin/pandas/indexing.py
@@ -40,9 +40,6 @@
 from .utils import is_scalar
 
 
-# TODO: rename "scaler" to scalar everywhere in this file
-
-
 def is_slice(x):
     """
     Check that argument is an instance of slice.
@@ -204,12 +201,12 @@ def _compute_ndim(row_loc, col_loc):
     {0, 1, 2}
         Number of dimensions in located dataset.
     """
-    row_scaler = is_scalar(row_loc) or is_tuple(row_loc)
-    col_scaler = is_scalar(col_loc) or is_tuple(col_loc)
+    row_scalar = is_scalar(row_loc) or is_tuple(row_loc)
+    col_scalar = is_scalar(col_loc) or is_tuple(col_loc)
 
-    if row_scaler and col_scaler:
+    if row_scalar and col_scalar:
         ndim = 0
-    elif row_scaler ^ col_scaler:
+    elif row_scalar ^ col_scalar:
         ndim = 1
     else:
         ndim = 2
@@ -230,8 +227,8 @@ class _LocationIndexerBase(object):
     def __init__(self, modin_df):
         self.df = modin_df
         self.qc = modin_df._query_compiler
-        self.row_scaler = False
-        self.col_scaler = False
+        self.row_scalar = False
+        self.col_scalar = False
 
     def __getitem__(self, row_lookup, col_lookup, ndim):
         """
@@ -254,7 +251,7 @@ def __getitem__(self, row_lookup, col_lookup, ndim):
         qc_view = self.qc.view(row_lookup, col_lookup)
         if ndim == 2:
             return self.df.__constructor__(query_compiler=qc_view)
-        if isinstance(self.df, Series) and not self.row_scaler:
+        if isinstance(self.df, Series) and not self.row_scalar:
             return self.df.__constructor__(query_compiler=qc_view)
         if isinstance(self.df, Series):
             axis = 0
@@ -263,9 +260,9 @@ def __getitem__(self, row_lookup, col_lookup, ndim):
         else:
             axis = (
                 None
-                if self.col_scaler and self.row_scaler
+                if self.col_scalar and self.row_scalar
                 else 1
-                if self.col_scaler
+                if self.col_scalar
                 else 0
             )
         return self.df.__constructor__(query_compiler=qc_view).squeeze(axis=axis)
@@ -400,7 +397,7 @@ def _write_items(self, row_lookup, col_lookup, item):
         new_qc = self.qc.write_items(row_lookup, col_lookup, item)
         self.df._create_or_update_from_compiler(new_qc, inplace=True)
 
-    def _determine_setitem_axis(self, row_lookup, col_lookup, row_scaler, col_scaler):
+    def _determine_setitem_axis(self, row_lookup, col_lookup, row_scalar, col_scalar):
         """
         Determine an axis along which we should do an assignment.
 
@@ -410,9 +407,9 @@ def _determine_setitem_axis(self, row_lookup, col_lookup, row_scaler, col_scaler
             Indexer for rows.
         col_lookup : slice or list
             Indexer for columns.
-        row_scaler : bool
+        row_scalar : bool
             Whether indexer for rows is scalar or not.
-        col_scaler : bool
+        col_scalar : bool
             Whether indexer for columns is scalar or not.
 
         Returns
@@ -427,7 +424,7 @@ def _determine_setitem_axis(self, row_lookup, col_lookup, row_scaler, col_scaler
         axis = None: assignment along both axes
         """
         if self.df.shape == (1, 1):
-            return None if not (row_scaler ^ col_scaler) else 1 if row_scaler else 0
+            return None if not (row_scalar ^ col_scalar) else 1 if row_scalar else 0
 
         def get_axis(axis):
             return self.qc.index if axis == 0 else self.qc.columns
@@ -531,8 +528,8 @@ def __getitem__(self, key):
             row_loc,
             col_loc,
             ndim,
-            self.row_scaler,
-            self.col_scaler,
+            self.row_scalar,
+            self.col_scalar,
         ) = self._parse_row_and_column_locators(key)
         if isinstance(row_loc, slice) and row_loc == slice(None):
             # If we're only slicing columns, handle the case with `__getitem__`
@@ -609,8 +606,8 @@ def __setitem__(self, key, item):
             row_loc,
             col_loc,
             _,
-            row_scaler,
-            col_scaler,
+            row_scalar,
+            col_scalar,
         ) = self._parse_row_and_column_locators(key)
         if isinstance(row_loc, list) and len(row_loc) == 1:
             if row_loc[0] not in self.qc.index:
@@ -634,7 +631,7 @@ def __setitem__(self, key, item):
                 col_lookup,
                 item,
                 axis=self._determine_setitem_axis(
-                    row_lookup, col_lookup, row_scaler, col_scaler
+                    row_lookup, col_lookup, row_scalar, col_scalar
                 ),
             )
 
@@ -759,8 +756,8 @@ def __getitem__(self, key):
             row_loc,
             col_loc,
             ndim,
-            self.row_scaler,
-            self.col_scaler,
+            self.row_scalar,
+            self.col_scalar,
         ) = self._parse_row_and_column_locators(key)
         self._check_dtypes(row_loc)
         self._check_dtypes(col_loc)
@@ -791,8 +788,8 @@ def __setitem__(self, key, item):
             row_loc,
             col_loc,
             _,
-            row_scaler,
-            col_scaler,
+            row_scalar,
+            col_scalar,
         ) = self._parse_row_and_column_locators(key)
         self._check_dtypes(row_loc)
         self._check_dtypes(col_loc)
@@ -803,7 +800,7 @@ def __setitem__(self, key, item):
             col_lookup,
             item,
             axis=self._determine_setitem_axis(
-                row_lookup, col_lookup, row_scaler, col_scaler
+                row_lookup, col_lookup, row_scalar, col_scalar
             ),
         )
 


Test patch:
diff --git a/modin/pandas/test/dataframe/test_indexing.py b/modin/pandas/test/dataframe/test_indexing.py
--- a/modin/pandas/test/dataframe/test_indexing.py
+++ b/modin/pandas/test/dataframe/test_indexing.py
@@ -184,7 +184,7 @@ def test_iloc(request, data):
     pandas_df = pandas.DataFrame(data)
 
     if not name_contains(request.node.name, ["empty_data"]):
-        # Scaler
+        # Scalar
         np.testing.assert_equal(modin_df.iloc[0, 1], pandas_df.iloc[0, 1])
 
         # Series
@@ -283,7 +283,7 @@ def test_loc(data):
 
     key1 = modin_df.columns[0]
     key2 = modin_df.columns[1]
-    # Scaler
+    # Scalar
     df_equals(modin_df.loc[0, key1], pandas_df.loc[0, key1])
 
     # Series
diff --git a/modin/pandas/test/dataframe/test_map_metadata.py b/modin/pandas/test/dataframe/test_map_metadata.py
--- a/modin/pandas/test/dataframe/test_map_metadata.py
+++ b/modin/pandas/test/dataframe/test_map_metadata.py
@@ -252,7 +252,7 @@ def test_at(data):
     pandas_df = pandas.DataFrame(data)
 
     key1 = modin_df.columns[0]
-    # Scaler
+    # Scalar
     df_equals(modin_df.at[0, key1], pandas_df.at[0, key1])
 
     # Series
diff --git a/modin/pandas/test/test_series.py b/modin/pandas/test/test_series.py
--- a/modin/pandas/test/test_series.py
+++ b/modin/pandas/test/test_series.py
@@ -1888,7 +1888,7 @@ def test_iloc(request, data):
     modin_series, pandas_series = create_test_series(data)
 
     if not name_contains(request.node.name, ["empty_data"]):
-        # Scaler
+        # Scalar
         np.testing.assert_equal(modin_series.iloc[0], pandas_series.iloc[0])
 
         # Series