Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add user guide #876

Merged
merged 21 commits into from
Aug 21, 2022
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions doc/README.md

This file was deleted.

117 changes: 117 additions & 0 deletions doc/how-to-contribute.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
# How to contribute

The way to make contributions is through making pull requests(PR for short). After your PR is merged, the changes you make can be applied by other users.

<div align=center><href="https://sm.ms/image/qt1MWOfYbQzKGJC" target="_blank"><img src="https://s2.loli.net/2022/08/16/qt1MWOfYbQzKGJC.png" width="60%"></div>

Firstly, fork in DP-GEN repository. Then you can clone the repository, build a new branch, make changes and then make a pull request.

---

## How to contribute to DP-GEN

DP-GEN adopts the same convention as other softwares in DeepModeling Community.
njzjz marked this conversation as resolved.
Show resolved Hide resolved

You can first refer to DeePMD-kit's
[Contributing guide](https://github.com/deepmodeling/deepmd-kit/edit/devel/CONTRIBUTING.md)
HuangJiameng marked this conversation as resolved.
Show resolved Hide resolved
and [Developer guide](https://github.com/deepmodeling/deepmd-kit/edit/devel/doc/development/index.md).
HuangJiameng marked this conversation as resolved.
Show resolved Hide resolved

Welcome to the repository of DP-GEN https://github.com/deepmodeling/dpgen

If you have no idea how to fix your problem or where to find the relative code, see OVERVIEW/Overview of the structure of the DP-GEN repository on this website.

### Use command line
You can use git with the command line, or open the repository on Github Desktop. Here is a video as a demo of making changes to DP-GEN and publishing it with command line.

https://www.youtube.com/watch?v=DPApc1_eNS8
HuangJiameng marked this conversation as resolved.
Show resolved Hide resolved

> If you have never used Github before, remember to generate your ssh key and configure the public key in Github Settings.
> If you can't configure your username and password, please use token.
> The explanation from Github see https://github.blog/2020-12-15-token-authentication-requirements-for-git-operations/
Chinese tutorial see https://blog.csdn.net/Saintmm/article/details/119835900

### Use Github Desktop
Also, you can use Github Desktop to make PR.
The following shows the steps to clone the repository and add your doc to tutorials. If it is your first time using Github, Open with Github Desktop is recommended. Github Desktop is a software, which can make your operations on branches visually.

<div align=center><href="https://sm.ms/image/ShdQXosaRM51Jqv" target="_blank"><img src="https://s2.loli.net/2022/08/16/ShdQXosaRM51Jqv.png" width="40%"></div>


After you clone it to your PC, you can open it with Github Desktop.

<div align=center><href="https://sm.ms/image/NMApYxjaqS4DGEz" target="_blank"><img src="https://s2.loli.net/2022/08/16/NMApYxjaqS4DGEz.png" width="40%"></div>

Firstly, create your new branch based on devel branch.

<div align=center><href="https://sm.ms/image/3Eqm162oQ8Lcg9P" target="_blank"><img src="https://s2.loli.net/2022/08/16/3Eqm162oQ8Lcg9P.png" width="40%"></div>

Secondly, add your doc to the certain directory in your local repository, and add its name into index.

For example, see https://github.com/deepmodeling/tutorials/pull/43.
Remember to add the filename of your doc into index!

This is a case of failed contribution https://github.com/deepmodeling/tutorials/pull/49.
Without being listed in index, the document will not be shown on the website.

(And here is how it has been fixed https://github.com/deepmodeling/tutorials/pull/50. )

Thirdly, select the changes that you what to push, and commit to it. Press "Publish branch" to push your origin repository to the remote branch.

<div align=center><href="https://sm.ms/image/3dyQAKplTnR2tX6" target="_blank"><img src="https://s2.loli.net/2022/08/16/3dyQAKplTnR2tX6.png" width="40%"></div>

Finally, you can check it on github and make a pull request. Press "Compare & pull request" to make a PR.

(Note: please commit pr to the devel branch)

<div align=center><href="https://sm.ms/image/Uj9m6zGtXRh1L3a" target="_blank"><img src="https://s2.loli.net/2022/08/16/Uj9m6zGtXRh1L3a.png" width="80%"></div>

## How to contribute to DP-GEN tutorials and documents
The documents of DP-GEN https://github.com/deepmodeling/dpgen/tree/master/doc
- If you want to add the documentation of a toy model, simply put your file in the directory doc/toymodels/ and push;
- If you want to add a new directory for a new category of instructions, make a new directory and add it in doc/index.rst.

Tutorials repository: https://github.com/deepmodeling/tutorials
The structure of tutorials and the preparation before writing a document see https://tutorials.deepmodeling.com/en/devel/Resources/writingTips.html#

The latest page of DP-GEN Docs

<div align=center><href="https://sm.ms/image/zEPKuj3TdaHI57b" target="_blank"><img src="https://s2.loli.net/2022/08/16/zEPKuj3TdaHI57b.png" width="60%"></div>

### Examples of contributions
Example 1(a merged one): https://github.com/deepmodeling/dpgen/pull/758
Example 2(a simple one for beginner): https://github.com/deepmodeling/dpgen/pull/844
### 1. Push your doc

<div align=center><href="https://sm.ms/image/T4Zb8uiDXGeyYvc" target="_blank"><img src="https://s2.loli.net/2022/08/16/T4Zb8uiDXGeyYvc.png" width="60%"></div>

### 2. Add the directory in index.rst

<div align=center><href="https://sm.ms/image/q3iKvzQ8oRmfVLt" target="_blank"><img src="https://s2.loli.net/2022/08/16/q3iKvzQ8oRmfVLt.png" width="60%"></div>

### 3. Build and check it

As mentioned in "How to build the website to check if the modification works".

### 4. Make pull request to dpgen

https://github.com/deepmodeling/dpgen/pulls

### How to build the website to check if it works

1. Fork https://github.com/deepmodeling/dpgen
2. Create account on readthedocs
readthedocs.org
https://readthedocs.org/
3. Import https://github.com/<your-github-username>/dpgen.git
Remember to set Project homepage as https://github.com/<your-github-username>/dpgen , and set the Default branch as the one you do modification in Advanced Settings.

<div align=center><href="https://sm.ms/image/4cVRb7ytT1h5l9n" target="_blank"><img src="https://s2.loli.net/2022/08/16/4cVRb7ytT1h5l9n.png" width="60%"></div>

(“doc_overview” is just an example, please change it into your branch's name.)

4. Build Version

<div align=center><href="https://sm.ms/image/CsJ7S5xeTYh9EWp" target="_blank"><img src="https://s2.loli.net/2022/08/16/CsJ7S5xeTYh9EWp.png" width="60%"></div>
HuangJiameng marked this conversation as resolved.
Show resolved Hide resolved

---
After successfully making a PR, developers will check it and give comments. It will be merged after everything done. Then CONGRATULATIONS! You become a first-time contributor to DP-GEN!
3 changes: 2 additions & 1 deletion doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ DPGEN's documentation

Tutorials <https://tutorials.deepmodeling.com/en/latest/Tutorials/DP-GEN/>
troubleshooting/index
user-guide


.. _Contribution:
Expand All @@ -75,7 +76,7 @@ DPGEN's documentation
:maxdepth: 2
:caption: Contribution Guide

README.md
how-to-contribute
api/api
credits.rst

Expand Down
31 changes: 31 additions & 0 deletions doc/user-guide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# User Guide
## Discussions:

<div align=center><href="https://sm.ms/image/DVrYCuwFlM4Pqni" target="_blank"><img src="https://s2.loli.net/2022/08/16/DVrYCuwFlM4Pqni.png" width="60%"></div>

Welcome everyone to participate in the discussion about DP-GEN in the discussion module. You can ask for help, share an idea or anything to discuss here. The website is https://github.com/deepmodeling/dpgen/discussions
HuangJiameng marked this conversation as resolved.
Show resolved Hide resolved
Note: before you raise a question, please check TUTORIAL/FAQs and search history discussions to find solutions.

## Issue:

<div align=center><href="https://sm.ms/image/Tu1dRX2L6zO5Yfq" target="_blank"><img src="https://s2.loli.net/2022/08/16/Tu1dRX2L6zO5Yfq.png" width="60%"></div>

If you want to make a bug report or a request for new feature, you can make an issue in the issue module.
HuangJiameng marked this conversation as resolved.
Show resolved Hide resolved

<div align=center><href="https://sm.ms/image/FajXcmwbBJo34y1" target="_blank"><img src="https://s2.loli.net/2022/08/16/FajXcmwbBJo34y1.png" width="60%"></div>

Here are the types you can choose. A proper type can help developer figure out what you need. Also, you can assign yourself to solve the issue. Your contribution is welcomed!
HuangJiameng marked this conversation as resolved.
Show resolved Hide resolved

Note: before you raise a question, please check TUTORIAL/FAQs and search history issues to find solutions.

## Tutorials

Tutorials can be found here. [https://tutorials.deepmodeling.com/en/latest/](https://tutorials.deepmodeling.com/en/latest/Tutorials/DP-GEN/index.html)

## Example

If you have no idea how to prepare a PARAM for your task, you can find examples of PARAM for different tasks in https://github.com/deepmodeling/dpgen/tree/master/examples.

For example, if you want to set specific template for LAMPPS, you can find an example [here](https://github.com/deepmodeling/dpgen/blob/master/examples/run/dp-lammps-enhance_sampling/param.json)
HuangJiameng marked this conversation as resolved.
Show resolved Hide resolved

## [Pull requests - How to contribute](https://docs.deepmodeling.com/projects/dpgen/en/latest/README.html)