Skip to content

Commit

Permalink
try to fix doc
Browse files Browse the repository at this point in the history
  • Loading branch information
yczhang-nv committed Oct 10, 2024
1 parent 845183c commit 66b66c0
Showing 1 changed file with 27 additions and 14 deletions.
41 changes: 27 additions & 14 deletions python/morpheus/morpheus/stages/general/multi_processing_stage.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
class MultiProcessingBaseStage(SinglePortStage, typing.Generic[InputT, OutputT]):
"""
Base class for all MultiProcessing stages that make use of the SharedProcessPool.
Parameters
----------
c : `morpheus.config.Config`
Expand All @@ -43,8 +44,10 @@ class MultiProcessingBaseStage(SinglePortStage, typing.Generic[InputT, OutputT])
The number of progress engines used by the stage. If None, it will be set to 1.5 times the total
number of process pool workers
Raises:
ValueError: If the process pool usage is not between 0 and 1.
Raises
------
ValueError
If the process pool usage is not between 0 and 1.
"""

def __init__(self, *, c: Config, process_pool_usage: float, max_in_flight_messages: int = None):
Expand All @@ -68,11 +71,15 @@ def accepted_types(self) -> typing.Tuple:
"""
Accepted input types for this stage are returned.
Raises:
RuntimeError: if the accepted cannot be deducted from either __orig_class__ or __orig_bases__
Raises
------
RuntimeError
if the accepted cannot be deducted from either __orig_class__ or __orig_bases__
Returns:
typing.Tuple: accepted input types
Returns
------
typing.Tuple
accepted input types
"""

# There are two approaches to inherit from this class:
Expand Down Expand Up @@ -116,11 +123,15 @@ def compute_schema(self, schema: StageSchema):
"""
Compute the output schema for the stage.
Args:
schema (StageSchema): StageSchema
Parameters
----------
schema : StageSchema
The schema for the stage.
Raises:
RuntimeError: if the output type cannot be deducted from either __orig_class__ or __orig_bases__
Raises
------
RuntimeError
If the output type cannot be deduced from either __orig_class__ or __orig_bases__.
"""

# See the comment on `accepted_types` for more information on accessing the input and output types.
Expand Down Expand Up @@ -235,17 +246,19 @@ def create(*,
Parameters
----------
c : `morpheus.config.Config`
c : morpheus.config.Config
Pipeline configuration instance.
unique_name : str
A unique name for the stage.
process_fn: typing.Callable[[InputT], OutputT]
process_fn : typing.Callable[[InputT], OutputT]
The function that will be executed in the process pool.
process_pool_usage : float
The fraction of the process pool workers that this stage could use. Should be between 0 and 1.
Returns:
MultiProcessingStage[InputT, OutputT]: A MultiProcessingStage instance with deduced input and output types.
Returns
-------
MultiProcessingStage[InputT, OutputT]
A MultiProcessingStage instance with deduced input and output types.
"""

input_t, output_t = _get_func_signature(process_fn)
Expand Down

0 comments on commit 66b66c0

Please sign in to comment.