<commit_before>#include <cmdstan/stansummary_helper.hpp>
#include <stan/io/stan_csv_reader.hpp>
#include <stan/services/error_codes.hpp>
#include <stan/mcmc/chains.hpp>
#include <test/utility.hpp>
#include <gtest/gtest.h>

TEST(interface, output_multi) {
  std::vector<std::string> model_path;
  model_path.push_back("src");
  model_path.push_back("test");
  model_path.push_back("test-models");
  model_path.push_back("test_model");

  std::string command
      = cmdstan::test::convert_model_path(model_path)
        + " sample num_warmup=200 num_samples=1 num_chains=2 random seed=1234" + " output file="
        + cmdstan::test::convert_model_path(model_path) + ".csv";

  cmdstan::test::run_command_output out = cmdstan::test::run_command(command);
  EXPECT_EQ(int(stan::services::error_codes::OK), out.err_code);
  EXPECT_FALSE(out.hasError);
  {
    std::string csv_file
        = cmdstan::test::convert_model_path(model_path) + "_1.csv";
    std::vector<std::string> filenames;
    filenames.push_back(csv_file);
    stan::io::stan_csv_metadata metadata;
    Eigen::VectorXd warmup_times(filenames.size());
    Eigen::VectorXd sampling_times(filenames.size());
    Eigen::VectorXi thin(filenames.size());
    stan::mcmc::chains<> chains = parse_csv_files(
        filenames, metadata, warmup_times, sampling_times, thin, &std::cout);
    constexpr std::array<const char*, 9> names{"lp__", "accept_stat__", "stepsize__", "treedepth__", "n_leapfrog__",
     "divergent__", "energy__", "mu1", "mu2",};
    const auto chain_param_names = chains.param_names();
    for (size_t i = 0; i < 9; ++i) {
      EXPECT_EQ(names[i], chain_param_names[i]);
    }
  }
  {
    std::string csv_file
        = cmdstan::test::convert_model_path(model_path) + "_2.csv";
    std::vector<std::string> filenames;
    filenames.push_back(csv_file);
    stan::io::stan_csv_metadata metadata;
    Eigen::VectorXd warmup_times(filenames.size());
    Eigen::VectorXd sampling_times(filenames.size());
    Eigen::VectorXi thin(filenames.size());
    stan::mcmc::chains<> chains = parse_csv_files(
        filenames, metadata, warmup_times, sampling_times, thin, &std::cout);
    constexpr std::array<const char*, 9> names{"lp__", "accept_stat__", "stepsize__", "treedepth__", "n_leapfrog__",
     "divergent__", "energy__", "mu1", "mu2",};
    const auto chain_param_names = chains.param_names();
    for (size_t i = 0; i < 9; ++i) {
      EXPECT_EQ(names[i], chain_param_names[i]);
    }
  }
}
<commit_msg>[Jenkins] auto-formatting by clang-format version 6.0.0-1ubuntu2~16.04.1 (tags/RELEASE_600/final)<commit_after>#include <cmdstan/stansummary_helper.hpp>
#include <stan/io/stan_csv_reader.hpp>
#include <stan/services/error_codes.hpp>
#include <stan/mcmc/chains.hpp>
#include <test/utility.hpp>
#include <gtest/gtest.h>

TEST(interface, output_multi) {
  std::vector<std::string> model_path;
  model_path.push_back("src");
  model_path.push_back("test");
  model_path.push_back("test-models");
  model_path.push_back("test_model");

  std::string command
      = cmdstan::test::convert_model_path(model_path)
        + " sample num_warmup=200 num_samples=1 num_chains=2 random seed=1234"
        + " output file=" + cmdstan::test::convert_model_path(model_path)
        + ".csv";

  cmdstan::test::run_command_output out = cmdstan::test::run_command(command);
  EXPECT_EQ(int(stan::services::error_codes::OK), out.err_code);
  EXPECT_FALSE(out.hasError);
  {
    std::string csv_file
        = cmdstan::test::convert_model_path(model_path) + "_1.csv";
    std::vector<std::string> filenames;
    filenames.push_back(csv_file);
    stan::io::stan_csv_metadata metadata;
    Eigen::VectorXd warmup_times(filenames.size());
    Eigen::VectorXd sampling_times(filenames.size());
    Eigen::VectorXi thin(filenames.size());
    stan::mcmc::chains<> chains = parse_csv_files(
        filenames, metadata, warmup_times, sampling_times, thin, &std::cout);
    constexpr std::array<const char*, 9> names{
        "lp__",        "accept_stat__", "stepsize__",
        "treedepth__", "n_leapfrog__",  "divergent__",
        "energy__",    "mu1",           "mu2",
    };
    const auto chain_param_names = chains.param_names();
    for (size_t i = 0; i < 9; ++i) {
      EXPECT_EQ(names[i], chain_param_names[i]);
    }
  }
  {
    std::string csv_file
        = cmdstan::test::convert_model_path(model_path) + "_2.csv";
    std::vector<std::string> filenames;
    filenames.push_back(csv_file);
    stan::io::stan_csv_metadata metadata;
    Eigen::VectorXd warmup_times(filenames.size());
    Eigen::VectorXd sampling_times(filenames.size());
    Eigen::VectorXi thin(filenames.size());
    stan::mcmc::chains<> chains = parse_csv_files(
        filenames, metadata, warmup_times, sampling_times, thin, &std::cout);
    constexpr std::array<const char*, 9> names{
        "lp__",        "accept_stat__", "stepsize__",
        "treedepth__", "n_leapfrog__",  "divergent__",
        "energy__",    "mu1",           "mu2",
    };
    const auto chain_param_names = chains.param_names();
    for (size_t i = 0; i < 9; ++i) {
      EXPECT_EQ(names[i], chain_param_names[i]);
    }
  }
}

{'fraction_non_alphanumeric': 0.15793558401241753, 'fraction_numerical': 0.010671323244082266, 'mean_word_length': 4.56695464362851, 'pattern_counts': {'":': 0, '<': 33, '<?xml version=': 0, '>': 29, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5203249', 'n_tokens_mistral': 1909, 'n_tokens_neox': 1861, 'n_words': 286}