Skip to content

Commit

Permalink
Rename parameter hasHeader to has_header
Browse files Browse the repository at this point in the history
  • Loading branch information
vs9h authored and polyntsov committed Nov 24, 2023
1 parent 9504f4d commit c6ae612
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 15 deletions.
8 changes: 4 additions & 4 deletions src/tests/test_ac_algorithm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,14 @@ class ACAlgorithmTest : public ::testing::Test {
using ACExceptions = std::vector<algos::ACException>;

static algos::StdParamsMap GetParamMap(const std::filesystem::path& path, char separator,
bool hasHeader, algos::Binop bin_operation,
bool has_header, algos::Binop bin_operation,
double fuzziness, double p_fuzz, double weight,
size_t bumps_limit, size_t iterations_limit,
double seed) {
using namespace config::names;
return {{kCsvPath, path},
{kSeparator, separator},
{kHasHeader, hasHeader},
{kHasHeader, has_header},
{kBinaryOperation, bin_operation},
{kFuzziness, fuzziness},
{kFuzzinessProbability, p_fuzz},
Expand All @@ -71,13 +71,13 @@ class ACAlgorithmTest : public ::testing::Test {
}

static std::unique_ptr<algos::ACAlgorithm> CreateACAlgorithmInstance(
std::string_view path, char separator = ',', bool hasHeader = true,
std::string_view path, char separator = ',', bool has_header = true,
algos::Binop bin_operation = algos::Binop::Addition, double fuzziness = 0.1,
double p_fuzz = 0.9, double weight = 0.1, size_t bumps_limit = 0,
size_t iterations_limit = 10, double seed = 0) {
auto data = test_data_dir / path;
return algos::CreateAndLoadAlgorithm<algos::ACAlgorithm>(
GetParamMap(data, separator, hasHeader, bin_operation, fuzziness, p_fuzz, weight,
GetParamMap(data, separator, has_header, bin_operation, fuzziness, p_fuzz, weight,
bumps_limit, iterations_limit, seed));
}
};
Expand Down
2 changes: 1 addition & 1 deletion src/tests/test_algorithm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ namespace fs = std::filesystem;
* 1. extends FDAlgorithm
* 2. stores the results in FDAlgorithm::fd_collection_
* 3. has a constructor with signature: myAlgorithm(fs::path const& path, char separator, bool
* hasHeader)
* has_header)
*
* To test your algorithm, just:
* 1. include the header
Expand Down
16 changes: 8 additions & 8 deletions src/tests/test_apriori.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,11 @@ class ARAlgorithmTest : public ::testing::Test {
const std::filesystem::path& path,
unsigned int tidColumnIndex,
unsigned int itemColumnIndex, char separator = ',',
bool hasHeader = true) {
bool has_header = true) {
using namespace config::names;
return {{kCsvPath, path},
{kSeparator, separator},
{kHasHeader, hasHeader},
{kHasHeader, has_header},
{kInputFormat, +algos::InputFormat::singular},
{kMinimumSupport, minsup},
{kMinimumConfidence, minconf},
Expand All @@ -73,11 +73,11 @@ class ARAlgorithmTest : public ::testing::Test {

static algos::StdParamsMap GetParamMap(double minsup, double minconf,
const std::filesystem::path& path, bool firstColumnTid,
char separator = ',', bool hasHeader = true) {
char separator = ',', bool has_header = true) {
using namespace config::names;
return {{kCsvPath, path},
{kSeparator, separator},
{kHasHeader, hasHeader},
{kHasHeader, has_header},
{kInputFormat, +algos::InputFormat::tabular},
{kMinimumSupport, minsup},
{kMinimumConfidence, minconf},
Expand All @@ -87,16 +87,16 @@ class ARAlgorithmTest : public ::testing::Test {
static std::unique_ptr<algos::ARAlgorithm> CreateAlgorithmInstance(
double minsup, double minconf, const std::filesystem::path& path,
unsigned int tidColumnIndex, unsigned int itemColumnIndex, char separator = ',',
bool hasHeader = true) {
bool has_header = true) {
return algos::CreateAndLoadAlgorithm<algos::Apriori>(GetParamMap(
minsup, minconf, path, tidColumnIndex, itemColumnIndex, separator, hasHeader));
minsup, minconf, path, tidColumnIndex, itemColumnIndex, separator, has_header));
}

static std::unique_ptr<algos::ARAlgorithm> CreateAlgorithmInstance(
double minsup, double minconf, const std::filesystem::path& path, bool firstColumnTid,
char separator = ',', bool hasHeader = true) {
char separator = ',', bool has_header = true) {
return algos::CreateAndLoadAlgorithm<algos::Apriori>(
GetParamMap(minsup, minconf, path, firstColumnTid, separator, hasHeader));
GetParamMap(minsup, minconf, path, firstColumnTid, separator, has_header));
}
};

Expand Down
4 changes: 2 additions & 2 deletions src/tests/test_cfd_algos.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@ class CFDAlgorithmTest : public ::testing::Test {
static std::unique_ptr<algos::cfd::FDFirstAlgorithm> CreateAlgorithmInstance(
unsigned minsup, double minconf, const std::filesystem::path& path,
char const* substrategy, unsigned int max_lhs, unsigned columns_number = 0,
unsigned tuples_number = 0, char separator = ',', bool hasHeader = true) {
unsigned tuples_number = 0, char separator = ',', bool has_header = true) {
using namespace config::names;

algos::StdParamsMap params{
{kCsvPath, path},
{kSeparator, separator},
{kHasHeader, hasHeader},
{kHasHeader, has_header},
{kCfdMinimumSupport, minsup},
{kCfdMinimumConfidence, minconf},
{kCfdMaximumLhs, max_lhs},
Expand Down

0 comments on commit c6ae612

Please sign in to comment.