diff --git a/.codespellrc b/.codespellrc new file mode 100644 index 00000000000..6b0848c58b0 --- /dev/null +++ b/.codespellrc @@ -0,0 +1,12 @@ +[codespell] +# Ref: https://github.com/codespell-project/codespell#using-a-config-file +# lib/ - vendored rapidjson and stan_math submodule +# licenses/stan-doc-license.txt - verbatim CC license text, not ours to edit +skip = .git,.git-meta,.gitignore,.gitattributes,.codespellrc,.*cache,*.pdf,*.svg,*.css,*.min.*,.npm,./lib,./licenses/stan-doc-license.txt +check-hidden = true +# ignore-regex = +ignore-words-list = + # "a low" bracket endpoint variable in BFGS line search (alo/ahi) + alo, + # clang-tidy check group name (*optin*) in make/clang-tidy + optin diff --git a/.github/workflows/codespell.yml b/.github/workflows/codespell.yml new file mode 100644 index 00000000000..cdcba59a84d --- /dev/null +++ b/.github/workflows/codespell.yml @@ -0,0 +1,23 @@ +# Codespell configuration is within .codespellrc +--- +name: Codespell + +on: + push: + branches: [develop] + pull_request: + branches: [develop] + +permissions: + contents: read + +jobs: + codespell: + name: Check for spelling errors + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v6 + - name: Codespell + uses: codespell-project/actions-codespell@8f01853be192eb0f849a5c7d721450e7a467c579 # v2.2 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/RELEASE-NOTES.txt b/RELEASE-NOTES.txt index 9f04f448f04..c85565e7e70 100644 --- a/RELEASE-NOTES.txt +++ b/RELEASE-NOTES.txt @@ -99,7 +99,7 @@ v2.33.0 (5 September 2023) - Add callback writer to output JSON data for diagnostics. (#3191, #3202) - Replace use of `boost::lexical_cast` with `std::strol`, etc, and remove spurious header includes. (#3206) - Fixed several typos in documentation. (#3210) -- Added multi chain service functions for hmc nuts for adapatation and nonadaption for the unit e, diag, and dense metrics. (#3212) +- Added multi chain service functions for hmc nuts for adaptation and nonadaption for the unit e, diag, and dense metrics. (#3212) - Made the service functions consistently catch exceptions and favor return codes. (#3214) - Added a hard copy of the event vector for OpenCL before making a copy to go from a tbb concurrent vector to a standard vector. (#3217) - Added missing size checks to vectors of Eigen types. (#3218) @@ -232,7 +232,7 @@ v.2.22.0 (24 January 2020) New Features ------------ -- validate_dims in stan::io::var_context vas made a virtual function which allows its implementation for JSON data which is needed to accepts arrays where any dimension is size 0 +- validate_dims in stan::io::var_context was made a virtual function which allows its implementation for JSON data which is needed to accepts arrays where any dimension is size 0 - replaced Eigen vectors of strings with std::vector - replaced stan::math::domain_error with throw_domain_error - added const noexcept accessors to the stepsize adaptation class which allows developers to query the adaptation parameters in contexts where it's natural to have a const sampler (logging, serialization, ...) @@ -243,7 +243,7 @@ v.2.21.0 (18 October 2019) New Features ------------ - Add Intel TBB (#2769) -- Add automated maintanence and cleanup via clang-tools to makefile (#2805) +- Add automated maintenance and cleanup via clang-tools to makefile (#2805) - Use Welford's algorithm for Variance Estimates in src/stan/analyze (#2819) - Adds additional no-u-turn checks across subtrees to avoid missing u-turns for approximately iid normal models (#2800) - Add gp kernels to language (#2739) @@ -305,7 +305,7 @@ New Features * #2620 - expose beta_proportion distribution, cdf, rng functions * #2635 - allow paths to be passed to stanc * #2441 - Add specialized functions for GLMs -* #2358 - enchanced include syntax +* #2358 - enhanced include syntax * #2575 - Analysis API for computing effective sample size * #2467 - expose bernoulli logit rng @@ -487,8 +487,8 @@ v2.14.0 (26 December 2016) Bug Fixes -------------------------------------------------- * NUTS sampler broken (#2179) -* seralization issues with RStan v2.13.1 (#2179) -* printing result of a void function parses, but doesnt' compile (#2168) +* serialization issues with RStan v2.13.1 (#2179) +* printing result of a void function parses, but doesn't compile (#2168) * compound declare/define not working for all types (#2163) Other @@ -537,7 +537,7 @@ New Internal Features Documentation -------------------------------------------------- -* manaul reorganization (#1599) +* manual reorganization (#1599) * line too long (#2121) * added integer % operator documentation (#2065) * lots more (#2051) @@ -644,7 +644,7 @@ New Internal Features * refactor semantic actions to header/implementation (#1795) * writer callback interface for algorithms (#1739) * error writer callbacks (#1836) -* cleaner HMC diagnostic ouptut (#1790) +* cleaner HMC diagnostic output (#1790) * pull-request template on GitHub (#1794) * remove unused filename argument in parser (#1752) * remove unused lp_no_jacobian function (now controlled with @@ -734,7 +734,7 @@ New Features Bug Fixes -------------------------------------------------- -* Disallow user-defiend function overloading (#1547) +* Disallow user-defined function overloading (#1547) * Better behaved beta cdf (#1561, stan-dev/math#124) Manual @@ -812,7 +812,7 @@ Code Reorganization and Back End Upgrades * Split out derivative functionals (#1389) -Manual and Dcoumentation +Manual and Documentation -------------------------------------------------- * New Logo in Manual; remove old logos (#1023) * Corrected all known bug reports and typos; details in @@ -836,7 +836,7 @@ v2.6.3 (17 March 2015) Bug Fixes ---------------------------------------- -* removed extra semicolons in code; they are techinically a C++11 +* removed extra semicolons in code; they are technically a C++11 extension [#1379] * removed use of variable length array; this is a C99 feature [#1381] @@ -856,7 +856,7 @@ v2.6.2 (14 March 2015) Bug Fixes ---------------------------------------- -* fixed append_row and append_col to return the corect types [#1297] +* fixed append_row and append_col to return the correct types [#1297] * documentation fix: fixed generation of stan-functions.txt [#1327] * changed constructor of stan::agrad::var so it can compile without C++11 [#1337, 1364] @@ -886,7 +886,7 @@ API/Build/Test Enhancements * replace promote_args * allow reading from a local makefile outside of the code repository [#1277] * added gradient of hessian functional in C++ [#1272] -* supressed printing of adjoints when printing stan::agrad::var [#330] +* suppressed printing of adjoints when printing stan::agrad::var [#330] * removed some cpplint warnings [#1282] * removed doxygen warnings [#1290] * reimplemented fmix and fmax [#1311] @@ -951,7 +951,7 @@ API/Build/Test Enhancements Bug Fixes ---------------------------------------- * allow identifiers with prefixes matching keywords [#1177] -* allow functions to be used in variable declaration constriants [#1151] +* allow functions to be used in variable declaration constraints [#1151] * fix segfault resulting from multivariate normal in optimizer (root cause wasn't in optimizer, but in autodiff nesting cleanup) [#1200] * fixed return type in language and C++ for append_row of two @@ -1015,7 +1015,7 @@ New Features * added get_lp() function to remove any need for bar lp__ (#470) * new functions append_col() and append_row() like cbind and rbind in R (#787) -* added modulus function in a way tht is consistent with integer +* added modulus function in a way that is consistent with integer division across platforms (#577) * exposed pareto_type_2_rng (#580) * added Frechet distribution and multi_gp_cholesky distribution @@ -1362,7 +1362,7 @@ exponent * fixed rep_vector to work with integer value * fixed parser error message * fixed use of Boost NaN tests -* initialze local variables to NaN to prevent segfaults if used +* initialize local variables to NaN to prevent segfaults if used before defined * remove unused includes from model header * fix signed/unsigned warnings in tests and code @@ -1494,7 +1494,7 @@ Bug Fixes * fixed matrix resize issue on Windows that caused models to fail at optimization levels above 0 * fixed bug in print preventing hyphens or grave accents from - priting + printing * fixed issue preventing matrix rows from being assigned on the left side of an assignment statement * clearer error messages on matrix and other function arguments 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/check_adaptation.hpp b/src/test/unit/services/check_adaptation.hpp index bfd900f7aa8..a71319636d4 100644 --- a/src/test/unit/services/check_adaptation.hpp +++ b/src/test/unit/services/check_adaptation.hpp @@ -23,6 +23,7 @@ void check_adaptation(const size_t& num_params, size_t offset = 0; for (size_t i = 0; i < param_strings.size(); i++) { offset++; + // codespell:ignore-next-line if (param_strings[i].find("lements of inverse mass matrix:") != std::string::npos) { break; @@ -44,6 +45,7 @@ void check_adaptation(const size_t& num_rows, const size_t& num_cols, size_t offset = 0; for (size_t i = 0; i < param_strings.size(); i++) { offset++; + // codespell:ignore-next-line if (param_strings[i].find("lements of inverse mass matrix:") != std::string::npos) { break; @@ -67,6 +69,7 @@ void check_different(const size_t& num_params, size_t offset = 0; for (size_t i = 0; i < param_strings.size(); i++) { offset++; + // codespell:ignore-next-line if (param_strings[i].find("lements of inverse mass matrix:") != std::string::npos) { break; @@ -88,6 +91,7 @@ void check_different(const size_t& num_rows, const size_t& num_cols, size_t offset = 0; for (size_t i = 0; i < param_strings.size(); i++) { offset++; + // codespell:ignore-next-line if (param_strings[i].find("lements of inverse mass matrix:") != std::string::npos) { break; 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++; } }