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

Doc api cc #663

Merged
merged 10 commits into from
Jun 3, 2021
Merged

Doc api cc #663

merged 10 commits into from
Jun 3, 2021

Conversation

tuoping
Copy link
Collaborator

@tuoping tuoping commented May 25, 2021

Made api_cc.rst in doc/development/

@codecov-commenter
Copy link

codecov-commenter commented May 25, 2021

Codecov Report

Merging #663 (ab8fc7f) into devel (cb2c118) will decrease coverage by 15.70%.
The diff coverage is n/a.

❗ Current head ab8fc7f differs from pull request most recent head d478d19. Consider uploading reports for the commit d478d19 to get more accurate results
Impacted file tree graph

@@             Coverage Diff             @@
##            devel     #663       +/-   ##
===========================================
- Coverage   82.36%   66.66%   -15.71%     
===========================================
  Files         114        6      -108     
  Lines        9312       15     -9297     
===========================================
- Hits         7670       10     -7660     
+ Misses       1642        5     -1637     
Impacted Files Coverage Δ
source/api_cc/include/DeepPot.h 66.66% <ø> (ø)
source/api_cc/include/DeepTensor.h 20.00% <ø> (ø)
deepmd/infer/deep_tensor.py
deepmd/cluster/local.py
source/api_cc/tests/test_deeppolar.cc
source/lib/tests/test_prod_virial_a.cc
source/lib/tests/test_neighbor_list.cc
source/op/_prod_virial_se_r_grad.py
deepmd/utils/neighbor_stat.py
source/lib/tests/test_ewald.cc
... and 100 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update cb2c118...d478d19. Read the comment docs.

Copy link
Member

@amcadmus amcadmus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We haven't provided any documentation string in deepmd.DeepPot nor deepmd.DeepPotModelDevi, so I do not understand how this commit works.

…oxyfile to generated xml/ from C++. And then api_cc.rst can be generated by breathe from xml/.
@tuoping
Copy link
Collaborator Author

tuoping commented May 25, 2021

I found only doxygen to generate C++ api. But it cannot be installed with pip. So I had to add a precompiled directory xml/. Is there a way to include an external package by setup.py? @njzjz
A preview here:
https://deepmd-kit-testdoc.readthedocs.io/en/doc-api_cc/development/api_cc.html
As a alternative, in lammps documents, there is only a road guide:
While for the complete C library API is provided in the library.h

@njzjz
Copy link
Member

njzjz commented May 25, 2021

The following question said doxygen had been installed in the readthedocs.
https://stackoverflow.com/questions/36064976/using-doxygen-in-read-the-docs

@njzjz
Copy link
Member

njzjz commented May 25, 2021

@tuoping
Copy link
Collaborator Author

tuoping commented May 26, 2021

It's working now.
Preview here:
https://deepmd-kit-testdoc.readthedocs.io/en/doc-api_cc/development/api_cc.html
Thank you all.

@tuoping
Copy link
Collaborator Author

tuoping commented May 27, 2021

I included an extra package "exhale". C++ API display is looking a lot better now.
Preview here:
https://deepmd-kit-testdoc.readthedocs.io/en/doc-api_cc/API_CC/api_cc.html

@njzjz
Copy link
Member

njzjz commented May 27, 2021

@njzjz
Copy link
Member

njzjz commented May 27, 2021

using namespace tensorflow;

@denghuilu Is it possible to remove this line?

@njzjz
Copy link
Member

njzjz commented May 28, 2021

@tuoping Could you give an example of how to write documents for APIs? Then I can fill it.

@tuoping
Copy link
Collaborator Author

tuoping commented May 29, 2021

Use exhale to invoke doxygen and then generate a structured api_cc
https://exhale.readthedocs.io/en/latest/usage.html#setup-the-extensions-in-conf-py
Also
https://stackoverflow.com/questions/59990484/doxygensphinxbreatheexhale

@njzjz
Copy link
Member

njzjz commented May 29, 2021

@tuoping do you know what's wrong with my commit? It doesn't work.

@tuoping
Copy link
Collaborator Author

tuoping commented May 29, 2021

I recompiled it on readthedocs, and it worked.
Preview here:
https://deepmd-kit-testdoc.readthedocs.io/en/doc-api_cc/API_CC/classdeepmd_1_1DeepPot.html#exhale-class-classdeepmd-1-1deeppot

@amcadmus amcadmus merged commit ab7621e into deepmodeling:devel Jun 3, 2021
@tuoping tuoping deleted the doc-api_cc branch June 4, 2021 01:49
This was referenced Jun 10, 2021
gzq942560379 pushed a commit to HPC-AI-Team/deepmd-kit that referenced this pull request Sep 1, 2021
* Doxyfile cannot be installed from pip, therefore I precompiled with doxyfile to generated xml/ from C++. And then api_cc.rst can be generated by breathe from xml/.

* Edit conf.py to include doxygen

* Edit conf.py to enable doxygen on readthedocs

* Add specification in conf.py to refine the html layout of api_cc.rst

* Included exhale to make prettier C++ API.

* Update conf.py

* add a function description to see if it works

* it should be put into the header file?

* add documents for DeepPot and DeepTensor

* add documents for some common functions

Co-authored-by: tuoping <[email protected]>
Co-authored-by: Jinzhe Zeng <[email protected]>
njzjz pushed a commit to njzjz/deepmd-kit that referenced this pull request Sep 21, 2023
* fix typo in github actions release to conda

* Get from_poscar_path only when from_poscar is true (deepmodeling#537)

Change-Id: I17774bee345634e4e72bd783e8112eefaaf9f0d3

Co-authored-by: Zhengju Sha <[email protected]>

* feature: merge run.py

* fix:fix syntax bug

* fix summary ratio bug

* fix: fix bug of var(calypso_run_opt_path) not defined

* reorganize code v1

* add: add unittest

* add: add some explainations of dp+calypso in README.md

* change a little bit in readme.md

* change position of function

* add deepmd-kit>=2.0.1 install_require in setup.py

* test failed cause no tensorflow module so add tensorflow in setup.py

* calc model devi in command line

* fix some small bugs of modd and PBS script of cpu

* fix unittest

* delete parse_input.dat

* fix unittest

* first reorganization

* secord reorganization

* fix bugs

* fix: fix bugs in modd_calypso.py write_modd.py and run.py

* change functions name and fix bugs

* remove modd_calypso.py

* remove: remove modd_calypso.py

* remove some useless outputs

* restore dispatcher/PBS.py

* refactor: make some changes in calypso related code

- rename model_devi_calypso.py run_calypso.py
- rename calypso.py make_calypso.py
- add new file calypso_check_outcar.py calypso_run_opt.py
- add new file calypso_run_model_devi.py
- delete write_modd.py
- modify README.md and run.py

* refactor: move calypso main code(run.py) into run_calypso.py and modify test_calypso.py

* docs: modify README.md related to CALYPSO

* delete some useless comments in run.py

* add write_model_devi_out function into make_calypso.py for passing unittest

* fix a spelling mistake in calypso_run_opt.py (famx -> fmax)

* change runopt script's name from run_opt.py to calypso_run_opt.py and fix bug in runopt script

* fix unittest

Co-authored-by: Han Wang <[email protected]>
Co-authored-by: felix5572 <[email protected]>
Co-authored-by: shazj99 <[email protected]>
Co-authored-by: Zhengju Sha <[email protected]>
Co-authored-by: Han Wang <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants