Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
Language: Cpp
AccessModifierOffset: -4
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: true
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false
AlignEscapedNewlines: Left
AlignOperands: true
AlignOperands: AlignAfterOperator
AlignTrailingComments: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: true
Expand Down Expand Up @@ -70,6 +70,7 @@ IncludeIsMainRegex: '([-_](test|unittest))?$'
IndentCaseLabels: true
IndentWidth: 4
IndentWrappedFunctionNames: false
InsertBraces: true
KeepEmptyLinesAtTheStartOfBlocks: true
MacroBlockBegin: ''
MacroBlockEnd: ''
Expand Down Expand Up @@ -100,3 +101,4 @@ SpacesInSquareBrackets: false
Standard: Auto
TabWidth: 4
UseTab: Never

1 change: 1 addition & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@

# Reformatted codebase with clang-format
efb1ad8497bc43a84d7a90fe58b25a242aa13183
28ea72feb02e36e819b864e960f73e8cc08e80ec
2 changes: 1 addition & 1 deletion src/chunked_data_view/Axis.cc
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ size_t Axis::index(const fdb5::Key& key) const {
// Sanity check whether the key is containing information about the axis
const std::vector<std::string>& keys = key.names();

size_t prod = 1;
size_t prod = 1;
size_t index = 0;

for (int i = parameters().size() - 1; i >= 0; --i) {
Expand Down
2 changes: 1 addition & 1 deletion src/chunked_data_view/Buffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class Buffer {
}

bitset_ = std::vector<bool>(prod);
data_ = std::vector<float>(prod * chunkShape[chunkShape.size() - 1]);
data_ = std::vector<float>(prod * chunkShape[chunkShape.size() - 1]);
};

void resize(size_t size) {
Expand Down
2 changes: 1 addition & 1 deletion src/chunked_data_view/ChunkedDataViewBuilder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ ChunkedDataViewBuilder& ChunkedDataViewBuilder::extendOnAxis(size_t index) {

bool ChunkedDataViewBuilder::doPartsAlign(const std::vector<ViewPart>& viewParts) {
const ViewPart& first = viewParts[0];
bool extensible = true;
bool extensible = true;
for (const ViewPart& viewPart : viewParts) {
extensible &= first.extensibleWith(viewPart, extensionAxisIndex_.value_or(0));
}
Expand Down
6 changes: 3 additions & 3 deletions src/chunked_data_view/GribExtractor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -72,15 +72,15 @@ void GribExtractor::writeInto(const metkit::mars::MarsRequest& request,
}
iterator_empty = false;

const auto& key = std::get<0>(*res);
auto& data_handle = std::get<1>(*res);
const auto& key = std::get<0>(*res);
auto& data_handle = std::get<1>(*res);
const size_t msgIndex = computeBufferIndex(axes, key);

try {
eckit::message::Reader reader(*data_handle);
eckit::message::Message msg{};

auto copyInto = ptr + msgIndex * layout.countValues;
auto copyInto = ptr + msgIndex * layout.countValues;
const auto end = copyInto + layout.countValues;
ASSERT(end - ptr <= len);

Expand Down
4 changes: 2 additions & 2 deletions src/chunked_data_view/IndexMapper.cc
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ size_t index_mapping::axis_index_to_buffer_index(const std::vector<size_t>& indi

ASSERT(indices.size() == axes.size());

size_t prod = 1;
size_t prod = 1;
size_t index = 0;

for (int i = axes.size() - 1; i >= 0; --i) {
Expand Down Expand Up @@ -72,7 +72,7 @@ std::vector<size_t> index_mapping::to_axis_parameter_index(const size_t& index,
}

size_t index_in_dim = chunk_index / dim_prod; // (1)
result[i] = index_in_dim;
result[i] = index_in_dim;
chunk_index -= index_in_dim * dim_prod; // (2)
}

Expand Down
2 changes: 1 addition & 1 deletion src/chunked_data_view/RequestManipulation.cc
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ void RequestManipulation::updateRequest(metkit::mars::MarsRequest& request, cons
}

size_t index_in_dim = chunk_index / dim_prod; // (1)
index[i] = index_in_dim;
index[i] = index_in_dim;
chunk_index -= index_in_dim * dim_prod; // (2)
}

Expand Down
4 changes: 2 additions & 2 deletions src/chunked_data_view/include/chunked_data_view/Fdb.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ namespace chunked_data_view {
class FdbInterface {
public:

virtual ~FdbInterface() = default;
virtual std::unique_ptr<eckit::DataHandle> retrieve(const metkit::mars::MarsRequest& request) = 0;
virtual ~FdbInterface() = default;
virtual std::unique_ptr<eckit::DataHandle> retrieve(const metkit::mars::MarsRequest& request) = 0;
virtual std::unique_ptr<ListIteratorInterface> inspect(const metkit::mars::MarsRequest& request) = 0;
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class ListIteratorInterface {

public:

virtual ~ListIteratorInterface() = default;
virtual ~ListIteratorInterface() = default;
virtual std::optional<std::tuple<fdb5::Key, std::unique_ptr<eckit::DataHandle>>> next() = 0;
};

Expand Down
2 changes: 1 addition & 1 deletion src/chunked_data_view_bindings/bindings.cc
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#include <string>
#include <vector>

namespace py = pybind11;
namespace py = pybind11;
namespace cdv = chunked_data_view;

PYBIND11_MODULE(chunked_data_view_bindings, m) {
Expand Down
Loading
Loading