mirror of https://github.com/abinit/abinit.git
Only 3 broken links reported by linkchecker due to old release notes in site
This commit is contained in:
parent
78d126ad2f
commit
e221d890fd
|
@ -344,17 +344,9 @@ class Website(object):
|
|||
self.abinit_stats = AbinitStats(os.path.join(self.root, "maintainers", "statistics.txt"))
|
||||
self.abinit_stats.json_dump(os.path.join(self.root, "developers", "statistics.json"))
|
||||
|
||||
# Build AbinitTestSuite object.
|
||||
# Build flat list of tests.
|
||||
from doc import tests as tmod
|
||||
tests = []
|
||||
for t in tmod.abitests.select_tests(suite_args=[], regenerate=True):
|
||||
# DO NOT use isinstance to check if ChainOfTests but rely on duck typing.
|
||||
# See https://stackoverflow.com/questions/9006740/isinstance-and-type-equivelence-failure-due-to-import-mechanism-python-djan
|
||||
#if isinstance(t, ChainOfTests):
|
||||
if hasattr(t, "tests"):
|
||||
tests.extend(t.tests)
|
||||
else:
|
||||
tests.append(t)
|
||||
tests = tmod.abitests.select_tests(suite_args=[], regenerate=True, flat_list=True)
|
||||
|
||||
# Construct dictionary rpath --> test. Use OrderedDict to have deterministic behaviour.
|
||||
self.rpath2test = {}
|
||||
|
|
|
@ -6,8 +6,10 @@ from .tools import patch_syspath, AbimkdocsTest
|
|||
patch_syspath()
|
||||
|
||||
import os
|
||||
from abimkdocs.variables import get_variables_code, ValueWithUnit, ValueWithConditions, MultipleValue, Range
|
||||
import json
|
||||
|
||||
from collections import OrderedDict
|
||||
from abimkdocs.variables import get_variables_code, ValueWithUnit, ValueWithConditions, MultipleValue, Range
|
||||
|
||||
class VariablesTest(AbimkdocsTest):
|
||||
|
||||
|
@ -91,25 +93,26 @@ class VariablesTest(AbimkdocsTest):
|
|||
raise ValueError("\n".join(errors))
|
||||
|
||||
def test_variables_in_tests(self):
|
||||
"""
|
||||
Find variables that are not tested by comparing the database of variables
|
||||
with the input file of the test.
|
||||
Build dictionary with list of untested variables for the different codes.
|
||||
Finally compare the new dictionary with the reference one and fail if they don't match.
|
||||
"""
|
||||
# Build database with all input variables indexed by code name.
|
||||
from abimkdocs.variables import get_variables_code
|
||||
variables_code = get_variables_code()
|
||||
|
||||
# Build AbinitTestSuite object.
|
||||
from doc import tests as tmod
|
||||
tests = tmod.abitests.select_tests(suite_args=[], regenerate=True, flat_list=True)
|
||||
|
||||
# Build conter for the different codes, keys are the varnames from the database.
|
||||
from collections import Counter
|
||||
count_code = {}
|
||||
for code, d in variables_code.items():
|
||||
count_code[code] = Counter({k: 0 for k in d})
|
||||
|
||||
# Build AbinitTestSuite object.
|
||||
from doc import tests as tmod
|
||||
tests = []
|
||||
for t in tmod.abitests.select_tests(suite_args=[], regenerate=True):
|
||||
# DO NOT use isinstance to check if ChainOfTests but rely on duck typing.
|
||||
if hasattr(t, "tests"):
|
||||
tests.extend(t.tests)
|
||||
else:
|
||||
tests.append(t)
|
||||
|
||||
black_list = set([
|
||||
"atompaw", "cut3d", "multibinit", "fftprof", "conducti", "mrgscr",
|
||||
"mrgddb", "mrggkk", "mrgdv", "band2eps", "ujdet", "fold2Bloch", "macroave",
|
||||
|
@ -121,9 +124,10 @@ class VariablesTest(AbimkdocsTest):
|
|||
#print(vnset)
|
||||
count_code[test.executable].update(vnset)
|
||||
|
||||
untested = {}
|
||||
untested = OrderedDict()
|
||||
for code, count in count_code.items():
|
||||
untested[code] = []
|
||||
# Add it if var is not tested and not internal.
|
||||
for vname, c in count.items():
|
||||
if c == 0 and not variables_code[code][vname].is_internal:
|
||||
print(code, vname)
|
||||
|
@ -133,3 +137,15 @@ class VariablesTest(AbimkdocsTest):
|
|||
untested[code] = sorted(untested[code])
|
||||
print(code, untested[code])
|
||||
#assert 0
|
||||
|
||||
ref_json_path = os.path.join(os.path.dirname(__file__), "untested_variables.json")
|
||||
update_ref = False
|
||||
if update_ref:
|
||||
with open(ref_json_path, "wt") as fh:
|
||||
json.dump(untested, fh, indent=4)
|
||||
else:
|
||||
with open(ref_json_path, "rt") as fh:
|
||||
ref_untested = json.load(fh)
|
||||
|
||||
self.assertDictEqual(untested, ref_untested,
|
||||
msg="Detected mismatch between reference file and new list of untested variables.")
|
||||
|
|
|
@ -174,10 +174,12 @@ before it and after it (again, multiple blanks are irrelevant).
|
|||
ABINIT has also some (very limited) interpretor capabilities:
|
||||
|
||||
* It can identify one slash sign (/) being placed between two numbers
|
||||
(without a separating blank) as being the definition of a fraction (e.g. 1/3 will be interpreted as 0.33333333333333d0) ;
|
||||
(without a separating blank) as being the definition of a fraction
|
||||
(e.g. 1/3 will be interpreted as 0.33333333333333d0);
|
||||
|
||||
* It can identify sqrt(...) or -sqrt(...) as being the definition of a square root,
|
||||
when applied to one valid number - also without a separating blank - (e.g. -sqrt(0.75) will be interpreted as -0.8660254038d0) ;
|
||||
when applied to one valid number - also without a separating blank -
|
||||
(e.g. -sqrt(0.75) will be interpreted as -0.8660254038d0);
|
||||
|
||||
* Note, however, that these capabilities are NOT recursive.
|
||||
At most, a sqrt identifier can contain an expression that uses a fraction (e.g. sqrt(3/4) is OK),
|
||||
|
@ -206,9 +208,16 @@ the input variable is given: a **mnemonics**, possibly some
|
|||
**characteristics**, the **variable type** (integer, real, string), and the
|
||||
**default value**. Then, follows the description of the variable.
|
||||
|
||||
The **characteristics** can be one of the following: **DEVELOP**,
|
||||
**NO_MULTI**, **INTERNAL_ONLY**, **INPUT_ONLY**, **EVOLVING**, **ENERGY**
|
||||
, **LENGTH**, **MAGNETIC FIELD**, as described now.
|
||||
The **characteristics** can be one of the following:
|
||||
|
||||
- **DEVELOP**,
|
||||
- **NO_MULTI**
|
||||
- **INTERNAL_ONLY**
|
||||
- **INPUT_ONLY**
|
||||
- **EVOLVING**
|
||||
- **ENERGY**
|
||||
- **LENGTH**
|
||||
- **MAGNETIC FIELD**
|
||||
|
||||
#### Physical information
|
||||
|
||||
|
@ -219,23 +228,26 @@ can treat its physical dimensions with some units.
|
|||
The use of the atomic unit system (e.g. the Hartree for energy, about 27.211
|
||||
eV, and the Bohr for lengths about 0.529 Angstroms) is strictly enforced
|
||||
within the code. However, the dimension of some input variables can be
|
||||
specified and read correctly. At present, this applies to three types of
|
||||
specified and read correctly.
|
||||
|
||||
At present, this applies to three types of
|
||||
variables: those that have the dimension of an energy, those that have a
|
||||
dimension of length, and those that have a dimension of magnetic field. The
|
||||
first class of variables have the characteristics ' **ENERGY** ', and can be
|
||||
specified in atomic units (Hartree), or electron-volts, or Rydbergs, or even
|
||||
Kelvin. The second class of variables have the characteristics ' **LENGTH** ',
|
||||
first class of variables have the characteristics **ENERGY**, and can be
|
||||
specified in atomic units (Hartree), or electron-volts, or Rydbergs, or even Kelvin.
|
||||
|
||||
The second class of variables have the characteristics **LENGTH**,
|
||||
and can be specified in atomic units (Bohr) and angstrom. The third class of
|
||||
variables have the characteristics ' **MAGNETIC FIELD** ', and can be
|
||||
variables have the characteristics **MAGNETIC FIELD**, and can be
|
||||
specified in atomic units and Tesla. The abinit parser recognize a dimension
|
||||
if it is specified after the list of numbers following the input variable
|
||||
keyword, in the input file. The specification can be upper or lower case, or a
|
||||
mix thereof. Here is the list of recognized chains of characters:
|
||||
|
||||
* 'Ry ' => Rydberg (for energies)
|
||||
* 'eV ' => electron-volts (for energies)
|
||||
* 'K ' => Kelvin (for energies)
|
||||
* 'Angstr...' => Angstrom (for lengths)
|
||||
* Ry --> Rydberg (for energies)
|
||||
* eV --> electron-volts (for energies)
|
||||
* K --> Kelvin (for energies)
|
||||
* Angstr --> Angstrom (for lengths)
|
||||
|
||||
Except in the case of 'Angstr', the abbreviation must be used (i.e. 'Rydberg'
|
||||
will not be recognized presently). Other character chains, like "au" (for
|
||||
|
@ -263,15 +275,15 @@ even in reduced coordinates, through [[xred]].
|
|||
|
||||
Most of the variables can be used in the multi-dataset mode (see section 3.3),
|
||||
but those that must have a unique value throughout all the datasets are
|
||||
signaled with the indication ' **NO_MULTI** '.
|
||||
signaled with the indication **NO_MULTI**.
|
||||
|
||||
Some of the input variables, with characteristics ' **INPUT_ONLY** ' are only
|
||||
Some of the input variables, with characteristics **INPUT_ONLY** are only
|
||||
used by the parser, to initialize other input variables, but are not
|
||||
transmitted inside the code, beyond the parser. In particular, they are not
|
||||
echoed in the output file.
|
||||
|
||||
At variance, some internal variables, with characteristics ' **INTERNAL_ONLY**
|
||||
' are documented in the help files, but are not accessible as input variables.
|
||||
At variance, some internal variables, with characteristics **INTERNAL_ONLY**
|
||||
are documented in the help files, but are not accessible as input variables.
|
||||
The documentation is provided because such variables are sometimes mentioned
|
||||
in the output file.
|
||||
|
||||
|
@ -279,11 +291,11 @@ Most of the input variables do not change while a run is performed. Some of
|
|||
them, by contrast, may evolve, like the atomic positions, the atomic
|
||||
velocities, the cell shape, and the occupation numbers. Their echo, after the
|
||||
run has proceeded, will of course differ from their input value. They are
|
||||
signaled by the indication ' **EVOLVING** '.
|
||||
signaled by the indication **EVOLVING**.
|
||||
|
||||
#### Other information
|
||||
|
||||
'**DEVELOP**' refers to input variables that are not used in production
|
||||
**DEVELOP** refers to input variables that are not used in production
|
||||
runs, but have been introduced during development time, of a feature that is
|
||||
likely not finalized. For non ABINIT developers, it is strongly advised to skip them.
|
||||
|
||||
|
@ -492,10 +504,10 @@ is equivalent to
|
|||
### 3.6 File names in the multi-dataset mode
|
||||
|
||||
The root names for input and output files (potential, density, wavefunctions
|
||||
and so on) will receive an appendix: ' **_DS** ' followed by the index of the
|
||||
and so on) will receive an appendix: **_DS** followed by the index of the
|
||||
dataset. See section 4.
|
||||
|
||||
The ' **get** ' variables can be used to chain the calculations.
|
||||
The **get** variables can be used to chain the calculations.
|
||||
|
||||
Let us mention a few of them: [[getwfk]], [[getwfq]], [[getddk]], [[get1wf]],
|
||||
[[getden]], [[getcell]], [[getxred]] and [[getxcart]].
|
||||
|
@ -540,10 +552,10 @@ the record of the run in a nicer looking format.
|
|||
**abi**
|
||||
The other files READ by the code will have a name that is constructed from the
|
||||
root "abi". This apply to optionally read wavefunction, density or potential
|
||||
files. In the multi-dataset mode, this root will be complemented by ' **_DS**
|
||||
' and the dataset index. The list of possible input files, with their name
|
||||
created from the root 'abi', is the following (a similar list exist when '
|
||||
**_DS** ' and the dataset index are appended to 'abi'):
|
||||
files. In the multi-dataset mode, this root will be complemented by **_DS**
|
||||
and the dataset index. The list of possible input files, with their name
|
||||
created from the root 'abi', is the following (a similar list exist when
|
||||
**_DS** and the dataset index are appended to 'abi'):
|
||||
|
||||
* **abi_WFK**
|
||||
filename of file containing input wavefunction coefficients created from an
|
||||
|
@ -578,11 +590,11 @@ filename of file containing an approximate hessian, for eventual
|
|||
Except "ab_out" and "log", the other files WRITTEN by the code will have a
|
||||
name that is constructed from the root "abo". This apply to optionally written
|
||||
wavefunction, density, potential, or density of states files. In the multi-
|
||||
dataset mode, this root will be complemented by ' **_DS** ' and the dataset
|
||||
dataset mode, this root will be complemented by **_DS** and the dataset
|
||||
index. Also in the multi-dataset mode, the root "abo" can be used to build the
|
||||
name of **input** files, thanks to the 'get' variables. The list of possible
|
||||
output files, with their name created from the root 'abo' is the following (a
|
||||
similar list exists when ' **_DS** ' and the dataset index are appended to 'abo'):
|
||||
similar list exists when **_DS** and the dataset index are appended to 'abo'):
|
||||
|
||||
* **abo_WFK**
|
||||
Filename of file containing output wavefunction coefficients, if [[nqpt]]=0.
|
||||
|
|
|
@ -4,7 +4,7 @@ This file provides a description of the operations needed to install the
|
|||
ABINIT package, to generate the executable and to make the tests.
|
||||
It provides also the description of simple modifications of the package, for developers.
|
||||
|
||||
See a recent version of the [new user's guide](../users/new_user_guide.html),
|
||||
See a recent version of the [new user's guide](guide/new_user.md),
|
||||
for an introduction to the abinit package.
|
||||
See a recent version of the [[help:abinit]] file for learning how to use the code.
|
||||
Both of them can be found either on the Web, or in the doc subdirectory of the package.
|
||||
|
@ -347,21 +347,15 @@ appropriate library to be installed in order to work properly.
|
|||
|
||||
For further information on these internal tests, see the ~abinit/tests/built-in/README file.
|
||||
|
||||
You might now read the [new user's guide](../users/new_user_guide.html), in
|
||||
You might now read the [new user's guide](guide/new_user.md), in
|
||||
order to learn how to use the code, and then to follow the four basic
|
||||
tutorials, see the [entry page for the tutorials](../tutorial/welcome.html).
|
||||
tutorials, see the [entry page for the tutorials](tutorial/index.md).
|
||||
This is useful if you consider that the installation has been successful. Or
|
||||
you might continue to read the present Web page, and try to perform the speed
|
||||
tests, as well as the other tests.
|
||||
|
||||
## How to make the other tests?
|
||||
|
||||
Although it is possible to make the other tests without knowing really how to
|
||||
use the code (since all steps involved - the run and subsequent analysis - are
|
||||
done automatically), for the other tests, it is recommended to read the
|
||||
[new user's guide](../users/new_user_guide.html), and then to follow the four basic
|
||||
tutorials, see the [entry page for the tutorials](../tutorial/welcome.html).
|
||||
|
||||
Let us pursue with the testing procedure. Go to the ~abinit/tests directory, and issue:
|
||||
|
||||
make help
|
||||
|
@ -411,8 +405,7 @@ used (automatically), possibly the other input files (like pseudopotentials),
|
|||
the output files to be analyzed, the admitted tolerances with respect to
|
||||
reference output files, the author of the test, and a brief description of the test.
|
||||
|
||||
To run only the tests in this directory, simply issue, in the ~abinit/tests/
|
||||
directory:
|
||||
To run only the tests in this directory, simply issue, in the ~abinit/tests/ directory:
|
||||
|
||||
./runtests.py fast
|
||||
|
||||
|
@ -472,8 +465,7 @@ differences in:
|
|||
* the platform description (possibly);
|
||||
* the overall execution time (this is ALWAYS printed, even without differences).
|
||||
|
||||
So, a successful execution of one test case may be announced as follows in the
|
||||
fldiff.report file:
|
||||
So, a successful execution of one test case may be announced as follows in the fldiff.report file:
|
||||
|
||||
Case_1
|
||||
2
|
||||
|
@ -491,8 +483,7 @@ fldiff.report file:
|
|||
The fldiff.report file will have one such section for each test_case that was
|
||||
run. It begins with the number of the test case, then includes a few blocks of
|
||||
three lines: the number of the line where something is happening, followed by
|
||||
the content of the two lines. Finally, there is a one-line summary for each
|
||||
test case.
|
||||
the content of the two lines. Finally, there is a one-line summary for each test case.
|
||||
|
||||
More information on the fldiff script can be found in the ~abinit/tests/Scripts/fldiff.pl file.
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@ import warnings
|
|||
import mkdocs.__main__
|
||||
|
||||
if sys.version_info < (3, 6):
|
||||
warnings.warn("""Python >= 3.6 is STRONGLY recommended when building the Abinit documentation""")
|
||||
warnings.warn("Python >= 3.6 is STRONGLY recommended when building the Abinit documentation\n" * 20)
|
||||
|
||||
# We don't install with setup.py hence we have to add the directory [...]/abinit/tests to $PYTHONPATH
|
||||
pack_dir = os.path.dirname(os.path.abspath(__file__))
|
||||
|
|
|
@ -726,19 +726,16 @@ class AbinitTests(object):
|
|||
return d
|
||||
|
||||
def select_tests(self, suite_args, regenerate=False, keys=None,
|
||||
authors=None, ivars=None, with_pickle=True):
|
||||
authors=None, ivars=None, with_pickle=True, flat_list=False):
|
||||
"""
|
||||
Main entry point for client code.
|
||||
Return an instance of AbinitTestSuite
|
||||
Main entry point for client code. Return an instance of AbinitTestSuite
|
||||
|
||||
Args:
|
||||
with_pickle:
|
||||
Save the generated database in pickle format.
|
||||
with_pickle: Save the generated database in pickle format.
|
||||
flat_list: True if a flat list of tests should be returned instead
|
||||
of a list that can contain ChainOfTests objects.
|
||||
"""
|
||||
try:
|
||||
tests_todo = self._suite_args_parser(suite_args)
|
||||
except:
|
||||
raise
|
||||
|
||||
# Load the full database.
|
||||
database = self.get_database(regenerate=regenerate, with_pickle=with_pickle)
|
||||
|
@ -797,7 +794,19 @@ class AbinitTests(object):
|
|||
exclude_authors=exclude_authors,
|
||||
ivars=ivars
|
||||
)
|
||||
if not flat_list:
|
||||
return tests
|
||||
else:
|
||||
# Build flat list of tests.
|
||||
flat = []
|
||||
for t in tests:
|
||||
if isinstance(t, ChainOfTests):
|
||||
# DO NOT use isinstance to check if ChainOfTests but rely on duck typing.
|
||||
#if hasattr(t, "tests"):
|
||||
flat.extend(t.tests)
|
||||
else:
|
||||
flat.append(t)
|
||||
return flat
|
||||
|
||||
def generate_html_listoftests(self):
|
||||
"""Generate the ListOfTests files"""
|
||||
|
|
Loading…
Reference in New Issue