abinit/doc
trunk b825148186 Update copyright from 2024 to 2025 2025-02-17 11:53:44 +01:00
..
about Update KNOAN_PROBLEMS for v10.2.5, as well as update ot release notes. 2024-11-27 15:24:32 +01:00
build Update copyright from 2024 to 2025 2025-02-17 11:45:26 +01:00
config Update copyright from 2024 to 2025 2025-02-17 11:53:44 +01:00
css Fix log with CSS Important, remove old partials 2021-03-19 23:47:41 +01:00
developers Update copyright from 2024 to 2025 2025-02-17 11:45:26 +01:00
extra_javascript Migration to new mkdocs and mkdocs-material almost complete. Need to check internal links 2021-03-18 04:27:40 +01:00
faq Suppress pdf_icon.png, not needed and confusing. 2024-10-10 06:09:26 +02:00
guide Update copyright from 2024 to 2025 2025-02-17 11:45:26 +01:00
help_make Add make check for CMake 2025-01-02 21:43:37 +01:00
images mkdocs up and running 2018-02-25 23:29:53 +01:00
macroave Update copyright from 2024 to 2025 (to be continued) 2025-02-17 11:41:21 +01:00
maintainers Final(?) renaming of Psps_for_tests to Pspdir. 2024-11-20 18:36:18 +01:00
release_notes_obsolete Update copyright from 2024 to 2025 (to be continued). 2025-02-17 11:40:31 +01:00
theory Update copyright from 2024 to 2025 (to be continued) 2025-02-17 11:41:21 +01:00
topics Added documentation for the Variational Polaron Equation module 2024-10-14 17:34:30 +02:00
tutorial Update copyright from 2024 to 2025 2025-02-17 11:53:44 +01:00
variables removed extraneous .md files 2020-12-09 13:18:53 -04:00
.gitignore Adjust the text in doc/tutorial/index.md to the clickable schema. 2024-10-29 11:06:59 +01:00
AUTHORS init abinit 8.1.2 2016-07-02 07:56:36 +02:00
COPYING init abinit 8.1.2 2016-07-02 07:56:36 +02:00
ChangeLog init abinit 8.1.2 2016-07-02 07:56:36 +02:00
INSTALL Remove bzr files, move pseudos to developers section 2018-03-02 21:00:10 +01:00
LICENCE Add LICENCE file, as requested by NOMAD referee 2023-03-11 06:31:58 +01:00
NEWS init abinit 8.1.2 2016-07-02 07:56:36 +02:00
README Add README 2018-03-03 13:13:30 +01:00
README.md Cleanup by Miquel Royo 2024-10-31 05:54:30 +01:00
TODO.md fix spelling error 2020-03-27 13:39:46 -04:00
__init__.py Rename Psps_for_tests to Pspdir in all *.py and *.cmake files. 2024-11-20 18:10:32 +01:00
abichecks Fix different links 2018-03-27 15:49:50 +02:00
abiref.bib Cleanup by Miquel Royo 2024-10-31 05:54:30 +01:00
autogen.sh Update copyright from 2024 to 2025 2025-02-17 11:45:26 +01:00
configure.ac Update copyright from 2024 to 2025 ... (to be continued) 2025-02-17 11:37:43 +01:00
index.md update respfn rf2 tests 2024-02-22 11:49:29 -04:00
installation.md Add make check documentation 2025-01-02 18:55:54 +01:00
quicktest.sh Update copyright from 2024 to 2025 2025-02-17 11:45:26 +01:00
rules.am init abinit 8.1.2 2016-07-02 07:56:36 +02:00
tests Change the location of the symbolic link to tests (to ease further compatibility with the Web delivery) 2017-07-14 14:25:36 +02:00
wipeout.sh Update copyright from 2024 to 2025 2025-02-17 11:45:26 +01:00

README.md

Getting started with mkdocs

!!! warning

The code supports py2.7 and python3.6 but py3k is **strongly** suggested
especially when building the final version before deploying
as py3k has native support for unicode.

In addition, all the commands should be run in the top abinit directory (so one level above /doc)

Install the python packages required to build the static website with:

pip install -r requirements.txt

then install the mkdocs plugin with:

cd abimkdocs_plugin
python setup.py install

If you use conda, you may want to create a new environment based on python3.6 with:

conda create -n abinit-abimkdocs-2 python=3.6
source activate abinit-abimkdocs

and then install the packages with pip (see above commands).

MkDocs comes with a built-in dev-server that lets you preview your documentation as you work on it. Make sure you are in ~abinit, and then start our customized server by running the mksite.py serve command with the --dirtyreload option:

$ ./mksite.py serve --dirtyreload
Regenerating database...
Saving database to /Users/gmatteo/git_repos/abidocs/doc/tests/test_suite.cpkl
Initial website generation completed in 9.17 [s]
Generating markdown files with input variables of code: `abinit`...
...
...
INFO    -  Building documentation...
INFO    -  Cleaning site directory
[I 170826 03:37:05 server:283] Serving on http://127.0.0.1:8000
[I 170826 03:37:05 handlers:60] Start watching changes
[I 170826 03:37:05 handlers:62] Start detecting changes

Open up http://127.0.0.1:8000/ in your browser, and you'll see the default home page being displayed.

Use:

$ ./mksite.py --help

to get the list of commands and:

$ ./mksite.py COMMAND --help

to get the documentation of COMMAND.

Notes

topics are still in Yaml format wikilink syntax: [ [names|text] ] will become [ [text|namespace] ] .

Troubleshooting

If you get error message about ASCII being used as default encoding on your machine add:

export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8

to your ~/.bashrc and source it

How to add new variables

The yaml database has been replaced by python modules. The variables are now declared in ~abinit/abimkdocs/variables_CODENAME.py.

This file consists of a list of dictionaries, each dictionary contains the declaration of a single variable and the associated documentation in markdown format. Wikilinks, latex and markdown extensions can be used inside text. This is, for example, the declaration of the accuracy variable in python:

Variable(
    abivarname="accuracy",
    varset="basic",
    vartype="integer",
    topics=['Planewaves_basic', 'SCFControl_basic'],
    dimensions="scalar",
    defaultval=0,
    mnemonics="ACCURACY",
    text="""
Allows to tune the accuracy of a calculation by setting automatically the
variables according to the following table:

accuracy         | 1         | 2          | 3            | 4            | 5         | 6
---              |---        |---         |---           |---           |---        |---
[[ecut]]         | E_min     | E_med      | E_med        | E_max        | E_max     | E_max
[[pawecutdg]]    | ecut      | ecut       | 1.2 * ecut   | 1.5 * ecut   | 2 * ecut  | 2 * ecut
[[fband]]        | 0.5       | 0.5        | 0.5          | 0.5          | 0.75      | 0.75
...

For a parallel calculation, [[timopt]] is enforced to be 0.
...
""",
),

Adding a new variable is easy. Edit the python module and add a new item at the end of the list. A template is provided ...

How to add a new bibtex entry

Citations must be in bibtex format and provide enough information so that the python code can generate appropriated links in the website. For published work with a DOI, we strongly recommend avoiding a cut&paste from your bibtex files (there are units tests to enforce the presence of particular entries in the bibtex document and your bibtex may not fullfill these requirements).

A much better solution is to use BetterBib and the DOI of the article to fetch data from Crossref and produce the bibtex entry. BetterBib is available from the Python Package Index, so simply type:

pip install betterbib

and then use doi2bibtex from the command line:

doi2bibtex 10.1103/PhysRevLett.96.066402

Add the entry to the bibtex file and use the FirstAuthorYear convention for the key (make sure it's not a duplicated entry). Note that the bibtex ID must be of the form "FirstauthornameYEAR", e.g. "Amadon2008" (start with an uppercase letter, then lower case, then four-digit year). Possibly, a letter might be added in case of ambiguity: e.g. there exists also Amadon2008a Then, build the HTML pages using mksite.py serve.

Run the tests in ./tests/test_bibtex.py with pytest (see next section) to validate your changes.

Running the unit tests

Unit tests are located in the ./tests directory. To execute the tests, install pytest with:

pip install pytest

and then:

pytest -v ./tests/

Use

pytest -v ./tests/test_variables.py

to execute a particular module.

Build the website with:

./mksite.py build

then use

linkchecker site/index.html > links.err

!!! important

For the time being, linkchecker python2.7