From 19d20eaba43f8baccf56c80fa7f2a93ae206701a Mon Sep 17 00:00:00 2001 From: sys_vdms Date: Thu, 26 Sep 2024 17:51:50 +0000 Subject: [PATCH] Automated updates: Format and/or coverage --- .../coverage/cpp.develop.coverage_report.txt | 4 +- .../coverage/cpp.develop.coverage_value.txt | 2 +- src/DescriptorsCommand.cc | 112 +++++++++--------- tests/python/TestDescriptors.py | 24 ++-- 4 files changed, 71 insertions(+), 71 deletions(-) diff --git a/.github/coverage/cpp.develop.coverage_report.txt b/.github/coverage/cpp.develop.coverage_report.txt index 3fe28e90..6e4c65e0 100644 --- a/.github/coverage/cpp.develop.coverage_report.txt +++ b/.github/coverage/cpp.develop.coverage_report.txt @@ -11,7 +11,7 @@ src/BackendNeo4j.cc 121 0 0% 4,6-17,20,24,2 src/BlobCommand.cc 87 66 75% 76,130-132,136-139,145,147,165,186-189,192-196,202 src/BoundingBoxCommand.cc 180 4 2% 45,49,51,53-54,56-59,62,64-67,70-73,76,83,87,90-91,93-97,101,103,105,114,118,122-123,125-132,137-138,140-144,147-150,152,154-160,162-165,167-169,171-173,176-177,179-181,183-184,186-187,190,193,196-197,199,201-204,206-210,213,215-219,222-223,225-227,229-237,240-244,246,251-256,259-261,263,265-266,268,270,272-274,276-277,281-283,286,288,292-294,296,298,300-303,307-308,310-313,316-319,321-326,329-330,335,338-339,341 src/CommunicationManager.cc 46 0 0% 42-43,46-47,49-50,52-54,57,61-66,68-71,73-81,84,86-88,93,96-97,100-101,105,107-108,110,113-116 -src/DescriptorsCommand.cc 670 107 16% 56,63-68,73,75-79,81-85,87,89,92-93,96-98,101,103-104,107-113,115,118,121,168-170,174,188-192,232-243,253,267-269,273,288-297,299,311-314,319,324-328,345,353,355-358,361,364-365,367-371,374,377,379-380,383-385,387-388,390-391,394-395,397-399,405,410-411,413,415-416,419,421-424,427-432,438-439,442,444-445,447,449-450,453,456,458,460,463,465-470,472-476,478,481,484-485,488-489,500,503,508,514-515,520-521,523-526,529,535-536,541-542,545-551,554,556-557,559,561-562,564-565,569,571-576,579-584,587,590-595,597,623-624,627-628,631,634,641-642,644-646,648,651-652,654,657,660,662-664,672,676,678,681,683-686,689-694,696-700,702,705,707,709,712,715-716,718,720,722-727,730,732-734,737-738,740,742,744-745,747,749,751-753,755,757-762,767-768,771,773,775,782-783,786,790,792,795,797-800,803-807,809-813,815,817-820,822-824,827,831-840,845-846,849,855,857,860-861,864,868,873,875,878,881-882,886,891,893,895,898,901-902,904-907,911,915-916,918,920-922,924,926-927,929,931-933,935-937,942-944,947-948,950,953-957,961,964,968,970-971,973-974,976,978-979,981-983,985,990,992-993,995-997,999-1000,1004,1006-1009,1011-1014,1019,1022-1024,1026,1028,1030-1033,1035-1039,1042-1043,1046,1048,1050,1052-1056,1059-1060,1063-1066,1068,1070-1077,1082,1084,1086-1087,1090-1093,1095,1097,1099-1106,1110-1115,1121,1124,1126,1128-1131,1134,1136,1139-1142,1144-1148,1154,1156,1158-1161,1166,1168,1170-1171,1174-1176,1178,1180,1182-1185,1188-1189,1191-1192,1194,1196-1197,1199-1205,1209-1210,1214-1215,1217-1218,1226-1227,1230-1231,1233,1235-1242,1246,1250-1251,1255-1259,1264-1265,1267 +src/DescriptorsCommand.cc 712 110 15% 56,63-68,73,75-79,81-85,87,89,92-93,96-98,101,103-104,107-113,115,118,121,168-170,174,188-192,243-254,264,272-275,289-291,295,310-319,321,333-336,341,347-351,368,376,378-381,384,387-388,390-394,397,400,402-403,406-408,410-411,413-414,417-418,420-422,428,433-434,436,438-439,442,444-447,450-455,461-462,465,467-468,470,472-473,476,480-481,483,485,488,490-495,497-501,503,506,509-510,513-514,525,528,533,539-540,545-546,548-551,554,560-561,566-567,570-576,579,581-582,584,586-587,589-590,594,596-601,604-609,612,615-618,621-622,624,626,629-630,633-634,637,640,647-648,650-652,654,657-658,660,663,666,668-670,678,682,684,687,689-692,695-700,702-706,708,711,713,715,718,721-722,724,726,728-733,736,738-740,743-744,746,748,750-751,753,755,757-759,761,763-768,773-774,777,779,781,788-789,792,796,798,801,803,805-808,811-815,817-821,823,825-828,830-832,835,839-848,853-854,857,863,865,868-869,872,876,881,883,886,889-890,894,900-904,906,911,914,917-918,920-923,927,931-932,934,936-938,940,942-943,945,947-949,951-953,958-960,963-967,970,973-975,978-980,982,984,989,997-1001,1005,1008,1015-1018,1020-1021,1023,1025-1026,1028-1030,1032,1037,1040-1041,1044-1047,1049-1050,1054,1056-1059,1061-1064,1069,1072-1074,1076,1078,1080,1082,1084-1087,1089-1093,1096-1097,1100,1102,1104,1106-1110,1113-1114,1117-1120,1122,1124-1131,1136,1138,1140-1141,1144-1147,1149,1151,1153-1160,1164-1169,1178,1180,1182-1185,1188,1190,1193-1196,1198-1202,1208,1210,1212-1215,1220,1222,1224-1225,1228-1230,1232-1235,1238-1239,1241-1244,1248-1250,1254,1258,1260-1263,1266-1267,1269-1270,1272,1274-1275,1277-1283,1287-1288,1292-1293,1295-1296,1304-1305,1308-1309,1311,1313-1320,1324,1328-1329,1333-1337,1342-1343,1345 src/DescriptorsManager.cc 24 19 79% 49-50,57-58,73 src/ExceptionsCommand.cc 6 0 0% 35-40 src/ImageCommand.cc 322 157 48% 55,59,63,65,67-69,71,73-76,78,81,86,88-89,97,99,106,109,111-112,114-115,117-118,120-121,124,151,162-163,174-175,177,182-185,195-196,198,203-206,221-229,231-233,246-247,257-267,269-270,272-273,278,286,297,304,308,311,313,315,337,339-340,343-348,350,352,374-376,379-381,385-388,394,396,403-406,420,427,433-436,440-441,452-455,458-463,468-470,481-484,489-493,498-499,501-502,504-508,511,513-517,520-523,526-527,530,532,537 @@ -57,5 +57,5 @@ utils/src/comm/Exception.cc 6 0 0% 35-40 utils/src/stats/SystemStats.cc 250 249 99% 453 utils/src/timers/TimerMap.cc 82 75 91% 126,151,153,155-158 ------------------------------------------------------------------------------ -TOTAL 10172 6513 64% +TOTAL 10237 6525 63% ------------------------------------------------------------------------------ diff --git a/.github/coverage/cpp.develop.coverage_value.txt b/.github/coverage/cpp.develop.coverage_value.txt index e525df55..32e44cbf 100644 --- a/.github/coverage/cpp.develop.coverage_value.txt +++ b/.github/coverage/cpp.develop.coverage_value.txt @@ -1 +1 @@ -64.0287 +63.7394 diff --git a/src/DescriptorsCommand.cc b/src/DescriptorsCommand.cc index ff036478..5d3a89d9 100644 --- a/src/DescriptorsCommand.cc +++ b/src/DescriptorsCommand.cc @@ -899,15 +899,15 @@ int FindDescriptor::construct_protobuf(PMGDQuery &query, Json::Value link_null; // null if (cmd.isMember("_ref")) { - cp_result["status"] = RSCommand::Error; - cp_result["info"] = "_ref is not supported for KNN search"; - return -1; + cp_result["status"] = RSCommand::Error; + cp_result["info"] = "_ref is not supported for KNN search"; + return -1; } const int k_neighbors = get_value(cmd, "k_neighbors", 0); - //This set query is a little weird and may be optimized away in the future - // as we no longer explicitly need the set links, however subsequent logic - //uses this to look up the path (again) in construct response + // This set query is a little weird and may be optimized away in the future + // as we no longer explicitly need the set links, however subsequent logic + // uses this to look up the path (again) in construct response int ref_set = query.get_available_reference(); // Query for the set and detect if exist during transaction. @@ -962,34 +962,34 @@ int FindDescriptor::construct_protobuf(PMGDQuery &query, Json::Value node_constraints = constraints; cp_result["ids_array"] = ids_array; - for (int i = 0; i < ids.size(); ++i){ - printf("IDS!\n"); - Json::Value k_node_constraints; - - //Theoretically this makes a deep copy - k_node_constraints = constraints; - - // Create a vector with a string and an integer - std::vector values; - values.push_back("=="); - values.push_back(ids[i]); - - // Add the vector to the JSON object with a key - Json::Value jsonArray(Json::arrayValue); - for (const auto& value : values) { - jsonArray.append(value); - } - k_node_constraints[desc_id_prop_name] = jsonArray; + for (int i = 0; i < ids.size(); ++i) { + printf("IDS!\n"); + Json::Value k_node_constraints; + + // Theoretically this makes a deep copy + k_node_constraints = constraints; - results["limit"] = 1; - //TODO UPDATE TO IGNORE LINK TO SET - //query.QueryNode(get_value(cmd, "_ref", -1), VDMS_DESC_TAG, - // link_to_set, k_node_constraints, results, false); + // Create a vector with a string and an integer + std::vector values; + values.push_back("=="); + values.push_back(ids[i]); - query.QueryNode(get_value(cmd, "_ref", -1), VDMS_DESC_TAG, - Json::nullValue, k_node_constraints, results, false); + // Add the vector to the JSON object with a key + Json::Value jsonArray(Json::arrayValue); + for (const auto &value : values) { + jsonArray.append(value); } - //TODO END MODS + k_node_constraints[desc_id_prop_name] = jsonArray; + + results["limit"] = 1; + // TODO UPDATE TO IGNORE LINK TO SET + // query.QueryNode(get_value(cmd, "_ref", -1), VDMS_DESC_TAG, + // link_to_set, k_node_constraints, results, false); + + query.QueryNode(get_value(cmd, "_ref", -1), VDMS_DESC_TAG, + Json::nullValue, k_node_constraints, results, false); + } + // TODO END MODS /*query.QueryNode(get_value(cmd, "_ref", -1), VDMS_DESC_TAG, link_to_set, node_constraints, results, false);*/ @@ -1171,8 +1171,8 @@ Json::Value FindDescriptor::construct_responses( } // Case (3) else { - //TODO POSSIBLE REMOVE - //assert(json_responses.size() == 2); + // TODO POSSIBLE REMOVE + // assert(json_responses.size() == 2); // Get Set info. const Json::Value &set_response = json_responses[0]; @@ -1228,32 +1228,32 @@ Json::Value FindDescriptor::construct_responses( IDDistancePair *pair = _cache_map[cache_obj_id]; ids = &(pair->first); distances = &(pair->second); - //TODO BEGIN MODS - Json::Value combined_tx_constraints; - Json::Value set_values; - Json::Value ent_values; - for (int i = 0; i < json_responses.size(); ++i){ - - // Create a vector with a string and an integer - if (i==0) - continue; - else{ - Json::Value desc_data; - for (auto ent : json_responses[i]["entities"]) - desc_data = ent; - ent_values.append(desc_data); - } - // Add the vector to the JSON object with a key + // TODO BEGIN MODS + Json::Value combined_tx_constraints; + Json::Value set_values; + Json::Value ent_values; + for (int i = 0; i < json_responses.size(); ++i) { + + // Create a vector with a string and an integer + if (i == 0) + continue; + else { + Json::Value desc_data; + for (auto ent : json_responses[i]["entities"]) + desc_data = ent; + ent_values.append(desc_data); } - set_values["status"] = 0; - set_values["returned"] = json_responses.size() - 1; - set_values["entities"] = ent_values; - //combined_tx_constraints.append(set_values); + // Add the vector to the JSON object with a key + } + set_values["status"] = 0; + set_values["returned"] = json_responses.size() - 1; + set_values["entities"] = ent_values; + // combined_tx_constraints.append(set_values); - //std::cout<<"modified pmgd output"<