Skip to content

Commit bbdd1fb

Browse files
authored
Merge branch 'stan-dev:develop' into feature/issue-2682-operands-and-partials-8
2 parents 665f1ab + c4b0717 commit bbdd1fb

34 files changed

+502
-285
lines changed

.github/CONTRIBUTING.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22

33
Thanks for reading! We love contributions from everyone in the form of good discussion, issues, and pull requests.
44

5-
This is the short version. There's more information on the [wiki](https://github.com/stan-dev/math/wiki/Developer-Doc#contributing).
6-
5+
This is the short version. There's more information on the [documentation site](https://mc-stan.org/math/developer_guide.html).
76
## Issues
87

98
We reserve [issues](https://github.com/stan-dev/math/issues) for bugs and feature requests that are defined well enough for a developer to tackle. If you have general questions about the Math library, please see the [Discussion](#discussion) section.
@@ -31,22 +30,22 @@ Open feature requests should be the ones we want to implement in the Math librar
3130

3231
## Pull Requests
3332

34-
All changes to the Math library are handled through [pull requests](https://github.com/stan-dev/math/pulls). Each pull request should correspond to an issue. We follow a [modified GitFlow branching model](https://github.com/stan-dev/stan/wiki/Dev:-Git-Process) for development.
33+
All changes to the Math library are handled through [pull requests](https://github.com/stan-dev/math/pulls). Each pull request should correspond to an issue. We follow a [modified GitFlow branching model](https://github.com/stan-dev/stan/wiki/Developer-process-overview#2-create-a-branch-for-the-issue) for development.
3534

3635
When a contributor creates a pull request for inclusion to the Math library, here are some of the things we expect:
3736

38-
1. the contribution maintains the Math library's open-source [license](https://github.com/stan-dev/math/wiki/Developer-Doc#licensing): 3-clause BSD
37+
1. the contribution maintains the Math library's open-source [license](https://github.com/stan-dev/stan/wiki/Stan-Licensing): 3-clause BSD
3938
2. the code base remains stable after merging the pull request; we expect the `develop` branch to always be in a good state
4039
3. the changes are maintainable. In code review, we look at the design of the proposed code. We also expect documentation. It should look like idiomatic C++.
4140
4. the changes are tested. For bugs, we expect at least one test that fails before the patch and is fixed after the patch. For new features, we expect at least one test that shows expected behavior and one test that shows the behavior when there's an error.
42-
5. the changes adhere to the Math library's [C++ standards](https://github.com/stan-dev/stan/wiki/Code-Quality). Consistency really helps.
41+
5. the changes adhere to the Math library's [C++ standards](https://github.com/stan-dev/stan/wiki/Coding-Style-and-Idioms). Consistency really helps.
4342

4443
Pull requests are code reviewed after they pass our continuous integration tests. We expect all the above before a pull request is merged. We are an open-source project and once code makes it into the repository, it's on the community to maintain.
4544

4645
It is the responsibility of the contributor submitting the pull request that the code meets these requirements. We're open-source. Once the code gets into the code base, the community of developers take ownership of it.
4746

4847
### Code Reviews
49-
See the [Code Review Guidelines](https://github.com/stan-dev/math/wiki/Developer-Doc#code-review-guidelines) on the Math wiki.
48+
See the [Code Review Guidelines](https://github.com/stan-dev/stan/wiki/Developer-process-overview#code-review-guidelines) on the Math wiki.
5049

5150

5251
## Discussion

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Thanks for submitting a pull request! Please remove this text when submitting.
22

3-
Start by filling in the Summary, Tests, and Side Effects sections of this pull request and then work through the handy checklist at the bottom. If anything significant is missing, the pull request may be closed until it's ready. The full guidebook on how pull requests are reviewed is here: [Code Review Guidelines](https://github.com/stan-dev/math/wiki/Developer-Doc#code-review-guidelines).
3+
Start by filling in the Summary, Tests, and Side Effects sections of this pull request and then work through the handy checklist at the bottom. If anything significant is missing, the pull request may be closed until it's ready. The full guidebook on how pull requests are reviewed is here: [Code Review Guidelines](https://github.com/stan-dev/stan/wiki/Developer-process-overview#code-review-guidelines).
44

55
## Summary
66

@@ -40,7 +40,7 @@ Replace this text with a short note on what will change if this pull request is
4040
- header checks pass, (`make test-headers`)
4141
- dependencies checks pass, (`make test-math-dependencies`)
4242
- docs build, (`make doxygen`)
43-
- code passes the built in [C++ standards](https://github.com/stan-dev/stan/wiki/Code-Quality) checks (`make cpplint`)
43+
- code passes the built in [C++ standards](https://github.com/stan-dev/stan/wiki/Coding-Style-and-Idioms) checks (`make cpplint`)
4444

4545
- [ ] the code is written in idiomatic C++ and changes are documented in the doxygen
4646

.github/workflows/header_checks.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,14 @@ on:
1313
- 'README.md'
1414
- 'RELEASE-NOTES.txt'
1515

16+
permissions:
17+
contents: read
18+
1619
jobs:
1720
windows:
21+
permissions:
22+
actions: write # for n1hility/cancel-previous-runs to create & stop workflow runs
23+
contents: read # for actions/checkout to fetch code
1824
name: Windows
1925
runs-on: windows-latest
2026

@@ -47,6 +53,9 @@ jobs:
4753
run: make -j2 test-headers
4854

4955
opencl:
56+
permissions:
57+
actions: write # for n1hility/cancel-previous-runs to create & stop workflow runs
58+
contents: read # for actions/checkout to fetch code
5059
name: OpenCL
5160
runs-on: ubuntu-latest
5261

@@ -64,6 +73,9 @@ jobs:
6473
echo "STAN_OPENCL=true" > make/local
6574
make -j2 test-headers
6675
no_range_checks:
76+
permissions:
77+
actions: write # for n1hility/cancel-previous-runs to create & stop workflow runs
78+
contents: read # for actions/checkout to fetch code
6779
name: NoRange
6880
runs-on: ubuntu-latest
6981

.github/workflows/main.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,14 @@ on:
1212
- 'LICENSE.md'
1313
- 'README.md'
1414
- 'RELEASE-NOTES.txt'
15+
permissions:
16+
contents: read
17+
1518
jobs:
1619
prim-rev:
20+
permissions:
21+
actions: write # for n1hility/cancel-previous-runs to create & stop workflow runs
22+
contents: read # for actions/checkout to fetch code
1723
name: prim and rev tests
1824
runs-on: windows-latest
1925

doxygen/contributor_help_pages/developer_doc.md

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,7 @@ We're committed to having a permissive open-source license. The Math library is
4343

4444
# Contributing {#contribution}
4545

46-
Thanks for reading! We love contributions from everyone in the form of discussions, issues, and pull requests.
47-
48-
This is the short version. There's more information on the [wiki](https://github.com/stan-dev/math/wiki/Developer-Doc#contributing).
49-
50-
It is the responsibility of the contributor submitting the pull request that the code meets these requirements. We're open-source. Once the code gets into the code base, the community of developers take ownership of it.
46+
Thanks for reading! We love contributions from everyone in the form of good discussion, issues, and pull requests.
5147

5248
## Issues
5349

@@ -76,30 +72,31 @@ Open feature requests should be the ones we want to implement in the Math librar
7672

7773
## Pull Requests
7874

79-
All changes to the Math library are handled through [pull requests](https://github.com/stan-dev/math/pulls). Each pull request should correspond to an issue. We follow a [modified GitFlow branching model](https://github.com/stan-dev/stan/wiki/Dev:-Git-Process) for development.
75+
All changes to the Math library are handled through [pull requests](https://github.com/stan-dev/math/pulls). Each pull request should correspond to an issue. We follow a [modified GitFlow branching model](https://github.com/stan-dev/stan/wiki/Developer-process-overview#2-create-a-branch-for-the-issue) for development.
8076

8177
When a contributor creates a pull request for inclusion to the Math library, here are some of the things we expect:
8278

83-
1. the contribution maintains the Math library's open-source [license](https://github.com/stan-dev/math/wiki/Developer-Doc#licensing): 3-clause BSD
79+
1. the contribution maintains the Math library's open-source [license](https://github.com/stan-dev/stan/wiki/Stan-Licensing): 3-clause BSD
8480
2. the code base remains stable after merging the pull request; we expect the `develop` branch to always be in a good state
85-
3. the changes are maintainable. In code review, we look at the design of the proposed code. We also expect documentation.
81+
3. the changes are maintainable. In code review, we look at the design of the proposed code. We also expect documentation. It should look like idiomatic C++.
8682
4. the changes are tested. For bugs, we expect at least one test that fails before the patch and is fixed after the patch. For new features, we expect at least one test that shows expected behavior and one test that shows the behavior when there's an error.
87-
5. the changes adhere to the Math library's [C++ standards](https://github.com/stan-dev/stan/wiki/Code-Quality). Consistency really helps.
83+
5. the changes adhere to the Math library's [C++ standards](https://github.com/stan-dev/stan/wiki/Coding-Style-and-Idioms). Consistency really helps.
8884

8985
Pull requests are code reviewed after they pass our continuous integration tests. We expect all the above before a pull request is merged. We are an open-source project and once code makes it into the repository, it's on the community to maintain.
9086

91-
### Code Reviews
92-
See the [Code Review Guidelines](https://github.com/stan-dev/math/wiki/Developer-Doc#code-review-guidelines) on the Math wiki.
93-
87+
It is the responsibility of the contributor submitting the pull request that the code meets these requirements. We're open-source. Once the code gets into the code base, the community of developers take ownership of it.
9488

95-
## Discussion {#discussion}
9689

97-
For general questions, please ask on the forums with the ["Developers" tag](https://discourse.mc-stan.org/c/stan-dev).
90+
## Discussion
9891

92+
For general questions, please ask on the forums with the ["Developers" tag](http://discourse.mc-stan.org/c/stan-dev).
9993

10094

10195
# Code Review Guidelines {#code-review-guidelines}
10296

97+
(These are also listed on the
98+
[wiki](https://github.com/stan-dev/stan/wiki/Developer-process-overview#code-review-guidelines))
99+
103100
All pull requests must have these things:
104101

105102
1. clear licensing information. Check that the person that owns the copyright is listed.
@@ -109,7 +106,7 @@ All pull requests must have these things:
109106
- code design. It should either be designed with well-known C++ patterns or there should be a good reason it isn't.
110107
- documentation. The documentation that goes with the changes should go in this pull request.
111108
4. the changes are tested. Please verify that there's at least one new test that forces the code to execute. Please also verify there's at least one test that shows how to handle errors in the code. Having just these two tests (without full coverage) is usually enough to trap errors in the future. It is also enough to use these to refactor the code when the time comes.
112-
5. the changes adhere to the Math library's [C++ standards](https://github.com/stan-dev/stan/wiki/Code-Quality). This is a large code base. We want the quality to be consistent so it's easy to navigate and understand other parts of the code base.
109+
5. the changes adhere to the Math library's [C++ standards](https://github.com/stan-dev/stan/wiki/Coding-Style-and-Idioms). This is a large code base. We want the quality to be consistent so it's easy to navigate and understand other parts of the code base.
113110

114111
Most of the above is subjective, so please use your best judgement.
115112

@@ -280,14 +277,20 @@ The easiest way to build and run tests is to use the `runTests.py` python script
280277

281278
## Misc: Stan Testing
282279

283-
The [Stan testing](https://github.com/stan-dev/stan/wiki/Testing-Stan-using-Gnu-Make-and-Python) process depends on the makefiles in Math.
280+
The [Stan testing](https://github.com/stan-dev/stan/wiki/Coding-Style-and-Idioms#unit-testing) process depends on the makefiles in Math.
284281

285282

286283

287284
# Where do I create a new issue
288285

289-
Stan's development is across multiple repositories. See this page for details on where to put new issues:
290-
https://github.com/stan-dev/stan/wiki/Where-do-I-create-a-new-issue
286+
Stan's development is across multiple repositories. When in doubt of which one
287+
to open an issue in, we ask that you make your best guess. We can always move it for you.
288+
289+
Language or compiler issues: stanc3
290+
291+
Algorithm issues: stan
292+
293+
Function or derivative issues: math
291294

292295
# Running tests from the math library
293296

doxygen/parallelism_support/threading_tbb.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Threading support requires a fully C++11 compliant compiler which has a working
3333
The compiler support for the C++11 `thread_local` keyword for the major open-source compilers is available since these versions:
3434

3535
- GNU g++ 4.8.1, [see here](https://gcc.gnu.org/projects/cxx-status.html); please also add `-pthread` to the `CXXFLAGS` variable
36-
- clang++ 3.3, [see here](https://clang.llvm.org/cxx_status.html)
36+
- clang++ 3.3, [see here](https://clang.llvm.org/cxx_status.html)
3737
Note: clang + linux long had issues with `thread_local` which should be fixed with clang >=4.0
3838

3939
## Mac OS X
@@ -58,4 +58,4 @@ With `clang` on linux there are issues during the linking step of programs which
5858

5959
Known to work:
6060
- RTools 3.5 for Windows which uses mingw g++ 4.9.1 (since stan-math 2.20.0)
61-
- RTools 4.0 for Windows with a port of GNU g++ 8.2 see [here](https://github.com/stan-dev/rstan/wiki/Using-RStan-with-the-R-3.6.0-Prerelease-on-Windows) but that compiler can also be used with CmdStan
61+
- RTools 4.0 for Windows with a port of GNU g++ 8.2, that compiler can also be used with CmdStan

doxygen/pretty_stuff/layout.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
<navindex>
33
<tab type="user" url="index.html" title="Overview" />
44
<tab type="usergroup" visible="yes" title="Contributor Guides" url="@ref contributing" intro="">
5+
<tab type="usergroup" visible="yes" title="Developer Guide" url="@ref developer_guide" intro=""/>
56
<tab type="usergroup" visible="yes" title="Adding New Functions" url="@ref getting_started" intro=""/>
67
<tab type="usergroup" visible="yes" title="Adding New Distributions" url="@ref new_distribution" intro=""/>
7-
<tab type="usergroup" visible="yes" title="Using requires for general overloads" url="@ref require_meta_doc" intro=""/>
88
<tab type="usergroup" visible="yes" title="Common Pitfalls" url="@ref common_pitfalls" intro=""/>
9-
<tab type="usergroup" visible="yes" title="Developer Guide" url="@ref developer_guide" intro=""/>
9+
<tab type="usergroup" visible="yes" title="Using requires for general overloads" url="@ref require_meta_doc" intro=""/>
1010
<tab type="usergroup" visible="yes" title="Reverse Mode Types" url="@ref reverse_mode_types" intro=""/>
1111
<tab type="usergroup" visible="yes" title="Testing Automatic Differentiation Functions" url="@ref autodiff_test_guide" intro=""/>
1212
<tab type="usergroup" visible="yes" title="Testing New Distributions" url="@ref dist_tests" intro=""/>

lib/eigen_3.3.9/unsupported/Eigen/src/FFT/ei_kissfft_impl.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ struct kiss_cpx_fft
3131
using std::acos;
3232
m_inverse = inverse;
3333
m_twiddles.resize(nfft);
34-
Scalar phinc = (inverse?2:-2)* acos( (Scalar) -1) / nfft;
34+
// STAN CHANGE: The next line originally cast -1 to Scalar, which breaks derivatives
35+
Scalar phinc = (inverse?2:-2)* acos(-1.0) / nfft;
3536
for (int i=0;i<nfft;++i)
3637
m_twiddles[i] = exp( Complex(0,i*phinc) );
3738
}

makefile

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,7 @@ include make/clang-tidy
2525
help:
2626
@echo '--------------------------------------------------------------------------------'
2727
@echo 'Note: testing of Math is typically done with the `runTests.py` python script.'
28-
@echo ' See https://github.com/stan-dev/math/wiki/Developer-Doc#building-and-running-tests'
29-
@echo ' for more detail on testing.'
30-
@echo ''
28+
@echo ''
3129
@echo 'Stan Math makefile:'
3230
@$(MAKE) print-compiler-flags
3331
@echo 'Tests:'

runTests.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -236,8 +236,7 @@ def runTest(name, run_all=False, mpi=False, j=1):
236236
if mpi:
237237
if not commandExists("mpirun"):
238238
stopErr(
239-
"Error: need to have mpi (and mpirun) installed to run mpi tests"
240-
+ "\nCheck https://github.com/stan-dev/stan/wiki/Parallelism-using-MPI-in-Stan for more details.",
239+
"Error: need to have mpi (and mpirun) installed to run mpi tests",
241240
-1,
242241
)
243242
if "mpi_" in name:

0 commit comments

Comments
 (0)