Skip to content

Commit

Permalink
fix docstrings again
Browse files Browse the repository at this point in the history
  • Loading branch information
noloerino committed Sep 12, 2024
1 parent a287f5f commit 4a066e1
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 6 deletions.
8 changes: 8 additions & 0 deletions modin/core/storage_formats/base/doc_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = (
Expand Down
28 changes: 22 additions & 6 deletions modin/core/storage_formats/base/query_compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 4a066e1

Please sign in to comment.