Skip to content

Commit

Permalink
Format changes
Browse files Browse the repository at this point in the history
  • Loading branch information
John Staib Matilla committed Jan 13, 2025
1 parent 6dd260b commit f37bcfd
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
1 change: 1 addition & 0 deletions modyn/storage/src/internal/file_watcher/file_watcher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ void FileWatcher::handle_file_paths(const std::vector<std::string>::iterator fil
const int64_t sample_dbinsertion_batchsize, const bool force_fallback,
std::atomic<bool>* exception_thrown) {
try {
// SPDLOG_INFO("File paths: [{}]", fmt::join(file_paths_begin, file_paths_end, ", "));
if (file_paths_begin >= file_paths_end) {
return;
}
Expand Down
16 changes: 16 additions & 0 deletions modyn/storage/src/internal/file_wrapper/csv_file_wrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,11 @@
#include <rapidcsv.h>

#include <algorithm>
#include <cassert> // Include for ASSERT or use your custom assert macro
#include <iostream> // Include required for std::cout
#include <numeric>
#include <stdexcept>
#include <vector>

using namespace modyn::storage;

Expand Down Expand Up @@ -57,6 +60,19 @@ std::vector<std::vector<unsigned char>> CsvFileWrapper::get_samples(uint64_t sta

std::vector<std::vector<unsigned char>> CsvFileWrapper::get_samples_from_indices(const std::vector<uint64_t>& indices,
bool include_labels) {
// Print include_labels
std::cout << "include_labels: " << (include_labels ? "true" : "false") << std::endl;

// Print indices
std::cout << "Indices: ";
for (const auto& index : indices) {
std::cout << index << " ";
}
std::cout << std::endl;

// Print number of samples
uint64_t num_samples = get_number_of_samples();
std::cout << "Number of samples: " << num_samples << std::endl;
ASSERT(std::all_of(indices.begin(), indices.end(), [&](uint64_t index) { return index < get_number_of_samples(); }),
"Invalid indices");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ std::vector<std::vector<unsigned char>> SingleSampleFileWrapper::get_samples(uin
}

std::vector<std::vector<unsigned char>> SingleSampleFileWrapper::get_samples_from_indices(
const std::vector<uint64_t>& indices, bool include_labels = true) {
const std::vector<uint64_t>& indices, bool include_labels) {
ASSERT(indices.size() == 1 && indices[0] == 0,
fmt::format("Single sample file wrappers can only access the first sample. file_path = {}, indices.size() = "
"{}, indices = [{}]",
Expand Down

0 comments on commit f37bcfd

Please sign in to comment.