From 4cb7a97fa9b08fe7d118d79a2f38ceab3c15384e Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Tue, 20 Oct 2026 13:39:53 -0700 Subject: [PATCH] Fix spelling errors --- README.md | 2 +- src/stan/mcmc/chainset.hpp | 8 +-- src/test/unit/io/deserializer_test.cpp | 40 +++++------ src/test/unit/io/deserializer_var_test.cpp | 40 +++++------ .../unit/io/serializer_stdvector_test.cpp | 72 +++++++++---------- src/test/unit/io/serializer_test.cpp | 32 ++++----- src/test/unit/io/serializer_varmat_test.cpp | 6 +- .../pathfinder/eight_schools_test.cpp | 14 ++-- 8 files changed, 107 insertions(+), 107 deletions(-) diff --git a/README.md b/README.md index 0fedeff0df7..9a39555d8d9 100644 --- a/README.md +++ b/README.md @@ -35,4 +35,4 @@ Licensing --------- The Stan math library, core Stan code, and CmdStan are licensed under new BSD. RStan and PyStan are licensed under GPLv3, with other interfaces having other open-source licenses. -Note that the Stan math library depends on the Intel TBB library which is licensed under the Apache 2.0 license. This dependency implies an additional restriction as compared to the new BSD lincense alone. The Apache 2.0 license is incompatible with GPL-2 licensed code if distributed as a unitary binary. You may refer to the Licensing page on the [Stan wiki](https://github.com/stan-dev/stan/wiki/Stan-Licensing). +Note that the Stan math library depends on the Intel TBB library which is licensed under the Apache 2.0 license. This dependency implies an additional restriction as compared to the new BSD license alone. The Apache 2.0 license is incompatible with GPL-2 licensed code if distributed as a unitary binary. You may refer to the Licensing page on the [Stan wiki](https://github.com/stan-dev/stan/wiki/Stan-Licensing). diff --git a/src/stan/mcmc/chainset.hpp b/src/stan/mcmc/chainset.hpp index 5da70fd9249..731632a23e6 100644 --- a/src/stan/mcmc/chainset.hpp +++ b/src/stan/mcmc/chainset.hpp @@ -38,7 +38,7 @@ class chainset { public: /* Construct a chainset from a single sample. - * Throws execption if sample is empty. + * Throws exception if sample is empty. */ explicit chainset(const stan::io::stan_csv& stan_csv) { if (chains_.size() > 0) { @@ -53,7 +53,7 @@ class chainset { } /* Construct a chainset from a set of samples. - * Throws execption if sample column names and shapes don't match. + * Throws exception if sample column names and shapes don't match. */ explicit chainset(const std::vector& stan_csv) { if (stan_csv.empty()) @@ -472,7 +472,7 @@ class chainset { /** * Compute autocorrelation for one column of one chain. * Throws exception if column index is out of bounds. - * Autocorrelation is computed using Stan math library implmentation. + * Autocorrelation is computed using Stan math library implementation. * * @param chain chain index * @param index column index @@ -490,7 +490,7 @@ class chainset { /** * Compute autocorrelation for one column of one chain. * Throws exception if column index is out of bounds. - * Autocorrelation is computed using Stan math library implmentation. + * Autocorrelation is computed using Stan math library implementation. * * @param chain chain index * @param name column name diff --git a/src/test/unit/io/deserializer_test.cpp b/src/test/unit/io/deserializer_test.cpp index 74ad72e96f1..a682ea59892 100644 --- a/src/test/unit/io/deserializer_test.cpp +++ b/src/test/unit/io/deserializer_test.cpp @@ -90,12 +90,12 @@ TEST(deserializer_vector, complex_read) { EXPECT_EQ(4, y.rows()); EXPECT_EQ(1, y.cols()); EXPECT_EQ(4, y.size()); - double sentinal = 7; + double sentinel = 7; for (int i = 0; i < y.size(); ++i) { - EXPECT_FLOAT_EQ(sentinal, y[i].real()); - ++sentinal; - EXPECT_FLOAT_EQ(sentinal, y[i].imag()); - ++sentinal; + EXPECT_FLOAT_EQ(sentinel, y[i].real()); + ++sentinel; + EXPECT_FLOAT_EQ(sentinel, y[i].imag()); + ++sentinel; } double z = deserializer.read(); @@ -144,12 +144,12 @@ TEST(deserializer_row_vector, complex_read) { EXPECT_EQ(1, y.rows()); EXPECT_EQ(4, y.cols()); EXPECT_EQ(4, y.size()); - double sentinal = 7; + double sentinel = 7; for (int i = 0; i < y.size(); ++i) { - EXPECT_FLOAT_EQ(sentinal, y[i].real()); - ++sentinal; - EXPECT_FLOAT_EQ(sentinal, y[i].imag()); - ++sentinal; + EXPECT_FLOAT_EQ(sentinel, y[i].real()); + ++sentinel; + EXPECT_FLOAT_EQ(sentinel, y[i].imag()); + ++sentinel; } double z = deserializer.read(); @@ -198,12 +198,12 @@ TEST(deserializer_matrix, complex_read) { eig_mat y = deserializer.read(3, 2); EXPECT_EQ(3, y.rows()); EXPECT_EQ(2, y.cols()); - double sentinal = 7; + double sentinel = 7; for (int i = 0; i < y.size(); ++i) { - EXPECT_FLOAT_EQ(sentinal, y(i).real()); - sentinal++; - EXPECT_FLOAT_EQ(sentinal, y(i).imag()); - sentinal++; + EXPECT_FLOAT_EQ(sentinel, y(i).real()); + sentinel++; + EXPECT_FLOAT_EQ(sentinel, y(i).imag()); + sentinel++; } } @@ -243,12 +243,12 @@ TEST(deserializer_array, complex_read) { using complex_array = std::vector>; complex_array y = deserializer.read(4); EXPECT_EQ(4, y.size()); - double sentinal = 7; + double sentinel = 7; for (int i = 0; i < y.size(); ++i) { - EXPECT_FLOAT_EQ(sentinal, y[i].real()); - ++sentinal; - EXPECT_FLOAT_EQ(sentinal, y[i].imag()); - ++sentinal; + EXPECT_FLOAT_EQ(sentinel, y[i].real()); + ++sentinel; + EXPECT_FLOAT_EQ(sentinel, y[i].imag()); + ++sentinel; } double z = deserializer.read(); diff --git a/src/test/unit/io/deserializer_var_test.cpp b/src/test/unit/io/deserializer_var_test.cpp index daff8481379..dcaedece397 100644 --- a/src/test/unit/io/deserializer_var_test.cpp +++ b/src/test/unit/io/deserializer_var_test.cpp @@ -93,12 +93,12 @@ TEST(deserializer_vector, complex_read) { EXPECT_EQ(4, y.rows()); EXPECT_EQ(1, y.cols()); EXPECT_EQ(4, y.size()); - double sentinal = 7; + double sentinel = 7; for (int i = 0; i < y.size(); ++i) { - EXPECT_FLOAT_EQ(sentinal, y[i].real().val()); - ++sentinal; - EXPECT_FLOAT_EQ(sentinal, y[i].imag().val()); - ++sentinal; + EXPECT_FLOAT_EQ(sentinel, y[i].real().val()); + ++sentinel; + EXPECT_FLOAT_EQ(sentinel, y[i].imag().val()); + ++sentinel; } stan::math::var z = deserializer.read(); @@ -147,12 +147,12 @@ TEST(deserializer_row_vector, complex_read) { EXPECT_EQ(1, y.rows()); EXPECT_EQ(4, y.cols()); EXPECT_EQ(4, y.size()); - double sentinal = 7; + double sentinel = 7; for (int i = 0; i < y.size(); ++i) { - EXPECT_FLOAT_EQ(sentinal, y[i].real().val()); - ++sentinal; - EXPECT_FLOAT_EQ(sentinal, y[i].imag().val()); - ++sentinal; + EXPECT_FLOAT_EQ(sentinel, y[i].real().val()); + ++sentinel; + EXPECT_FLOAT_EQ(sentinel, y[i].imag().val()); + ++sentinel; } stan::math::var z = deserializer.read(); @@ -202,12 +202,12 @@ TEST(deserializer_matrix, complex_read) { eig_mat y = deserializer.read(3, 2); EXPECT_EQ(3, y.rows()); EXPECT_EQ(2, y.cols()); - double sentinal = 7; + double sentinel = 7; for (int i = 0; i < y.size(); ++i) { - EXPECT_FLOAT_EQ(sentinal, y(i).real().val()); - sentinal++; - EXPECT_FLOAT_EQ(sentinal, y(i).imag().val()); - sentinal++; + EXPECT_FLOAT_EQ(sentinel, y(i).real().val()); + sentinel++; + EXPECT_FLOAT_EQ(sentinel, y(i).imag().val()); + sentinel++; } } @@ -248,12 +248,12 @@ TEST(deserializer_array, complex_read) { using complex_array = std::vector>; complex_array y = deserializer.read(4); EXPECT_EQ(4, y.size()); - double sentinal = 7; + double sentinel = 7; for (int i = 0; i < y.size(); ++i) { - EXPECT_FLOAT_EQ(sentinal, y[i].real().val()); - ++sentinal; - EXPECT_FLOAT_EQ(sentinal, y[i].imag().val()); - ++sentinal; + EXPECT_FLOAT_EQ(sentinel, y[i].real().val()); + ++sentinel; + EXPECT_FLOAT_EQ(sentinel, y[i].imag().val()); + ++sentinel; } stan::math::var z = deserializer.read(); diff --git a/src/test/unit/io/serializer_stdvector_test.cpp b/src/test/unit/io/serializer_stdvector_test.cpp index c869080ac04..793f31588d6 100644 --- a/src/test/unit/io/serializer_stdvector_test.cpp +++ b/src/test/unit/io/serializer_stdvector_test.cpp @@ -17,11 +17,11 @@ TEST(serializer_stdvec_vector, write) { } stan::io::serializer serializer(theta); serializer.write(x_stdvec); - int sentinal = 0; + int sentinel = 0; for (size_t i = 0; i < 2U; ++i) { for (size_t j = 0; j < 10U; ++j) { - EXPECT_FLOAT_EQ(theta[sentinal], x_stdvec[i][j]); - ++sentinal; + EXPECT_FLOAT_EQ(theta[sentinel], x_stdvec[i][j]); + ++sentinel; } } } @@ -41,14 +41,14 @@ TEST(serializer_stdvec_vector, complex_write) { } stan::io::serializer serializer(theta); serializer.write(x_stdvec); - Eigen::Index sentinal = 0; + Eigen::Index sentinel = 0; for (size_t i = 0; i < 2U; ++i) { for (size_t j = 0; j < 10U; ++j) { - EXPECT_FLOAT_EQ(theta[sentinal], x_stdvec[i][j].real()) - << "For idx: " << sentinal << " i: " << i << "j: " << j << "\n"; - EXPECT_FLOAT_EQ(theta[sentinal + 1], x_stdvec[i][j].imag()) - << "For idx: " << sentinal << " i: " << i << "j: " << j << "\n"; - sentinal += 2; + EXPECT_FLOAT_EQ(theta[sentinel], x_stdvec[i][j].real()) + << "For idx: " << sentinel << " i: " << i << "j: " << j << "\n"; + EXPECT_FLOAT_EQ(theta[sentinel + 1], x_stdvec[i][j].imag()) + << "For idx: " << sentinel << " i: " << i << "j: " << j << "\n"; + sentinel += 2; } } } @@ -66,11 +66,11 @@ TEST(serializer_stdvec_rowvector, write) { } stan::io::serializer serializer(theta); serializer.write(x_stdvec); - int sentinal = 0; + int sentinel = 0; for (size_t i = 0; i < 2U; ++i) { for (size_t j = 0; j < 10U; ++j) { - EXPECT_FLOAT_EQ(theta[sentinal], x_stdvec[i][j]); - ++sentinal; + EXPECT_FLOAT_EQ(theta[sentinel], x_stdvec[i][j]); + ++sentinel; } } } @@ -90,14 +90,14 @@ TEST(serializer_stdvec_rowvector, complex_write) { } stan::io::serializer serializer(theta); serializer.write(x_stdvec); - Eigen::Index sentinal = 0; + Eigen::Index sentinel = 0; for (size_t i = 0; i < 2U; ++i) { for (size_t j = 0; j < 10U; ++j) { - EXPECT_FLOAT_EQ(theta[sentinal], x_stdvec[i][j].real()) - << "For idx: " << sentinal << " i: " << i << "j: " << j << "\n"; - EXPECT_FLOAT_EQ(theta[sentinal + 1], x_stdvec[i][j].imag()) - << "For idx: " << sentinal << " i: " << i << "j: " << j << "\n"; - sentinal += 2; + EXPECT_FLOAT_EQ(theta[sentinel], x_stdvec[i][j].real()) + << "For idx: " << sentinel << " i: " << i << "j: " << j << "\n"; + EXPECT_FLOAT_EQ(theta[sentinel + 1], x_stdvec[i][j].imag()) + << "For idx: " << sentinel << " i: " << i << "j: " << j << "\n"; + sentinel += 2; } } } @@ -116,11 +116,11 @@ TEST(serializer_stdvec_matrix, write) { } stan::io::serializer serializer(theta); serializer.write(x_stdvec); - int sentinal = 0; + int sentinel = 0; for (size_t i = 0; i < 2U; ++i) { for (size_t j = 0; j < 16U; ++j) { - EXPECT_FLOAT_EQ(theta[sentinal], x_stdvec[i](j)); - ++sentinal; + EXPECT_FLOAT_EQ(theta[sentinel], x_stdvec[i](j)); + ++sentinel; } } } @@ -140,14 +140,14 @@ TEST(serializer_stdvec_matrix, complex_write) { } stan::io::serializer serializer(theta); serializer.write(x_stdvec); - Eigen::Index sentinal = 0; + Eigen::Index sentinel = 0; for (size_t i = 0; i < 2U; ++i) { for (size_t j = 0; j < 16U; ++j) { - EXPECT_FLOAT_EQ(theta[sentinal], x_stdvec[i](j).real()) - << "For idx: " << sentinal << " i: " << i << "j: " << j << "\n"; - EXPECT_FLOAT_EQ(theta[sentinal + 1], x_stdvec[i](j).imag()) - << "For idx: " << sentinal << " i: " << i << "j: " << j << "\n"; - sentinal += 2; + EXPECT_FLOAT_EQ(theta[sentinel], x_stdvec[i](j).real()) + << "For idx: " << sentinel << " i: " << i << "j: " << j << "\n"; + EXPECT_FLOAT_EQ(theta[sentinel + 1], x_stdvec[i](j).imag()) + << "For idx: " << sentinel << " i: " << i << "j: " << j << "\n"; + sentinel += 2; } } } @@ -164,11 +164,11 @@ TEST(serializer_stdvec_stdvector, write) { } stan::io::serializer serializer(theta); serializer.write(x_stdvec); - int sentinal = 0; + int sentinel = 0; for (size_t i = 0; i < 2U; ++i) { for (size_t j = 0; j < 10U; ++j) { - EXPECT_FLOAT_EQ(theta[sentinal], x_stdvec[i][j]); - ++sentinal; + EXPECT_FLOAT_EQ(theta[sentinel], x_stdvec[i][j]); + ++sentinel; } } } @@ -187,14 +187,14 @@ TEST(serializer_stdvec_stdvector, complex_write) { } stan::io::serializer serializer(theta); serializer.write(x_stdvec); - Eigen::Index sentinal = 0; + Eigen::Index sentinel = 0; for (size_t i = 0; i < 2U; ++i) { for (size_t j = 0; j < 10U; ++j) { - EXPECT_FLOAT_EQ(theta[sentinal], x_stdvec[i][j].real()) - << "For idx: " << sentinal << " i: " << i << "j: " << j << "\n"; - EXPECT_FLOAT_EQ(theta[sentinal + 1], x_stdvec[i][j].imag()) - << "For idx: " << sentinal << " i: " << i << "j: " << j << "\n"; - sentinal += 2; + EXPECT_FLOAT_EQ(theta[sentinel], x_stdvec[i][j].real()) + << "For idx: " << sentinel << " i: " << i << "j: " << j << "\n"; + EXPECT_FLOAT_EQ(theta[sentinel + 1], x_stdvec[i][j].imag()) + << "For idx: " << sentinel << " i: " << i << "j: " << j << "\n"; + sentinel += 2; } } } diff --git a/src/test/unit/io/serializer_test.cpp b/src/test/unit/io/serializer_test.cpp index f17b6f26cda..e1fb99d8aa0 100644 --- a/src/test/unit/io/serializer_test.cpp +++ b/src/test/unit/io/serializer_test.cpp @@ -59,11 +59,11 @@ TEST(serializer_vector, complex_write) { stan::io::serializer serializer(theta); serializer.write(x); - Eigen::Index sentinal = 0; + Eigen::Index sentinel = 0; for (size_t i = 0; i < 20U; i += 2) { - EXPECT_FLOAT_EQ(theta[i], x[sentinal].real()); - EXPECT_FLOAT_EQ(theta[i + 1], x[sentinal].imag()); - ++sentinal; + EXPECT_FLOAT_EQ(theta[i], x[sentinel].real()); + EXPECT_FLOAT_EQ(theta[i + 1], x[sentinel].imag()); + ++sentinel; } EXPECT_THROW(serializer.write(4), std::runtime_error); } @@ -94,11 +94,11 @@ TEST(serializer_rowvector, complex_write) { stan::io::serializer serializer(theta); serializer.write(x); - Eigen::Index sentinal = 0; + Eigen::Index sentinel = 0; for (size_t i = 0; i < 20U; i += 2) { - EXPECT_FLOAT_EQ(theta[i], x[sentinal].real()); - EXPECT_FLOAT_EQ(theta[i + 1], x[sentinal].imag()); - ++sentinal; + EXPECT_FLOAT_EQ(theta[i], x[sentinel].real()); + EXPECT_FLOAT_EQ(theta[i + 1], x[sentinel].imag()); + ++sentinel; } EXPECT_THROW(serializer.write(4), std::runtime_error); } @@ -129,11 +129,11 @@ TEST(serializer_matrix, complex_write) { stan::io::serializer serializer(theta); serializer.write(x); - Eigen::Index sentinal = 0; + Eigen::Index sentinel = 0; for (size_t i = 0; i < 32U; i += 2) { - EXPECT_FLOAT_EQ(theta[i], x(sentinal).real()); - EXPECT_FLOAT_EQ(theta[i + 1], x(sentinal).imag()); - ++sentinal; + EXPECT_FLOAT_EQ(theta[i], x(sentinel).real()); + EXPECT_FLOAT_EQ(theta[i + 1], x(sentinel).imag()); + ++sentinel; } EXPECT_THROW(serializer.write(4), std::runtime_error); } @@ -164,11 +164,11 @@ TEST(serializer_stdvector, complex_write) { stan::io::serializer serializer(theta); serializer.write(x); - Eigen::Index sentinal = 0; + Eigen::Index sentinel = 0; for (size_t i = 0; i < 20U; i += 2) { - EXPECT_FLOAT_EQ(theta[i], x[sentinal].real()); - EXPECT_FLOAT_EQ(theta[i + 1], x[sentinal].imag()); - ++sentinal; + EXPECT_FLOAT_EQ(theta[i], x[sentinel].real()); + EXPECT_FLOAT_EQ(theta[i + 1], x[sentinel].imag()); + ++sentinel; } EXPECT_THROW(serializer.write(4), std::runtime_error); } diff --git a/src/test/unit/io/serializer_varmat_test.cpp b/src/test/unit/io/serializer_varmat_test.cpp index 959bd5262a4..6ad3982dfa0 100644 --- a/src/test/unit/io/serializer_varmat_test.cpp +++ b/src/test/unit/io/serializer_varmat_test.cpp @@ -68,11 +68,11 @@ TEST(serializer_stdvector_varmat, read) { } stan::io::serializer serializer(theta); serializer.write(x); - int sentinal = 0; + int sentinel = 0; for (size_t i = 0; i < 2U; ++i) { for (size_t j = 0; j < 9U; ++j) { - EXPECT_FLOAT_EQ(theta[sentinal].val(), x[i].val()(j)); - ++sentinal; + EXPECT_FLOAT_EQ(theta[sentinel].val(), x[i].val()(j)); + ++sentinel; } } EXPECT_THROW(serializer.write(4), std::runtime_error); diff --git a/src/test/unit/services/pathfinder/eight_schools_test.cpp b/src/test/unit/services/pathfinder/eight_schools_test.cpp index cd901623040..f2a205e3250 100644 --- a/src/test/unit/services/pathfinder/eight_schools_test.cpp +++ b/src/test/unit/services/pathfinder/eight_schools_test.cpp @@ -287,7 +287,7 @@ TEST_F(ServicesPathfinderEightSchools, multi_and_single_psis_output) { EXPECT_EQ(stan_data.samples.rows(), num_multi_draws); EXPECT_EQ(stan_data.samples.cols(), 21); } - int sentinal = 1; + int sentinel = 1; for (auto&& single_param : single_path_parameter_writer) { auto&& streamer = single_param.get_stream(); auto str = streamer.str(); @@ -298,11 +298,11 @@ TEST_F(ServicesPathfinderEightSchools, multi_and_single_psis_output) { EXPECT_FALSE(str.rfind("(Total)") == std::string::npos); EXPECT_EQ(stan_data.samples.rows(), num_draws); EXPECT_EQ(stan_data.samples.cols(), 21); - EXPECT_TRUE((stan_data.samples.col(2).array() == sentinal).all()) + EXPECT_TRUE((stan_data.samples.col(2).array() == sentinel).all()) << "path_id: " << stan_data.samples.col(2)(0) - << "sentinal: " << sentinal << std::endl; + << "sentinel: " << sentinel << std::endl; ; - sentinal++; + sentinel++; } } @@ -387,7 +387,7 @@ TEST_F(ServicesPathfinderEightSchools, multi_and_single_nopsis_output) { EXPECT_EQ(stan_data.samples.rows(), num_draws * num_paths); EXPECT_EQ(stan_data.samples.cols(), 21); } - int sentinal = 1; + int sentinel = 1; for (auto&& single_param : single_path_parameter_writer) { auto&& streamer = single_param.get_stream(); auto&& str = streamer.str(); @@ -399,8 +399,8 @@ TEST_F(ServicesPathfinderEightSchools, multi_and_single_nopsis_output) { EXPECT_TRUE(str.find("(PSIS)") == std::string::npos); EXPECT_EQ(stan_data.samples.rows(), num_draws); EXPECT_EQ(stan_data.samples.cols(), 21); - EXPECT_TRUE((stan_data.samples.col(2).array() == sentinal).all()); - sentinal++; + EXPECT_TRUE((stan_data.samples.col(2).array() == sentinel).all()); + sentinel++; } }