Skip to content

Commit

Permalink
DOCS-modin-project#2420: Changed documentation to numpydoc style
Browse files Browse the repository at this point in the history
Signed-off-by: Mohammed Kashif <[email protected]>
  • Loading branch information
Mohammed Kashif committed Nov 14, 2020
1 parent 5c9398c commit d61c478
Show file tree
Hide file tree
Showing 5 changed files with 278 additions and 155 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ jobs:
- run: pydocstyle --convention=numpy --add-ignore=D101,D102 modin/pandas/series_utils.py
- run: pydocstyle --convention=numpy --add-ignore=D103 modin/pandas/general.py
- run: pydocstyle --convention=numpy modin/pandas/plotting.py modin/pandas/utils.py modin/pandas/iterator.py modin/pandas/indexing.py
- run: pydocstyle --convention=numpy --add-ignore=D100,D104 modin/engines/base/frame

lint-flake8:
name: lint (flake8)
Expand Down
57 changes: 33 additions & 24 deletions modin/engines/base/frame/axis_partition.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@


class BaseFrameAxisPartition(object): # pragma: no cover
"""This abstract class represents the Parent class for any
`ColumnPartition` or `RowPartition` class. This class is intended to
simplify the way that operations are performed
"""An abstract class that represents the Parent class for any `ColumnPartition` or `RowPartition` class.
This class is intended to simplify the way that operations are performed.
Note 0: The procedures that use this class and its methods assume that
they have some global knowledge about the entire axis. This may
Expand All @@ -46,7 +46,7 @@ def apply(
maintain_partitioning=True,
**kwargs,
):
"""Applies a function to a full axis.
"""Apply a function to a full axis.
Note: The procedures that invoke this method assume full axis
knowledge. Implement this method accordingly.
Expand All @@ -69,7 +69,8 @@ def apply(
orientation (the lengths will remain the same). This is ignored between
two axis partitions.
Returns:
Returns
-------
A list of `BaseFramePartition` objects.
"""
raise NotImplementedError(NOT_IMPLMENTED_MESSAGE)
Expand All @@ -81,7 +82,8 @@ def shuffle(self, func, lengths, **kwargs):
func: The function to apply before splitting.
lengths: The list of partition lengths to split the result into.
Returns:
Returns
-------
A list of RemotePartition objects split by `lengths`.
"""
raise NotImplementedError(NOT_IMPLMENTED_MESSAGE)
Expand All @@ -95,9 +97,9 @@ def _wrap_partitions(self, partitions):


class PandasFrameAxisPartition(BaseFrameAxisPartition):
"""This abstract class is created to simplify and consolidate the code for
AxisPartitions that run pandas. Because much of the code is similar, this allows
us to reuse this code.
"""An abstract class is created to simplify and consolidate the code for AxisPartitions that run pandas.
Because much of the code is similar, this allows us to reuse this code.
Subclasses must implement `list_of_blocks` which unwraps the `RemotePartition`
objects and creates something interpretable as a pandas DataFrame.
Expand All @@ -115,23 +117,28 @@ def apply(
maintain_partitioning=True,
**kwargs,
):
"""Applies func to the object in the plasma store.
"""Apply func to the object in the plasma store.
See notes in Parent class about this method.
Args:
func: The function to apply.
num_splits: The number of times to split the result object.
other_axis_partition: Another `PandasOnRayFrameAxisPartition` object to apply to
func with this one.
maintain_partitioning: Whether or not to keep the partitioning in the same
orientation as it was previously. This is important because we may be
operating on an individual AxisPartition and not touching the rest.
In this case, we have to return the partitioning to its previous
orientation (the lengths will remain the same). This is ignored between
two axis partitions.
Parameters
----------
func: callable
The function to apply.
num_splits: int
The number of times to split the result object.
other_axis_partition: PandasOnRayFrameAxisPartition object
Another `PandasOnRayFrameAxisPartition` object to apply to func with this one.
maintain_partitioning: boolean
Whether or not to keep the partitioning in the same
orientation as it was previously. This is important because we may be
operating on an individual AxisPartition and not touching the rest.
In this case, we have to return the partitioning to its previous
orientation (the lengths will remain the same). This is ignored between
two axis partitions.
Returns:
Returns
-------
A list of `RayRemotePartition` objects.
"""
if num_splits is None:
Expand Down Expand Up @@ -177,7 +184,8 @@ def shuffle(self, func, lengths, **kwargs):
func: The function to apply before splitting.
lengths: The list of partition lengths to split the result into.
Returns:
Returns
-------
A list of RemotePartition objects split by `lengths`.
"""
num_splits = len(lengths)
Expand All @@ -204,7 +212,8 @@ def deploy_axis_func(
If False, create a new partition layout.
partitions: All partitions that make up the full axis (row or column)
Returns:
Returns
-------
A list of Pandas DataFrames.
"""
# Pop these off first because they aren't expected by the function.
Expand Down
Loading

0 comments on commit d61c478

Please sign in to comment.