From 6459543afd0c46669047bfefab90b6f695f90e22 Mon Sep 17 00:00:00 2001 From: q-posev Date: Tue, 21 Sep 2021 10:58:07 +0200 Subject: [PATCH] better front end documentation for numerical attributes --- src/templates_front/templator_front.org | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/templates_front/templator_front.org b/src/templates_front/templator_front.org index f299195..5211bdf 100644 --- a/src/templates_front/templator_front.org +++ b/src/templates_front/templator_front.org @@ -1087,13 +1087,18 @@ def close(trexio_file): | ~$group_dset_dtype_default$~ | Default datatype of the dataset [C] | ~double/int32_t~ | | ~$group_dset_dtype_single$~ | Single precision datatype of the dataset [C] | ~float/int32_t~ | | ~$group_dset_dtype_double$~ | Double precision datatype of the dataset [C] | ~double/int64_t~ | - | ~$default_prec$~ | Default precision for read/write without suffix [C] | ~64/32~ | | ~$group_dset_f_dtype_default$~ | Default datatype of the dataset [Fortran] | ~real(8)/integer(4)~ | | ~$group_dset_f_dtype_single$~ | Single precision datatype of the dataset [Fortran] | ~real(4)/integer(4)~ | | ~$group_dset_f_dtype_double$~ | Double precision datatype of the dataset [Fortran] | ~real(8)/integer(8)~ | | ~$group_dset_f_dims$~ | Dimensions in Fortran | ~(:,:)~ | | ~$group_dset_py_dtype$~ | Standard datatype of the dataset [Python] | ~float/int~ | + | ~$default_prec$~ | Default precision for read/write without suffix [C] | ~64/32~ | + | ~$is_index$~ | Expands to ~true~ if dataset has a type ~index~ [C] | ~true/false~ | + + Some of the aforementioned template variables with ~group_dset~ prefix are duplicated with ~group_num~ prefix, + e.g. you might find $group_num_dtype_double$ in the templates corresponding to numerical attributes. + The expanding values are the same as for ~group_dset~ and thus are not listed in the table above. Note: parent group name is always added to the child objects upon construction of TREXIO (e.g. ~num~ of ~nucleus~ group becomes @@ -1104,14 +1109,18 @@ def close(trexio_file): object) levels of =trex.json= . The parsed data is divided in 2 parts: - 1) Dimensioning variables (contain ~num~ in their names). These are always scalar integers. + 1) Single attributes. These can be numerical values or strings. 2) Datasets. These can be vectors, matrices or tensors. The types are indicated in =trex.json=. - Currently supported types: int, float and strings. + Currently supported data types: int, float and strings. For each of the aforementioned objects, TREXIO provides *has*, *read* and *write* functionality. TREXIO supports I/O with single or double precision for integer and floating point numbers. + *Note:* single integer attributes that contain ~num~ in their name (e.g. ~nucleus_num~) are + considered dimensioning variables and cannot be negative or 0. An attempt to write negative or 0 + value will result in ~TREXIO_INVALID_ARG_2~ exit code. + ** Templates for front end has/read/write a single numerical attribute *** Introduction