Skip to content

Commit 0a3b540

Browse files
authored
Fix docs (#1155)
* update table headings * update CONTRIBUTING.md
1 parent 1891820 commit 0a3b540

File tree

2 files changed

+49
-128
lines changed

2 files changed

+49
-128
lines changed

CONTRIBUTING.md

+43-123
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Development generally follows the following ideas:
55
* New features are merged into to the `development` branch using
66
Pull Requests (PRs).
77

8-
Regression testing is used to ensure that no answers
8+
Nightly regression testing is used to ensure that no answers
99
change (or if they do, that the changes were expected).
1010

1111
* Bug fixes, questions and contributions of new features are welcome!
@@ -18,7 +18,7 @@ Development generally follows the following ideas:
1818
details on how this process works.
1919

2020
In general we squash commits upon merge to have a clean history.
21-
*Please ensure that your PR title and first post are descriptive,
21+
*Please ensure that your PR title and description are descriptive,
2222
since these will be used for a squashed commit message.*
2323

2424
Please note the following:
@@ -29,6 +29,11 @@ Development generally follows the following ideas:
2929
distribute, and sublicense such enhancements or derivative works
3030
thereof, in binary and source code form.
3131

32+
* On the first workday of each month, we make a tagged release. The merge window into
33+
`development` is closed a few days before the release day. While the merge window is closed,
34+
only bug fixes should be merged into `development`. Once the release is done, the merge window
35+
reopens.
36+
3237
## Git workflow
3338

3439
ERF uses [git](https://git-scm.com) for version control. If you
@@ -46,61 +51,60 @@ your fork.
4651
`development` on the main ERF repository.
4752

4853
First, let us setup your local git repo. To make your own fork of the main
49-
(`upstream`) repository, press the fork button on the [ERF Github page](https://github.com/erf-model/ERF).
54+
repository, press the fork button on the [ERF Github page](https://github.com/erf-model/ERF).
5055

51-
Then, clone your fork on your local computer. If you plan on doing a lot of ERF development,
56+
Then, clone ERF on your local computer. If you plan on doing a lot of ERF development,
5257
we recommend configuring your clone to use ssh access so you won't have to enter your Github
5358
password every time, which you can do using these commands:
5459

5560
```
56-
git clone --branch development [email protected]:<myGithubUsername>/ERF.git
57-
58-
# Then, navigate into your repo, add a new remote for the main ERF repo, and fetch it:
61+
git clone [email protected]:erf-model/ERF.git
5962
cd ERF
60-
git remote add upstream https://github.com/erf-model/ERF
61-
git remote set-url --push upstream [email protected]:<myGithubUsername>/ERF.git
62-
git fetch upstream
6363
64-
# We recommend setting your development branch to track the upstream one instead of your fork:
65-
git branch -u upstream/development
64+
# Add your own fork.
65+
# Here <Jane> is the name you give to your fork. It does not need to be your github name.
66+
# <myGithubUsername> is your GitHub name.
67+
git remote add <Jane> [email protected]:<myGithubUsername>/ERF.git
68+
git fetch <Jane>
69+
70+
# Don't push to the main repo. Instead pushes go to your fork.
71+
git remote set-url --push origin [email protected]:<myGithubUsername>/ERF.git
6672
```
6773

68-
For instructions on setting up SSH access to your Github account on a new machine, see [here.](https://docs.github.com/en/github/authenticating-to-github/connecting-to-github-with-ssh)
74+
For instructions on setting up SSH access to your Github account on a new
75+
machine, see
76+
[here.](https://docs.github.com/en/github/authenticating-to-github/connecting-to-github-with-ssh)
6977

7078
If you instead prefer to use HTTPS authentication, configure your local clone as follows:
7179

7280
```
73-
git clone --branch development https://github.com/<myGithubUsername>/ERF.git
74-
75-
# Navigate into your repo, add a new remote for the main ERF repo, and fetch it
81+
git clone https://github.com/erf-model/ERF.git
7682
cd ERF
77-
git remote add upstream https://github.com/erf-model/ERF
78-
git remote set-url --push upstream https://github.com/<myGithubUsername>/ERF.git
79-
git fetch upstream
8083
81-
# We recommend setting your development branch to track the upstream one instead of your fork:
82-
git branch -u upstream/development
84+
# Add your own fork.
85+
# Here <Jane> is the name you give to your fork. It does not need to be your github name.
86+
# <myGithubUsername> is your GitHub name.
87+
git remote add <Jane> https://github.com/<myGithubUsername>/ERF.git
88+
git fetch <Jane>
89+
90+
# Don't push to the main repo. Instead pushes go to your fork.
91+
git remote set-url --push origin https://github.com/<myGithubUsername>/ERF.git
8392
```
8493

8594
Now you are free to play with your fork (for additional information, you can visit the
8695
[Github fork help page](https://help.github.com/en/articles/fork-a-repo)).
8796

8897
> Note: you do not have to re-do the setup above every time.
89-
> Instead, in the future, you need to update the `development` branch
90-
> on your fork with
91-
> ```
92-
> git checkout development
93-
> git pull
94-
> ```
9598
9699
Make sure you are on the `development` branch with
97100
```
98101
git checkout development
102+
git pull
99103
```
100104
in the ERF directory.
101105

102106
Create a branch `<branch_name>` (the branch name should reflect the piece
103-
of code you want to add, like `add_new_physics`) with
107+
of code you want to add, like `high_order_interpolation`) with
104108
```
105109
git checkout -b <branch_name>
106110
```
@@ -122,14 +126,15 @@ follow the developments and identify bugs.
122126
For the moment, commits are on your local repo only. You can push them to
123127
your fork with
124128
```
125-
git push -u origin <branch_name>
129+
git push -u <Jane> <branch_name>
126130
```
127131

128132
If you want to synchronize your branch with the `development` branch (this is useful
129133
when `development` is being modified while you are working on
130134
`<branch_name>`), you can use
131135
```
132-
git pull upstream development
136+
# merge ERF main repo's development into current branch
137+
git pull origin development
133138
```
134139
and fix any conflicts that may occur.
135140

@@ -174,7 +179,7 @@ git branch -D <branch_name>
174179

175180
and you can delete the remote one on your fork with
176181
```
177-
git push origin --delete <branch_name>
182+
git push <Jane> --delete <branch_name>
178183
```
179184

180185
Generally speaking, you want to follow the following rules.
@@ -185,50 +190,19 @@ Generally speaking, you want to follow the following rules.
185190

186191
* Do not commit in your `development` branch that tracks ERF `development` branch.
187192

188-
* Always create a new branch based off `development` branch for each pull request, unless you are
189-
going to use git to fix it later.
193+
* Always create a new branch based off the latest `development` branch for
194+
each pull request, unless you are going to use git to fix it later.
190195

191196
If you have accidentally committed in `development` branch, you can fix it as follows,
192197
```
193-
git checkout -b new_branch
198+
git checkout -b new_branch # save your changes in a branch
194199
git checkout development
195-
git reset HEAD~2 # Here 2 is the number of commits you have accidentally committed in development
196-
git checkout .
200+
git fetch origin
201+
git reset --hard origin/development
197202
```
198203
After this, the local `development` should be in sync with ERF `development` and your recent
199204
commits have been saved in `new_branch` branch.
200205

201-
If for some reason your PR branch has diverged from ERF, you can try to fix it as follows. Before
202-
you try it, you should back up your code in case things might go wrong.
203-
```
204-
git fetch upstream # assuming upstream is the remote name for the official ERF repo
205-
git checkout -b xxx upstream/development # replace xxx with whatever name you like
206-
git branch -D development
207-
git checkout -b development upstream/development
208-
git checkout xxx
209-
git merge yyy # here yyy is your PR branch with unclean history
210-
git rebase -i upstream/development
211-
```
212-
You will see something like below in your editor,
213-
```
214-
pick 7451d9d commit message a
215-
pick c4c2459 commit message b
216-
pick 6fj3g90 commit message c
217-
```
218-
This now requires a bit of knowledge on what those commits are, which commits have been merged,
219-
which commits are actually new. However, you should only see your only commits. So it should be
220-
easy to figure out which commits have already been merged. Assuming the first two commits have been
221-
merged, you can drop them by replace `pick` with `drop`,
222-
```
223-
drop 7451d9d commit message a
224-
drop c4c2459 commit message b
225-
pick 6fj3g90 commit message c
226-
```
227-
After saving and then exiting the editor, `git log` should show a clean history based on top of
228-
`development` branch. You can also do `git diff yyy..xxx` to make sure nothing new was dropped. If
229-
all goes well, you can submit a PR using `xxx` branch.
230-
Don't worry, if something goes wrong during the rebase, you an always `git rebase --abort` and start over.
231-
232206
## ERF Coding Style Guide
233207

234208
### Code Guidelines
@@ -255,9 +229,8 @@ ERF developers should adhere to the following coding guidelines:
255229
for (int n=0; n<10; ++n)
256230
Print() << "Not like this.";
257231
```
258-
* Add a space after the function name and before the
259-
parenthesis of the parameter list (but
260-
not when simply calling the function). For example:
232+
* When declaring and defining a function, add a space after the function name and before the
233+
parenthesis of the parameter list (but not when simply calling the function). For example:
261234
```cpp
262235
void CorrectFunctionDec (int input)
263236
```
@@ -272,56 +245,3 @@ not when simply calling the function). For example:
272245
```
273246
These guidelines should be adhered to in new contributions to ERF, but
274247
please refrain from making stylistic changes to unrelated sections of code in your PRs.
275-
276-
### Fixing Style Issues
277-
278-
On any pull request, or any new commits to an open pull request that trigger
279-
the ERF CI tests, ERF will run style checks. These checks ensure the developer
280-
is using spaces instead of tabs and has not inserted any whitespace at the end
281-
of source lines.
282-
283-
We require pull requests to pass these style checks before merging. If failures
284-
arise, there is an easy way to automatically fix style issues like this by
285-
running the following shell commands from the main ERF repository.
286-
287-
For removing whitespace at the end of lines:
288-
289-
```
290-
$ .github/workflows/style/check_trailing_whitespaces.sh
291-
```
292-
293-
For replacing tabs with 4 spaces:
294-
295-
```
296-
$ .github/workflows/style/check_tabs.sh
297-
```
298-
299-
These commands will modify your local source files, so it is best to run these
300-
commands after committing your local changes and then add and commit the style
301-
changes that result.
302-
303-
These commands will also output a git diff that shows the changes made by the
304-
style scripts.
305-
306-
### API Documentation Using Doxygen
307-
308-
The Doxygen documentation is designed for advanced user-developers. It aims
309-
to maximize the efficiency of a search-and-find style of locating information.
310-
Doxygen style comment blocks should proceed the namespace, class, function, etc.
311-
to be documented where appropriate. For example:
312-
```cpp
313-
/**
314-
* \brief A one line description.
315-
*
316-
* \param[in] variable A short description of the variable.
317-
* \param[inout] data The value of data is read and changed.
318-
*
319-
* A longer description can be included here.
320-
*/
321-
322-
void MyFunction (int variable, MultiFab& data){
323-
...
324-
```
325-
Additional information regarding Doxygen comment formatting can be found
326-
in the [Doxygen Manual](https://www.doxygen.nl/manual/).
327-

Docs/sphinx_doc/Verification.rst

+6-5
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,15 @@ The following tests are used to verify the correct behavior of different algorit
1111
Scalar Advection
1212
----------------
1313

14-
Here we present two convergence studies of simple scalar advection with a uniform velocity field.
14+
Here we present spatial and temporal convergence studies for simple scalar advection with a uniform velocity field.
1515
The initial data has constant density and pressure, constant velocity :math:`u=10` in the x-direction,
1616
and a scalar initialized with profile :math:`cos(\pi x)` in a domain that is 2 units wide and
1717
periodic in the lateral directions with slip walls on top and bottom.
1818
The simulation is run for one period, i.e. until time :math:`t=0.2`
1919

20-
The first study, shown below on the left, tests the horizontal advection stencils for
21-
second through sixth order, including the WENO 3rd and 5th order stencils. In all of these cases,
20+
The first study, shown below on the left, tests the horizontal centered/upwind advection stencils for
21+
second through sixth order. The study on the right tests the WENO 3rd and 5th order stencils,
22+
with and without the ``smoothing'' contributions in the stencil. In all of these cases,
2223
the time step was held fixed at :math:`\Delta t = 0.0000078125` to ensure that the spatial error dominates
2324
the temporal error.
2425
@@ -35,7 +36,7 @@ the temporal error.
3536
+-----------------------------------------------------+------------------------------------------------------+
3637
| |aconv| | |bconv| |
3738
+-----------------------------------------------------+------------------------------------------------------+
38-
| Spatial convergence study (centered/upwind) | Temporal convergence study (WENO) |
39+
| Spatial convergence study (centered/upwind) | Spatial convergence study (WENO) |
3940
+-----------------------------------------------------+------------------------------------------------------+
4041
4142
The second study tests the temporal accuracy by first setting :math:`\Delta t = 0.0005`
@@ -49,7 +50,7 @@ accuracy of the RK3 scheme.
4950
5051
.. _fig:convergence_temporal
5152
52-
.. table:: Convergence studies of temporal error
53+
.. table:: Convergence study of temporal error
5354
5455
+-----------------------------------------------------+
5556
| |tconv| |

0 commit comments

Comments
 (0)