Skip to content

Commit

Permalink
Clean includes and remove dead code
Browse files Browse the repository at this point in the history
  • Loading branch information
robomics committed Nov 13, 2024
1 parent e4d5536 commit 4f2a87e
Show file tree
Hide file tree
Showing 10 changed files with 18 additions and 77 deletions.
6 changes: 2 additions & 4 deletions src/io/include/nchg/k_merger.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,16 @@
#include <utility>
#include <vector>

#include "hictk/pixel.hpp"

namespace nchg {

/// This class is basically a wrapper around a priority queue of objects of type Node, and can be
/// used to merge two or more sorted sequences of objects.
/// Node consist of an object and an index.
/// Nodes consist of an object and an index.
/// The object should be comparable with objects of the same type to determine which comes first in
/// a sorted sequence.
/// The index represents from which iterator the object was read.
/// This allows us to know from which iterator we should read the next object (i.e. the same
/// iterator from which the top pixel originated)
/// iterator from which the top node originated)
template <typename It>
class KMerger {
using ItInternal = std::remove_cvref_t<It>;
Expand Down
18 changes: 1 addition & 17 deletions src/io/include/nchg/parquet_stats_file.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,8 @@
#include "nchg/suppress_warnings.hpp"
NCHG_DISABLE_WARNING_PUSH
NCHG_DISABLE_WARNING_DEPRECATED_DECLARATIONS
#include <arrow/array/array_base.h>
#include <arrow/builder.h>
#include <arrow/record_batch.h>
#include <arrow/type_fwd.h>
#include <arrow/io/file.h>
#include <parquet/stream_reader.h>
#include <parallel_hashmap/phmap.h>
NCHG_DISABLE_WARNING_POP
// clang-format on

Expand Down Expand Up @@ -105,18 +101,6 @@ class ParquetStatsFile {
};
};

template <std::size_t NTOKS>
[[nodiscard]] std::string_view truncate_record(std::string_view record, char sep = '\t');

namespace internal {

[[nodiscard]] std::shared_ptr<arrow::Schema> get_schema(const hictk::Reference &chroms);
[[nodiscard]] std::shared_ptr<arrow::Schema> get_schema_padj(const hictk::Reference &chroms);

[[nodiscard]] parquet::Compression::type parse_parquet_compression(std::string_view method);

} // namespace internal

} // namespace nchg

#include "../../parquet_stats_file_impl.hpp"
8 changes: 2 additions & 6 deletions src/io/include/nchg/record_batch_builder.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,18 @@ NCHG_DISABLE_WARNING_PUSH
NCHG_DISABLE_WARNING_DEPRECATED_DECLARATIONS
#include <arrow/builder.h>
#include <arrow/record_batch.h>
#include <arrow/type_fwd.h>
#include <parquet/arrow/writer.h>
#include <parallel_hashmap/phmap.h>
NCHG_DISABLE_WARNING_POP
// clang-format on

#include <cstddef>
#include <cstdint>
#include <filesystem>
#include <hictk/chromosome.hpp>
#include <hictk/reference.hpp>
#include <memory>
#include <string_view>
#include <type_traits>
#include <vector>

namespace nchg {

Expand Down Expand Up @@ -93,9 +92,6 @@ template <typename Record>
const hictk::Reference &chroms, const std::filesystem::path &path, bool force,
std::string_view compression_method, std::uint8_t compression_lvl, std::size_t threads);

[[nodiscard]] phmap::flat_hash_map<hictk::Chromosome, std::vector<bool>> parse_bin_mask(
const hictk::Reference &chroms, std::uint32_t bin_size, const std::filesystem::path &path);

} // namespace nchg

#include "../../record_batch_builder_impl.hpp"
4 changes: 2 additions & 2 deletions src/io/k_merger_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@

#pragma once

#include <algorithm>
#include <cassert>
#include <optional>
#include <utility>
#include <vector>

#include "hictk/pixel.hpp"

namespace nchg {

template <typename It>
Expand Down
1 change: 0 additions & 1 deletion src/io/parquet_helpers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ NCHG_DISABLE_WARNING_PUSH
NCHG_DISABLE_WARNING_DEPRECATED_DECLARATIONS
#include <arrow/type.h>
#include <arrow/util/key_value_metadata.h>
#include <parallel_hashmap/phmap.h>
#include <parquet/platform.h>
NCHG_DISABLE_WARNING_POP
// clang-format on
Expand Down
6 changes: 2 additions & 4 deletions src/io/parquet_stats_file.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,12 @@
#include "nchg/suppress_warnings.hpp"
NCHG_DISABLE_WARNING_PUSH
NCHG_DISABLE_WARNING_DEPRECATED_DECLARATIONS
#include <arrow/array.h>
#include <arrow/builder.h>
#include <arrow/record_batch.h>
#include <arrow/type.h>
#include <arrow/io/file.h>
#include <arrow/util/key_value_metadata.h>
#include <parquet/arrow/reader.h>
#include <parquet/properties.h>
#include <parquet/file_reader.h>
#include <parquet/stream_reader.h>
NCHG_DISABLE_WARNING_POP
// clang-format on
Expand All @@ -46,7 +45,6 @@ NCHG_DISABLE_WARNING_POP
#include <hictk/reference.hpp>
#include <memory>
#include <stdexcept>
#include <string>
#include <string_view>
#include <utility>
#include <vector>
Expand Down
12 changes: 2 additions & 10 deletions src/io/parquet_stats_file_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,24 +22,16 @@
#include "nchg/suppress_warnings.hpp"
NCHG_DISABLE_WARNING_PUSH
NCHG_DISABLE_WARNING_DEPRECATED_DECLARATIONS
#include <arrow/array.h>
#include <arrow/io/file.h>
#include <arrow/util/thread_pool.h>
#include <parquet/arrow/reader.h>
#include <parquet/arrow/writer.h>
#include <parquet/stream_reader.h>
NCHG_DISABLE_WARNING_POP
// clang-format on

#include <cstddef>
#include <cassert>
#include <cstdint>
#include <filesystem>
#include <hictk/chromosome.hpp>
#include <hictk/pixel.hpp>
#include <hictk/reference.hpp>
#include <memory>
#include <stdexcept>
#include <string>
#include <string_view>
#include <utility>

#include "nchg/parquet_helpers.hpp"
Expand Down
26 changes: 1 addition & 25 deletions src/io/record_batch_builder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,45 +22,21 @@
#include "nchg/suppress_warnings.hpp"
NCHG_DISABLE_WARNING_PUSH
NCHG_DISABLE_WARNING_DEPRECATED_DECLARATIONS
#include <arrow/array.h>
#include <arrow/array/array_base.h>
#include <arrow/builder.h>
#include <arrow/record_batch.h>
#include <arrow/type.h>
#include <arrow/io/file.h>
#include <arrow/util/key_value_metadata.h>
#include <parquet/arrow/reader.h>
#include <parquet/arrow/writer.h>
#include <parquet/encoding.h>
#include <parquet/properties.h>
#include <parquet/stream_reader.h>
#include <parallel_hashmap/phmap.h>
NCHG_DISABLE_WARNING_POP
// clang-format on

#include <fmt/format.h>
#include <spdlog/spdlog.h>

#include <algorithm>
#include <array>
#include <cassert>
#include <cstddef>
#include <cstdint>
#include <exception>
#include <filesystem>
#include <fstream>
#include <hictk/genomic_interval.hpp>
#include <hictk/numeric_utils.hpp>
#include <hictk/reference.hpp>
#include <iosfwd>
#include <memory>
#include <numeric>
#include <stdexcept>
#include <string>
#include <string_view>
#include <utility>
#include <vector>

#include "nchg/common.hpp"
#include "nchg/parquet_stats_file.hpp"

namespace nchg {
Expand Down
9 changes: 3 additions & 6 deletions src/io/record_batch_builder_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,27 +22,24 @@
#include "nchg/suppress_warnings.hpp"
NCHG_DISABLE_WARNING_PUSH
NCHG_DISABLE_WARNING_DEPRECATED_DECLARATIONS
#include <arrow/array.h>
#include <arrow/array/array_base.h>
#include <arrow/io/file.h>
#include <arrow/util/thread_pool.h>
#include <parquet/arrow/reader.h>
#include <parquet/properties.h>
#include <parquet/arrow/writer.h>
NCHG_DISABLE_WARNING_POP
// clang-format on

#include <fmt/format.h>
#include <spdlog/spdlog.h>

#include <cstddef>
#include <cstdint>
#include <filesystem>
#include <hictk/chromosome.hpp>
#include <hictk/pixel.hpp>
#include <hictk/reference.hpp>
#include <memory>
#include <stdexcept>
#include <string>
#include <string_view>
#include <utility>

#include "nchg/parquet_helpers.hpp"

Expand Down
5 changes: 3 additions & 2 deletions src/io/text.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,16 @@
// <https://www.gnu.org/licenses/>.

// clang-format off

#include "nchg/text.hpp"

#include "nchg/suppress_warnings.hpp"
NCHG_DISABLE_WARNING_PUSH
NCHG_DISABLE_WARNING_DEPRECATED_DECLARATIONS
#include <parallel_hashmap/phmap.h>
NCHG_DISABLE_WARNING_POP
// clang-format on

#include "nchg/text.hpp"

#include <fmt/format.h>
#include <spdlog/spdlog.h>

Expand Down

0 comments on commit 4f2a87e

Please sign in to comment.