You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/developers.md
+91-23Lines changed: 91 additions & 23 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,20 +3,22 @@
3
3
-[Raising issues on GitHub](#raising-issues-on-github)
4
4
-[Modularization and module tests](#modularization-and-module-tests)
5
5
-[Contributing to ABACUS](#contributing-to-abacus)
6
-
-[Making pull requests](#making-pull-requests)
7
-
-[Providing uniy tests](#providing-unit-tests)
8
-
-[Upating documentation](#updating-documentation)
9
-
-[Macros](#macros)
10
-
-[Comment style for documentation](#comment-style-for-documentation)
11
-
- [Code Formatting style](#code-formatting-style)
6
+
-[Making pull requests](#making-pull-requests)
7
+
-[Providing uniy tests](#providing-unit-tests)
8
+
-[Upating documentation](#updating-documentation)
9
+
-[Macros](#macros)
10
+
-[Comment style for documentation](#comment-style-for-documentation)
11
+
-[Code Formatting style](#code-formatting-style)
12
12
[back to main page](../README.md)
13
13
14
14
## Raising issues on GitHub
15
+
15
16
Raising issues on GitHub is a convernient way to notify the develper team about bugs and feature requests of the ABACUS code. We provide a few templates for issues.
16
17
17
18
[back to top](#for-developers)
18
19
19
20
## Modularization and module tests
21
+
20
22
The ABACUS code is reconstructed to form several self-contained modules. A description of modules can be found in the [installation guide](install.md#structure-of-source-code). We also provide module tests for the modules.
21
23
22
24
[back to top](#for-developers)
@@ -25,14 +27,65 @@ The ABACUS code is reconstructed to form several self-contained modules. A descr
25
27
26
28
### Making pull requests
27
29
30
+
1.[Fork](https://docs.github.com/en/github/getting-started-with-github/fork-a-repo) the abacus repo.
31
+
32
+
2. In your forked repository, make your changes in a new git branch:
33
+
34
+
```shell
35
+
git checkout -b my-fix-branch
36
+
```
37
+
38
+
3. Create your patch, including appropriate test cases.
39
+
40
+
4. Commit Your changes.
41
+
42
+
5. Push your branch to GitHub:
43
+
44
+
```shell
45
+
git push origin my-fix-branch
46
+
```
47
+
48
+
6. In GitHub, send a pull request to `abacus-develop:develop`.
49
+
50
+
7. After your pull request is merged
51
+
52
+
After your pull request is merged, you can safely delete your branch and pull the changes from the main (upstream) repository:
53
+
54
+
- Delete the remote branch on GitHub either through the GitHub web UI or your local shell as follows:
55
+
56
+
```shell
57
+
git push origin --delete my-fix-branch
58
+
```
59
+
60
+
- Check out the master branch:
61
+
62
+
```shell
63
+
git checkout develop -f
64
+
```
65
+
66
+
- Delete the local branch:
67
+
68
+
```shell
69
+
git branch -D my-fix-branch
70
+
```
71
+
72
+
- Update your master with the latest upstream version:
73
+
74
+
```shell
75
+
git pull --ff upstream develop
76
+
```
77
+
28
78
### Providing unit tests
29
79
80
+
We use GoogleTest as our test framework. Write your test under the corresponding module folder at `abacus-develop/tests`, then append the test to `tests/CMakeLists.txt`. To build tests for abacus, set`BUILD_TESTING=1` when configuring with CMake. Executables of test programs will be under `build/tests`.
81
+
30
82
### Updating documentation
31
83
32
84
### Macros
33
85
34
86
### Comment Style for Documentation
35
-
ABACUS uses Doxygen to generate docs directly from `.h ` and `.cpp` code files.
87
+
88
+
ABACUS uses Doxygen to generate docs directly from `.h` and `.cpp` code files.
36
89
37
90
For comments that need to be shown in documents, these formats should be used -- **Javadoc style** (as follow) is recommended, though Qt style is also ok. See it in [official manual](https://www.doxygen.nl/manual/docblocks.html).
38
91
@@ -41,18 +94,22 @@ A helpful VS Code extension -- Doxygen Documentation Generator, can help you for
41
94
An practical example is class [LCAO_Descriptor](https://github.com/deepmodeling/abacus-develop/blob/deepks/source/src_lcao/LCAO_descriptor.h), the effects can be seen on [readthedocs page](https://abacus-deepks.readthedocs.io/en/latest/DeePKS_API/classLCAO__Descriptor.html#exhale-class-classLCAO-Descriptor)
42
95
43
96
- Detailed Comment Block
44
-
```
97
+
98
+
```cpp
45
99
/**
46
100
* ... text ...
47
101
*/
48
102
```
49
-
```
103
+
104
+
```cpp
50
105
///
51
106
/// ... text ...
52
107
///
53
108
```
109
+
54
110
or ( set JAVADOC_BANNER = YES )
55
-
```
111
+
112
+
```cpp
56
113
/********************************************//**
57
114
* ... text
58
115
***********************************************/
@@ -65,33 +122,40 @@ An practical example is class [LCAO_Descriptor](https://github.com/deepmodeling/
65
122
* ... text
66
123
***********************************************/
67
124
```
125
+
68
126
- Brief + Detailed Comment Block
69
-
```
127
+
128
+
```cpp
70
129
/// Brief description which ends at this dot. Details follow
71
130
/// here.
72
131
73
132
/// Brief description.
74
133
/** Detailed description. */
75
134
```
135
+
76
136
77
137
78
138
- Comments After the Item: Add a "<"
79
-
```
139
+
140
+
```cpp
80
141
int var; /**<Detailed description after the member */
81
142
int var; ///<Brief description after the member
82
143
```
83
144
84
145
- Parameters
85
146
usage: `[in],[out],[in,out] description`
86
147
eg.
87
-
```
148
+
149
+
```cpp
88
150
void foo(int v/**< [in] docs for input parameter v.*/);
89
151
```
152
+
90
153
or use `@param` commond
91
154
92
155
- List
93
156
eg.1
94
-
```
157
+
158
+
```cpp
95
159
/**
96
160
* Text before the list
97
161
* - list item 1
@@ -115,8 +179,10 @@ An practical example is class [LCAO_Descriptor](https://github.com/deepmodeling/
115
179
* More text in a new paragraph.
116
180
*/
117
181
```
182
+
118
183
eg.2
119
-
```
184
+
185
+
```cpp
120
186
/*!
121
187
* A list of events:
122
188
* - mouse events
@@ -131,13 +197,15 @@ An practical example is class [LCAO_Descriptor](https://github.com/deepmodeling/
0 commit comments