Skip to content

Commit

Permalink
refactor: Rename functions and variables starting with a _
Browse files Browse the repository at this point in the history
Names starting with a `_` are reserved, this commit changes some names
in order to avoid names starting with a `_`.
  • Loading branch information
TomSchammo committed Jan 7, 2025
1 parent fc48563 commit 05163b9
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions cpp/include/stats.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ template <typename T = double, bool Interpolate = true>
class SnowIntensityDistribution {
public:
SnowIntensityDistribution(float min, float max, size_t resolution = 256)
: _min(min), _max(max), _d(0, 1) {
: min_(min), max_(max), _d(0, 1) {
if (min >= max)
throw std::runtime_error(
"Invalid bounds (hint: min must be smaller than max)");
Expand Down Expand Up @@ -76,7 +76,7 @@ class SnowIntensityDistribution {
}

private:
const float _min, _max;
const float min_, max_;

struct Sample {
T prob, value;
Expand Down
2 changes: 1 addition & 1 deletion cpp/include/transformations.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ delete_labels_by_min_points(const at::Tensor &points, const at::Tensor &labels,
* names (in that order), as well as the batch index.
*/
[[nodiscard]] inline std::pair<torch::Tensor, torch::Tensor>
_delete_labels_by_min_points(const at::Tensor &points, const at::Tensor &labels,
delete_labels_by_min_points_(const at::Tensor &points, const at::Tensor &labels,
const at::Tensor &names,
const tensor_size_t min_points,
const tensor_size_t batch_idx) {
Expand Down
2 changes: 1 addition & 1 deletion cpp/src/transformations.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ delete_labels_by_min_points(const at::Tensor &points, const at::Tensor &labels,

for (tensor_size_t i = 0; i < batch_size; i++) {

auto [filtered_labels, filtered_names] = _delete_labels_by_min_points(
auto [filtered_labels, filtered_names] = delete_labels_by_min_points_(
points[i], labels[i], names[i], min_points, i);

labels_list.emplace_back(filtered_labels);
Expand Down
2 changes: 1 addition & 1 deletion cpp/test/test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ TEST(Transformation, DeleteLabelsByMinPointsHelperTest) {
constexpr std::uint64_t min_points = 2;

const auto [result_labels, result_names] =
_delete_labels_by_min_points(points, labels, names, min_points, 0);
delete_labels_by_min_points_(points, labels, names, min_points, 0);

const auto expected_points =
torch::tensor({{10.4966, 10.1144, 10.2182, -8.4158},
Expand Down

0 comments on commit 05163b9

Please sign in to comment.