diff --git a/morpheus/_lib/include/morpheus/messages/control.hpp b/morpheus/_lib/include/morpheus/messages/control.hpp index dc2d8a0f6c..e500399e06 100644 --- a/morpheus/_lib/include/morpheus/messages/control.hpp +++ b/morpheus/_lib/include/morpheus/messages/control.hpp @@ -576,8 +576,8 @@ struct ControlMessageProxy static pybind11::object get_meta(ControlMessage& self, pybind11::none none_obj); /** - * TODO(Documentation) - */ + * TODO(Documentation) + */ static void set_meta(ControlMessage& self, pybind11::object columns, pybind11::object value); }; diff --git a/morpheus/_lib/src/messages/control.cpp b/morpheus/_lib/src/messages/control.cpp index f83184b148..bb8ec845c5 100644 --- a/morpheus/_lib/src/messages/control.cpp +++ b/morpheus/_lib/src/messages/control.cpp @@ -524,8 +524,11 @@ pybind11::object ControlMessageProxy::get_meta(ControlMessage& self, pybind11::n return ControlMessageProxy::get_meta(self); } -std::tuple get_indexers(ControlMessage& self, py::object df, py::object columns, cudf::size_type num_rows) -{ +std::tuple get_indexers(ControlMessage& self, + py::object df, + py::object columns, + cudf::size_type num_rows) +{ auto row_indexer = pybind11::slice(pybind11::int_(0), pybind11::int_(num_rows), pybind11::none()); if (columns.is_none()) @@ -553,7 +556,7 @@ void ControlMessageProxy::set_meta(ControlMessage& self, pybind11::object column pybind11::gil_scoped_release no_gil; auto mutable_info = self.payload()->get_mutable_info(); - auto num_rows = mutable_info.num_rows(); + auto num_rows = mutable_info.num_rows(); // Need the GIL for the remainder pybind11::gil_scoped_acquire gil; diff --git a/morpheus/_lib/src/stages/add_classification.cpp b/morpheus/_lib/src/stages/add_classification.cpp index bfb83caf64..8f6aed300d 100644 --- a/morpheus/_lib/src/stages/add_classification.cpp +++ b/morpheus/_lib/src/stages/add_classification.cpp @@ -43,24 +43,22 @@ template class AddClassificationsStage; // ************ AddClassificationStageInterfaceProxy ************* // -std::shared_ptr> -AddClassificationStageInterfaceProxy::init_multi(mrc::segment::Builder& builder, - const std::string& name, - std::map idx2label, - float threshold) +std::shared_ptr> AddClassificationStageInterfaceProxy::init_multi( + mrc::segment::Builder& builder, + const std::string& name, + std::map idx2label, + float threshold) { - return builder.construct_object( - name, idx2label, threshold); + return builder.construct_object(name, idx2label, threshold); } -std::shared_ptr> -AddClassificationStageInterfaceProxy::init_cm(mrc::segment::Builder& builder, - const std::string& name, - std::map idx2label, - float threshold) +std::shared_ptr> AddClassificationStageInterfaceProxy::init_cm( + mrc::segment::Builder& builder, + const std::string& name, + std::map idx2label, + float threshold) { - return builder.construct_object( - name, idx2label, threshold); + return builder.construct_object(name, idx2label, threshold); } } // namespace morpheus diff --git a/morpheus/_lib/src/stages/add_scores.cpp b/morpheus/_lib/src/stages/add_scores.cpp index b4e7af679b..9238aa6d39 100644 --- a/morpheus/_lib/src/stages/add_scores.cpp +++ b/morpheus/_lib/src/stages/add_scores.cpp @@ -44,19 +44,14 @@ template class AddScoresStage; template class AddScoresStage; // ************ AddScoresStageInterfaceProxy ************* // -std::shared_ptr> -AddScoresStageInterfaceProxy::init_multi(mrc::segment::Builder& builder, - const std::string& name, - std::map idx2label) +std::shared_ptr> AddScoresStageInterfaceProxy::init_multi( + mrc::segment::Builder& builder, const std::string& name, std::map idx2label) { - return builder.construct_object(name, - std::move(idx2label)); + return builder.construct_object(name, std::move(idx2label)); } -std::shared_ptr> -AddScoresStageInterfaceProxy::init_cm(mrc::segment::Builder& builder, - const std::string& name, - std::map idx2label) +std::shared_ptr> AddScoresStageInterfaceProxy::init_cm( + mrc::segment::Builder& builder, const std::string& name, std::map idx2label) { return builder.construct_object(name, std::move(idx2label)); } diff --git a/morpheus/_lib/stages/module.cpp b/morpheus/_lib/stages/module.cpp index a897e60d4e..a1900eb3c8 100644 --- a/morpheus/_lib/stages/module.cpp +++ b/morpheus/_lib/stages/module.cpp @@ -74,10 +74,9 @@ PYBIND11_MODULE(stages, _module) mrc::pymrc::from_import(_module, "morpheus._lib.common", "FilterSource"); - py::class_< - mrc::segment::Object, - mrc::segment::ObjectProperties, - std::shared_ptr>>( + py::class_, + mrc::segment::ObjectProperties, + std::shared_ptr>>( _module, "AddClassificationsMultiResponseMessageStage", py::multiple_inheritance()) .def(py::init<>(&AddClassificationStageInterfaceProxy::init_multi), py::arg("builder"), diff --git a/morpheus/_lib/tests/stages/test_preprocess_fil.cpp b/morpheus/_lib/tests/stages/test_preprocess_fil.cpp index 075d7570b4..a01baeff91 100644 --- a/morpheus/_lib/tests/stages/test_preprocess_fil.cpp +++ b/morpheus/_lib/tests/stages/test_preprocess_fil.cpp @@ -76,8 +76,8 @@ TEST_F(TestPreprocessFIL, TestProcessControlMessageAndMultiMessage) EXPECT_EQ(cm_input__0_host, mm_input__0_host); std::vector expected_seq_ids = {0, 0, 1, 1, 0, 1, 2, 0, 1}; - auto cm_seq_ids = cm_tensors->get_tensor("seq_ids"); - auto mm_seq_ids = mm_tensors->get_tensor("seq_ids"); + auto cm_seq_ids = cm_tensors->get_tensor("seq_ids"); + auto mm_seq_ids = mm_tensors->get_tensor("seq_ids"); std::vector cm_seq_ids_host(cm_seq_ids.count()); std::vector mm_seq_ids_host(mm_seq_ids.count()); MRC_CHECK_CUDA(cudaMemcpy( diff --git a/morpheus/controllers/serialize_controller.py b/morpheus/controllers/serialize_controller.py index 093b464b98..0b3967fef2 100644 --- a/morpheus/controllers/serialize_controller.py +++ b/morpheus/controllers/serialize_controller.py @@ -16,8 +16,9 @@ import re import typing +from morpheus.messages import ControlMessage from morpheus.messages import MessageMeta -from morpheus.messages import MultiMessage, ControlMessage +from morpheus.messages import MultiMessage class SerializeController: diff --git a/morpheus/stages/postprocess/add_classifications_stage.py b/morpheus/stages/postprocess/add_classifications_stage.py index 6d6ae75345..40e37f264f 100644 --- a/morpheus/stages/postprocess/add_classifications_stage.py +++ b/morpheus/stages/postprocess/add_classifications_stage.py @@ -23,7 +23,6 @@ from morpheus.messages import ControlMessage from morpheus.stages.postprocess.add_scores_stage_base import AddScoresStageBase - logger = logging.getLogger(__name__) diff --git a/morpheus/stages/postprocess/add_scores_stage.py b/morpheus/stages/postprocess/add_scores_stage.py index 35dec7967e..3d83866052 100644 --- a/morpheus/stages/postprocess/add_scores_stage.py +++ b/morpheus/stages/postprocess/add_scores_stage.py @@ -17,10 +17,10 @@ import mrc -from morpheus.messages import ControlMessage from morpheus.cli.register_stage import register_stage from morpheus.common import TypeId from morpheus.config import Config +from morpheus.messages import ControlMessage from morpheus.stages.postprocess.add_scores_stage_base import AddScoresStageBase logger = logging.getLogger(__name__) diff --git a/morpheus/stages/postprocess/add_scores_stage_base.py b/morpheus/stages/postprocess/add_scores_stage_base.py index 63aabd4213..68e45a8831 100644 --- a/morpheus/stages/postprocess/add_scores_stage_base.py +++ b/morpheus/stages/postprocess/add_scores_stage_base.py @@ -20,9 +20,9 @@ import mrc import mrc.core.operators as ops -from morpheus.messages import ControlMessage from morpheus.common import TypeId from morpheus.config import Config +from morpheus.messages import ControlMessage from morpheus.messages import MultiResponseMessage from morpheus.pipeline.pass_thru_type_mixin import PassThruTypeMixin from morpheus.pipeline.single_port_stage import SinglePortStage diff --git a/morpheus/stages/postprocess/serialize_stage.py b/morpheus/stages/postprocess/serialize_stage.py index 610eae3b7e..e3ddc3b735 100644 --- a/morpheus/stages/postprocess/serialize_stage.py +++ b/morpheus/stages/postprocess/serialize_stage.py @@ -23,8 +23,9 @@ from morpheus.cli.register_stage import register_stage from morpheus.config import Config from morpheus.controllers.serialize_controller import SerializeController +from morpheus.messages import ControlMessage from morpheus.messages import MessageMeta -from morpheus.messages import MultiMessage, ControlMessage +from morpheus.messages import MultiMessage from morpheus.pipeline.single_port_stage import SinglePortStage from morpheus.pipeline.stage_schema import StageSchema diff --git a/morpheus/stages/preprocess/preprocess_fil_stage.py b/morpheus/stages/preprocess/preprocess_fil_stage.py index 2667257fbf..2fc036918b 100644 --- a/morpheus/stages/preprocess/preprocess_fil_stage.py +++ b/morpheus/stages/preprocess/preprocess_fil_stage.py @@ -24,15 +24,15 @@ import cudf import morpheus._lib.stages as _stages -from morpheus.messages import ControlMessage -from morpheus.messages import TensorMemory as CppTensorMemory from morpheus.cli.register_stage import register_stage from morpheus.config import Config from morpheus.config import PipelineModes +from morpheus.messages import ControlMessage from morpheus.messages import InferenceMemoryFIL from morpheus.messages import MultiInferenceFILMessage from morpheus.messages import MultiInferenceMessage from morpheus.messages import MultiMessage +from morpheus.messages import TensorMemory as CppTensorMemory from morpheus.stages.preprocess.preprocess_base_stage import PreprocessBaseStage logger = logging.getLogger(__name__) diff --git a/morpheus/stages/preprocess/preprocess_nlp_stage.py b/morpheus/stages/preprocess/preprocess_nlp_stage.py index 2a57a3c0ec..39add6a70f 100644 --- a/morpheus/stages/preprocess/preprocess_nlp_stage.py +++ b/morpheus/stages/preprocess/preprocess_nlp_stage.py @@ -25,18 +25,18 @@ import cudf import morpheus._lib.stages as _stages -# pylint: disable=morpheus-incorrect-lib-from-import -from morpheus.messages import TensorMemory as CppTensorMemory from morpheus.cli.register_stage import register_stage from morpheus.cli.utils import MorpheusRelativePath from morpheus.cli.utils import get_package_relative_file from morpheus.config import Config from morpheus.config import PipelineModes +# pylint: disable=morpheus-incorrect-lib-from-import from morpheus.messages import ControlMessage from morpheus.messages import InferenceMemoryNLP from morpheus.messages import MultiInferenceMessage from morpheus.messages import MultiInferenceNLPMessage from morpheus.messages import MultiMessage +from morpheus.messages import TensorMemory as CppTensorMemory from morpheus.stages.preprocess.preprocess_base_stage import PreprocessBaseStage from morpheus.utils.cudf_subword_helper import tokenize_text_series diff --git a/tests/_utils/stages/conv_msg.py b/tests/_utils/stages/conv_msg.py index e5e33d55e1..c7600aadba 100755 --- a/tests/_utils/stages/conv_msg.py +++ b/tests/_utils/stages/conv_msg.py @@ -22,11 +22,12 @@ import cudf +from morpheus._lib.messages import TensorMemory as CppTensorMemory from morpheus.cli.register_stage import register_stage from morpheus.config import Config -from morpheus._lib.messages import TensorMemory as CppTensorMemory +from morpheus.messages import ControlMessage from morpheus.messages import MultiMessage -from morpheus.messages import ControlMessage, MultiResponseMessage +from morpheus.messages import MultiResponseMessage from morpheus.messages import ResponseMemory from morpheus.pipeline.single_port_stage import SinglePortStage from morpheus.pipeline.stage_schema import StageSchema diff --git a/tests/stages/test_preprocess_fil_stage.py b/tests/stages/test_preprocess_fil_stage.py index c443f8fa66..eb6dc8b620 100644 --- a/tests/stages/test_preprocess_fil_stage.py +++ b/tests/stages/test_preprocess_fil_stage.py @@ -18,11 +18,11 @@ import cudf -from morpheus.messages import ControlMessage -from morpheus.messages import MultiMessage from morpheus.config import Config from morpheus.config import ConfigFIL +from morpheus.messages import ControlMessage from morpheus.messages import MessageMeta +from morpheus.messages import MultiMessage from morpheus.stages.preprocess.preprocess_fil_stage import PreprocessFILStage diff --git a/tests/stages/test_preprocess_nlp_stage.py b/tests/stages/test_preprocess_nlp_stage.py index f08582259e..9c2b5d4e39 100644 --- a/tests/stages/test_preprocess_nlp_stage.py +++ b/tests/stages/test_preprocess_nlp_stage.py @@ -21,10 +21,10 @@ import cudf -from morpheus.messages import ControlMessage -from morpheus.messages import MultiMessage from morpheus.config import Config +from morpheus.messages import ControlMessage from morpheus.messages import MessageMeta +from morpheus.messages import MultiMessage from morpheus.stages.preprocess.preprocess_nlp_stage import PreprocessNLPStage diff --git a/tests/test_add_classifications_stage.py b/tests/test_add_classifications_stage.py index b708cbf2aa..4f7ba8556c 100755 --- a/tests/test_add_classifications_stage.py +++ b/tests/test_add_classifications_stage.py @@ -20,9 +20,9 @@ import cudf from _utils.dataset_manager import DatasetManager -from morpheus.messages import ControlMessage -from morpheus.config import Config from morpheus._lib.messages import TensorMemory as CppTensorMemory +from morpheus.config import Config +from morpheus.messages import ControlMessage from morpheus.messages.memory.tensor_memory import TensorMemory from morpheus.messages.message_meta import MessageMeta from morpheus.messages.multi_response_message import MultiResponseMessage diff --git a/tests/test_add_classifications_stage_pipe.py b/tests/test_add_classifications_stage_pipe.py index 334dde7005..34acb6c0d6 100755 --- a/tests/test_add_classifications_stage_pipe.py +++ b/tests/test_add_classifications_stage_pipe.py @@ -21,8 +21,8 @@ from _utils import assert_results from _utils.stages.conv_msg import ConvMsg -from morpheus.messages import ControlMessage from morpheus.config import CppConfig +from morpheus.messages import ControlMessage from morpheus.messages import MessageMeta from morpheus.messages import MultiMessage from morpheus.messages import MultiResponseMessage diff --git a/tests/test_add_scores_stage.py b/tests/test_add_scores_stage.py index 1a8d6b74c5..41f08bab64 100755 --- a/tests/test_add_scores_stage.py +++ b/tests/test_add_scores_stage.py @@ -20,9 +20,9 @@ import cudf from _utils.dataset_manager import DatasetManager -from morpheus.messages import ControlMessage -from morpheus.config import Config from morpheus._lib.messages import TensorMemory as CppTensorMemory +from morpheus.config import Config +from morpheus.messages import ControlMessage from morpheus.messages.memory.tensor_memory import TensorMemory from morpheus.messages.message_meta import MessageMeta from morpheus.messages.multi_response_message import MultiResponseMessage diff --git a/tests/test_add_scores_stage_pipe.py b/tests/test_add_scores_stage_pipe.py index feb1e374c9..6987e5b2d9 100755 --- a/tests/test_add_scores_stage_pipe.py +++ b/tests/test_add_scores_stage_pipe.py @@ -23,7 +23,8 @@ from _utils import assert_results from _utils.dataset_manager import DatasetManager from _utils.stages.conv_msg import ConvMsg -from morpheus.config import Config, CppConfig +from morpheus.config import Config +from morpheus.config import CppConfig from morpheus.messages import ControlMessage from morpheus.messages import MessageMeta from morpheus.messages import MultiMessage