Skip to content

Commit 0b88f2f

Browse files
committed
fix: PR feedback
1 parent 4707417 commit 0b88f2f

3 files changed

Lines changed: 13 additions & 11 deletions

File tree

examples/real_data_example/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ This tool allows users to extract specific slices from 3D seismic data stored in
1010

1111
## Prerequisites
1212

13-
- C++ compiler with C++17 support
13+
- GCC 11 *or better* or Clang14 *or better*
1414
- MDIO library (for reading seismic data)
1515
- indicators library (for progress bars)
1616
- CMake (for building)

examples/real_data_example/src/real_data_example.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ absl::Status Run(const Descriptors... descriptors) {
8181
return absl::OkStatus();
8282
}
8383

84-
mdio::SliceDescriptor ParseRange(std::string_view range) {
84+
mdio::RangeDescriptor<> ParseRange(std::string_view range) {
8585
// Remove leading/trailing whitespace and braces
8686
if (range.empty()) {
8787
// FIXME - we need a better way to handle this

examples/real_data_example/src/seismic_numpy.h

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525

2626
#include "tensorstore/tensorstore.h"
2727

28+
using Index = mdio::Index;
29+
2830
std::string GetNumpyDtypeJson(const tensorstore::DataType& dtype) {
2931
using namespace tensorstore;
3032

@@ -56,14 +58,14 @@ absl::Status WriteNumpy(const mdio::SharedArray<T, R, OriginKind>& accessor,
5658
return absl::InvalidArgumentError("Expected a 3D array");
5759
}
5860

59-
auto inline_inclusive_min = domain[0].inclusive_min();
60-
auto inline_exclusive_max = domain[0].exclusive_max();
61+
const Index inline_inclusive_min = domain[0].inclusive_min();
62+
const Index inline_exclusive_max = domain[0].exclusive_max();
6163

62-
auto xline_inclusive_min = domain[1].inclusive_min();
63-
auto xline_exclusive_max = domain[1].exclusive_max();
64+
const Index xline_inclusive_min = domain[1].inclusive_min();
65+
const Index xline_exclusive_max = domain[1].exclusive_max();
6466

65-
auto depth_inclusive_min = domain[2].inclusive_min();
66-
auto depth_exclusive_max = domain[2].exclusive_max();
67+
const Index depth_inclusive_min = domain[2].inclusive_min();
68+
const Index depth_exclusive_max = domain[2].exclusive_max();
6769

6870
const int width = inline_exclusive_max - inline_inclusive_min;
6971
const int height = xline_exclusive_max - xline_inclusive_min;
@@ -98,9 +100,9 @@ absl::Status WriteNumpy(const mdio::SharedArray<T, R, OriginKind>& accessor,
98100
outfile.write(header.str().c_str(), header_size);
99101

100102
// Write the data
101-
for (int il = inline_inclusive_min; il < inline_exclusive_max; ++il) {
102-
for (int xl = xline_inclusive_min; xl < xline_exclusive_max; ++xl) {
103-
for (int zl = depth_inclusive_min; zl < depth_exclusive_max; ++zl) {
103+
for (Index il = inline_inclusive_min; il < inline_exclusive_max; ++il) {
104+
for (Index xl = xline_inclusive_min; xl < xline_exclusive_max; ++xl) {
105+
for (Index zl = depth_inclusive_min; zl < depth_exclusive_max; ++zl) {
104106
T value = accessor(il, xl, zl);
105107
outfile.write(reinterpret_cast<const char*>(&value), sizeof(T));
106108
}

0 commit comments

Comments
 (0)