From 4a066e1ae2a4fcae5a5978b4041a9d87fafe0832 Mon Sep 17 00:00:00 2001 From: Jonathan Shi Date: Thu, 12 Sep 2024 14:29:48 -0700 Subject: [PATCH] fix docstrings again --- modin/core/storage_formats/base/doc_utils.py | 8 ++++++ .../storage_formats/base/query_compiler.py | 28 +++++++++++++++---- 2 files changed, 30 insertions(+), 6 deletions(-) diff --git a/modin/core/storage_formats/base/doc_utils.py b/modin/core/storage_formats/base/doc_utils.py index ce0f3935731..6ba7a98a7f7 100644 --- a/modin/core/storage_formats/base/doc_utils.py +++ b/modin/core/storage_formats/base/doc_utils.py @@ -193,6 +193,14 @@ def doc_binary_method(operation, sign, self_on_right=False, op_type="arithmetic" fill_value : float or None Value to fill missing elements during frame alignment. """, + "series_comparison": """ + level : int or label + In case of MultiIndex match index values on the passed level. + fill_value : float or None + Value to fill missing elements during frame alignment. + axis : {{0, 1}} + Unused. Parameter needed for compatibility with DataFrame. + """, } verbose_substitution = ( diff --git a/modin/core/storage_formats/base/query_compiler.py b/modin/core/storage_formats/base/query_compiler.py index 5566a4570d8..925d8bec866 100644 --- a/modin/core/storage_formats/base/query_compiler.py +++ b/modin/core/storage_formats/base/query_compiler.py @@ -647,7 +647,9 @@ def combine_first(self, other, **kwargs): # noqa: PR02 def eq(self, other, **kwargs): # noqa: PR02 return BinaryDefault.register(pandas.DataFrame.eq)(self, other=other, **kwargs) - @doc_utils.add_refer_to("Series.eq") + @doc_utils.doc_binary_method( + operation="equality comparison", sign="==", op_type="series_comparison" + ) def series_eq(self, other, **kwargs): return BinaryDefault.register(pandas.Series.eq)( self, @@ -695,7 +697,11 @@ def divmod(self, other, **kwargs): def ge(self, other, **kwargs): # noqa: PR02 return BinaryDefault.register(pandas.DataFrame.ge)(self, other=other, **kwargs) - @doc_utils.add_refer_to("Series.ge") + @doc_utils.doc_binary_method( + operation="greater than or equal comparison", + sign=">=", + op_type="series_comparison", + ) def series_ge(self, other, **kwargs): return BinaryDefault.register(pandas.Series.ge)( self, @@ -711,7 +717,9 @@ def series_ge(self, other, **kwargs): def gt(self, other, **kwargs): # noqa: PR02 return BinaryDefault.register(pandas.DataFrame.gt)(self, other=other, **kwargs) - @doc_utils.add_refer_to("Series.gt") + @doc_utils.doc_binary_method( + operation="greater than comparison", sign=">", op_type="series_comparison" + ) def series_gt(self, other, **kwargs): return BinaryDefault.register(pandas.Series.gt)( self, @@ -727,7 +735,11 @@ def series_gt(self, other, **kwargs): def le(self, other, **kwargs): # noqa: PR02 return BinaryDefault.register(pandas.DataFrame.le)(self, other=other, **kwargs) - @doc_utils.add_refer_to("Series.le") + @doc_utils.doc_binary_method( + operation="less than or equal comparison", + sign="<=", + op_type="series_comparison", + ) def series_le(self, other, **kwargs): return BinaryDefault.register(pandas.Series.le)( self, @@ -743,7 +755,9 @@ def series_le(self, other, **kwargs): def lt(self, other, **kwargs): # noqa: PR02 return BinaryDefault.register(pandas.DataFrame.lt)(self, other=other, **kwargs) - @doc_utils.add_refer_to("Series.lt") + @doc_utils.doc_binary_method( + operation="less than", sign="<", op_type="series_comparison" + ) def series_lt(self, other, **kwargs): return BinaryDefault.register(pandas.Series.lt)( self, @@ -868,7 +882,9 @@ def dot(self, other, **kwargs): # noqa: PR02 def ne(self, other, **kwargs): # noqa: PR02 return BinaryDefault.register(pandas.DataFrame.ne)(self, other=other, **kwargs) - @doc_utils.add_refer_to("Series.ne") + @doc_utils.doc_binary_method( + operation="not equal comparison", sign="!=", op_type="series_comparison" + ) def series_ne(self, other, **kwargs): return BinaryDefault.register(pandas.Series.ne)( self,