Skip to content

Commit

Permalink
Clang-tidy fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
dagardner-nv committed Nov 2, 2024
1 parent 51ee79b commit 69fdcb7
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#pragma once

#include <algorithm>
#include <vector>

namespace morpheus {
/****** Component public free function implementations************/
Expand Down
10 changes: 5 additions & 5 deletions python/morpheus/morpheus/_lib/src/io/deserializers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@
// IWYU pragma: no_include <pybind11/gil.h>

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 {
Expand Down Expand Up @@ -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;
}
Expand All @@ -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();
}
Expand Down
6 changes: 3 additions & 3 deletions python/morpheus/morpheus/_lib/src/objects/dtype.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#include <utility>

namespace {
const std::map<char, std::map<size_t, morpheus::TypeId>> StrToTypeId = {
const std::map<char, std::map<size_t, morpheus::TypeId>> STR_TO_TYPE_ID = {
{'b', {{1, morpheus::TypeId::BOOL8}}},

{'i',
Expand Down Expand Up @@ -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"));
}
Expand Down

0 comments on commit 69fdcb7

Please sign in to comment.