From 69fdcb7b76d1ce78912fcd58e10166313c1ceb3f Mon Sep 17 00:00:00 2001 From: David Gardner Date: Fri, 1 Nov 2024 17:23:16 -0700 Subject: [PATCH] Clang-tidy fixes --- .../_lib/include/morpheus/utilities/stage_util.hpp | 1 + python/morpheus/morpheus/_lib/src/io/deserializers.cpp | 10 +++++----- python/morpheus/morpheus/_lib/src/objects/dtype.cpp | 6 +++--- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/python/morpheus/morpheus/_lib/include/morpheus/utilities/stage_util.hpp b/python/morpheus/morpheus/_lib/include/morpheus/utilities/stage_util.hpp index ce8ad6a7f3..48bf29445f 100644 --- a/python/morpheus/morpheus/_lib/include/morpheus/utilities/stage_util.hpp +++ b/python/morpheus/morpheus/_lib/include/morpheus/utilities/stage_util.hpp @@ -18,6 +18,7 @@ #pragma once #include +#include namespace morpheus { /****** Component public free function implementations************/ diff --git a/python/morpheus/morpheus/_lib/src/io/deserializers.cpp b/python/morpheus/morpheus/_lib/src/io/deserializers.cpp index 032cffd57b..7f4f7b5de1 100644 --- a/python/morpheus/morpheus/_lib/src/io/deserializers.cpp +++ b/python/morpheus/morpheus/_lib/src/io/deserializers.cpp @@ -39,10 +39,10 @@ // IWYU pragma: no_include namespace { -const std::regex IndexRegex(R"(^\s*(unnamed: 0|id)\s*$)", - std::regex_constants::ECMAScript | std::regex_constants::icase); +const std::regex INDEX_REGEX(R"(^\s*(unnamed: 0|id)\s*$)", + std::regex_constants::ECMAScript | std::regex_constants::icase); -const std::regex UnnamedRegex(R"(^\s*unnamed: 0\s*$)", std::regex_constants::ECMAScript | std::regex_constants::icase); +const std::regex UNNAMED_REGEX(R"(^\s*unnamed: 0\s*$)", std::regex_constants::ECMAScript | std::regex_constants::icase); } // namespace namespace morpheus { @@ -118,7 +118,7 @@ int get_index_col_count(const cudf::io::table_with_metadata& data_table) const auto& col_name = names[0]; // Check it against some common terms - if (std::regex_search(col_name, IndexRegex)) + if (std::regex_search(col_name, INDEX_REGEX)) { index_col_count = 1; } @@ -136,7 +136,7 @@ int prepare_df_index(cudf::io::table_with_metadata& data_table) auto& col_name = data_table.metadata.schema_info[0].name; // Also, if its the hideous 'Unnamed: 0', then just use an empty string - if (std::regex_search(col_name, UnnamedRegex)) + if (std::regex_search(col_name, UNNAMED_REGEX)) { col_name.clear(); } diff --git a/python/morpheus/morpheus/_lib/src/objects/dtype.cpp b/python/morpheus/morpheus/_lib/src/objects/dtype.cpp index 3f167b1e01..cbd803273f 100644 --- a/python/morpheus/morpheus/_lib/src/objects/dtype.cpp +++ b/python/morpheus/morpheus/_lib/src/objects/dtype.cpp @@ -28,7 +28,7 @@ #include namespace { -const std::map> StrToTypeId = { +const std::map> STR_TO_TYPE_ID = { {'b', {{1, morpheus::TypeId::BOOL8}}}, {'i', @@ -234,9 +234,9 @@ DType DType::from_numpy(const std::string& numpy_str) } // Now lookup in the map - auto found_type = StrToTypeId.find(type_char); + auto found_type = STR_TO_TYPE_ID.find(type_char); - if (found_type == StrToTypeId.end()) + if (found_type == STR_TO_TYPE_ID.end()) { throw std::invalid_argument(MORPHEUS_CONCAT_STR("Type char '" << type_char << "' not supported")); }