Skip to content

Commit

Permalink
Update docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
dagardner-nv committed Jan 26, 2024
1 parent 9ac1ec4 commit baf3e21
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 4 deletions.
19 changes: 16 additions & 3 deletions morpheus/_lib/include/morpheus/stages/deserialize.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,6 @@

namespace morpheus {
/****** Component public implementations *******************/
/****** DeserializationStage********************************/
using namespace std::literals::string_literals;

/**
* @addtogroup stages
Expand All @@ -66,6 +64,7 @@ void make_output_message(std::shared_ptr<MultiMessage>& full_message,
cm_task_t* task,
std::shared_ptr<ControlMessage>& windowed_message);

/****** DeserializationStage********************************/
template <typename OutputT>
class DeserializeStage : public mrc::pymrc::PythonNode<std::shared_ptr<MessageMeta>, std::shared_ptr<OutputT>>
{
Expand All @@ -80,6 +79,7 @@ class DeserializeStage : public mrc::pymrc::PythonNode<std::shared_ptr<MessageMe
*
* @param batch_size Number of messages to be divided into each batch
* @param ensure_sliceable_index Whether or not to call `ensure_sliceable_index()` on all incoming `MessageMeta`
* @param task Optional task to be added to all outgoing `ControlMessage`s, ignored when `OutputT` is `MultiMessage`
*/
DeserializeStage(TensorIndex batch_size,
bool ensure_sliceable_index = true,
Expand Down Expand Up @@ -109,11 +109,24 @@ struct DeserializeStageInterfaceProxy
* @param builder : Pipeline context object reference
* @param name : Name of a stage reference
* @param batch_size : Number of messages to be divided into each batch
* @return std::shared_ptr<mrc::segment::Object<DeserializeStage>>
* @param ensure_sliceable_index Whether or not to call `ensure_sliceable_index()` on all incoming `MessageMeta`
* @return std::shared_ptr<mrc::segment::Object<DeserializeStage<MultiMessage>>>
*/
static std::shared_ptr<mrc::segment::Object<DeserializeStage<MultiMessage>>> init_multi(
mrc::segment::Builder& builder, const std::string& name, TensorIndex batch_size, bool ensure_sliceable_index);

/**
* @brief Create and initialize a DeserializationStage that emits ControlMessage's, and return the result.
* If `task_type` is not None, `task_payload` must also be not None, and vice versa.
*
* @param builder : Pipeline context object reference
* @param name : Name of a stage reference
* @param batch_size : Number of messages to be divided into each batch
* @param ensure_sliceable_index Whether or not to call `ensure_sliceable_index()` on all incoming `MessageMeta`
* @param task_type : Optional task type to be added to all outgoing messages
* @param task_payload : Optional json object describing the task to be added to all outgoing messages
* @return std::shared_ptr<mrc::segment::Object<DeserializeStage<ControlMessage>>>
*/
static std::shared_ptr<mrc::segment::Object<DeserializeStage<ControlMessage>>> init_cm(
mrc::segment::Builder& builder,
const std::string& name,
Expand Down
12 changes: 11 additions & 1 deletion morpheus/stages/preprocess/deserialize_stage.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,17 @@ class DeserializeStage(MultiMessageStage):
----------
c : `morpheus.config.Config`
Pipeline configuration instance.
ensure_sliceable_index : bool, default = True
Whether or not to call `ensure_sliceable_index()` on all incoming `MessageMeta`, which will replace the index
of the underlying dataframe if the existing one is not unique and monotonic.
message_type : typing.Literal[MultiMessage, ControlMessage], default = MultiMessage
Sets the type of message to be emitted from this stage.
task_type : str, default = None
If specified, adds the specified task to the `ControlMessage`. This parameter is only valid when `message_type`
is set to `ControlMessage`. If not `None`, `task_payload` must also be specified.
task_payload : dict, default = None
If specified, adds the specified task to the `ControlMessage`. This parameter is only valid when `message_type`
is set to `ControlMessage`. If not `None`, `task_type` must also be specified.
"""

def __init__(self,
Expand Down

0 comments on commit baf3e21

Please sign in to comment.