Code Structure#
Let’s look at the home page of DP-GEN. https://github.com/deepmodeling/dpgen
├── build
├── CITATION.cff
├── conda
├── dist
├── doc
├── dpgen
├── dpgen.egg-info
├── examples
├── LICENSE
├── README.md
├── requirements.txt
├── setup.py
└── tests
tests: unittest tools for developers.examples: templates for PARAM and MACHINE files for different software, versions and tasks. For details of the parameters in PARAM, you can refer toTASK parameterschapters in this document. If you are confused about how to set up a JSON file, you can also use dpgui
Most of the code related to DP-GEN functions is in the dpgen directory. Open the dpgen directory, and we can see
├── arginfo.py
├── auto_test
├── collect
├── data
├── database
├── _date.py
├── dispatcher
├── generator
├── __init__.py
├── main.py
├── __pycache__
├── remote
├── simplify
├── tools
├── util.py
└── _version.py
auto_testcorresponds todpgen autotest, for undertaking materials property analysis.collectcorresponds todpgen collect.datacorresponds todpgen init_bulk,dpgen init_surfanddpgen init_reaction, for preparing initial data of bulk and surf systems.databaseis the source code for collecting data generated by DP-GEN and interface with database.simplifycorresponds todpgen simplify.remoteanddispatcher: source code for automatically submiting scripts,maintaining job queues and collecting results. Notice this part hase been integrated into dpdispatchergeneratoris the core part of DP-GEN. It’s for main process of deep generator. Let’s open this folder.
├── arginfo.py
├── ch4
├── __init__.py
├── lib
└── run.py
run.py is the core of DP-GEN, corresponding to dpgen run. We can find make_train, run_train, … post_fp, and other steps related functions here.