Skip to content

Commit

Permalink
linting
Browse files Browse the repository at this point in the history
  • Loading branch information
khwilson committed Oct 19, 2024
1 parent 5ddd866 commit f902ea2
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 34 deletions.
45 changes: 18 additions & 27 deletions cpp/src/arrow/compute/kernels/scalar_arithmetic.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1257,16 +1257,12 @@ const FunctionDoc sin_doc{"Compute the sine",
"to raise an error instead, see \"sin_checked\"."),
{"x"}};


const FunctionDoc sin_checked_doc{"Compute the sine",
("Invalid input values raise an error;\n"
"to return NaN instead, see \"sin\"."),
{"x"}};

const FunctionDoc sinh_doc{"Compute the hyperblic sine",
(""),
{"x"}};

const FunctionDoc sinh_doc{"Compute the hyperblic sine", (""), {"x"}};

const FunctionDoc cos_doc{"Compute the cosine",
("NaN is returned for invalid input values;\n"
Expand All @@ -1278,9 +1274,7 @@ const FunctionDoc cos_checked_doc{"Compute the cosine",
"to return NaN instead, see \"cos\"."),
{"x"}};

const FunctionDoc cosh_doc{"Compute the hyperbolic cosine",
(""),
{"x"}};
const FunctionDoc cosh_doc{"Compute the hyperbolic cosine", (""), {"x"}};

const FunctionDoc tan_doc{"Compute the tangent",
("NaN is returned for invalid input values;\n"
Expand All @@ -1292,9 +1286,7 @@ const FunctionDoc tan_checked_doc{"Compute the tangent",
"to return NaN instead, see \"tanh\"."),
{"x"}};

const FunctionDoc tanh_doc{"Compute the hyperbolic tangent",
(""),
{"x"}};
const FunctionDoc tanh_doc{"Compute the hyperbolic tangent", (""), {"x"}};

const FunctionDoc asin_doc{"Compute the inverse sine",
("NaN is returned for invalid input values;\n"
Expand All @@ -1306,11 +1298,10 @@ const FunctionDoc asin_checked_doc{"Compute the inverse sine",
"to return NaN instead, see \"asin\"."),
{"x"}};


const FunctionDoc asinh_doc{"Compute the inverse hyperbolic sine",
("NaN is returned for invalid input values;\n"
"to raise an error instead, see \"asinh_checked\"."),
{"x"}};
("NaN is returned for invalid input values;\n"
"to raise an error instead, see \"asinh_checked\"."),
{"x"}};

const FunctionDoc acos_doc{"Compute the inverse cosine",
("NaN is returned for invalid input values;\n"
Expand All @@ -1323,14 +1314,14 @@ const FunctionDoc acos_checked_doc{"Compute the inverse cosine",
{"x"}};

const FunctionDoc acosh_doc{"Compute the inverse hyperbolic cosine",
("NaN is returned for invalid input values;\n"
"to raise an error instead, see \"acosh_checked\"."),
{"x"}};
("NaN is returned for invalid input values;\n"
"to raise an error instead, see \"acosh_checked\"."),
{"x"}};

const FunctionDoc acosh_checked_doc{"Compute the inverse hyperbolic cosine",
("Invalid input values raise an error;\n"
"to return NaN instead, see \"acosh\"."),
{"x"}};
("Invalid input values raise an error;\n"
"to return NaN instead, see \"acosh\"."),
{"x"}};

const FunctionDoc atan_doc{"Compute the inverse tangent of x",
("The return value is in the range [-pi/2, pi/2];\n"
Expand All @@ -1342,14 +1333,14 @@ const FunctionDoc atan2_doc{"Compute the inverse tangent of y/x",
{"y", "x"}};

const FunctionDoc atanh_doc{"Compute the inverse hyperbolic tangent",
("NaN is returned for invalid input values;\n"
"to raise an error instead, see \"atanh_checked\"."),
{"x"}};
("NaN is returned for invalid input values;\n"
"to raise an error instead, see \"atanh_checked\"."),
{"x"}};

const FunctionDoc atanh_checked_doc{"Compute the inverse hyperbolic tangent",
("Invalid input values raise an error;\n"
"to return NaN instead, see \"atanh\"."),
{"x"}};
("Invalid input values raise an error;\n"
"to return NaN instead, see \"atanh\"."),
{"x"}};

const FunctionDoc ln_doc{
"Compute natural logarithm",
Expand Down
15 changes: 8 additions & 7 deletions cpp/src/arrow/compute/kernels/scalar_arithmetic_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1183,8 +1183,8 @@ TEST(TestUnaryArithmetic, DispatchBest) {
}

// Float types (with _checked variant)
for (std::string name :
{"ln", "log2", "log10", "log1p", "sin", "cos", "tan", "asin", "acos", "acosh", "atanh"}) {
for (std::string name : {"ln", "log2", "log10", "log1p", "sin", "cos", "tan", "asin",
"acos", "acosh", "atanh"}) {
for (std::string suffix : {"", "_checked"}) {
name += suffix;
for (const auto& ty : {float32(), float64()}) {
Expand All @@ -1203,8 +1203,8 @@ TEST(TestUnaryArithmetic, DispatchBest) {
}

// Integer -> Float64 (with _checked variant)
for (std::string name :
{"ln", "log2", "log10", "log1p", "sin", "cos", "tan", "asin", "acos", "acosh", "atanh"}) {
for (std::string name : {"ln", "log2", "log10", "log1p", "sin", "cos", "tan", "asin",
"acos", "acosh", "atanh"}) {
for (std::string suffix : {"", "_checked"}) {
name += suffix;
for (const auto& ty :
Expand All @@ -1226,15 +1226,16 @@ TEST(TestUnaryArithmetic, DispatchBest) {
}

TEST(TestUnaryArithmetic, Null) {
for (std::string name : {"abs", "acos", "acosh", "asin", "atanh", "cos", "ln", "log10", "log1p", "log2",
"negate", "sin", "tan"}) {
for (std::string name : {"abs", "acos", "acosh", "asin", "atanh", "cos", "ln", "log10",
"log1p", "log2", "negate", "sin", "tan"}) {
for (std::string suffix : {"", "_checked"}) {
name += suffix;
AssertNullToNull(name);
}
}

for (std::string name : {"sinh", "cosh", "tanh", "asinh", "atan", "bit_wise_not", "sign"}) {
for (std::string name :
{"sinh", "cosh", "tanh", "asinh", "atan", "bit_wise_not", "sign"}) {
AssertNullToNull(name);
}
}
Expand Down

0 comments on commit f902ea2

Please sign in to comment.