Code_Aster ®
Version
7.4
Titrate:
Procedure TEST_FICHIER
Date:
12/01/05
Author (S):
Key COURTEOUS Mr.
:
U4.92.04-A Page
: 1/6
Organization (S): EDF-R & D/AMA
Handbook of Utilization
U4.9- booklet: Impression of the results and tests
Document: U4.92.04
Procedure TEST_FICHIER
1 Goal
This macro-command makes it possible to test nonthe regression of files produced by the commands
Aster, mainly IMPR_RESU, but one could use it on any file.
The interest of this macro-command is that one can round the real numbers to tolerate one
certain variability of the values.
One uses the module Python md5 which provides a “signature” of the round file (called md5sum).
Turn over OK if the file is identical, to the round-offs of the real numbers close, with the file which served as
reference,
NOOK if not.
This command is used primarily by the cases tests to validate the not-regression of
results.
Handbook of Utilization
U4.9- booklet: Impression of the results and tests
HT-66/05/004/A
Code_Aster ®
Version
7.4
Titrate:
Procedure TEST_FICHIER
Date:
12/01/05
Author (S):
Key COURTEOUS Mr.
:
U4.92.04-A Page
: 2/6
2 Syntax
TEST_FICHIER (
UNITE
=/
links,
[I]
/8,
FICHIER =
fich,
[KN]
VALE_K
=
kval
,
[K32]
NB_CHIFFRE
=
/
nbch
,
[I]
/
6, [DEFAUT]
EPSILON
=
/
epsi
,
[R]
/
1.E-14
,
[DEFAUT]
EXPR_IGNORE
=
regexp,
[l_Kn]
REFERENCE
=
/
“ANALYTIQUE”
,
[KN]
/
“NON_REGRESSION”
,
VERSION = towards,
/
“SOURCE_EXTERNE”
,
/
“AUTRE_ASTER”
,
INFO
=
/
1
,
[DEFAUT]
/
2
,
)
Handbook of Utilization
U4.9- booklet: Impression of the results and tests
HT-66/05/004/A
Code_Aster ®
Version
7.4
Titrate:
Procedure TEST_FICHIER
Date:
12/01/05
Author (S):
Key COURTEOUS Mr.
:
U4.92.04-A Page
: 3/6
3 General information
This procedure makes it possible to test nonthe regression of files produced by the Aster commands,
mainly IMPR_RESU, but one could use it on any file.
The interest of this macro-command is that one can round the real numbers to tolerate one
certain variability of the values. One chooses:
· to preserve nbch significant digits,
· to regard as null the values lower than epsi,
· to be unaware of certain lines of the file according to regular expressions'.
One uses the module Python md5 which provides a “signature” of the round file (called md5sum).
So any other variation compared to a file of reference a such modification of a text
(title, name of components…) or a whole classification (which will not be round) will involve one
change of the signature of the file compared to the value of reference.
Notice 1:
The file must be closed so that the value is reliable (with for example DEFI_FICHIER,
ACTION = “TO RELEASE”).
Notice 2:
Even if one can use the command on the binary files, that does not have interest, because it y
will not have possible round-off, and thus the least variation will be reflected on the md5sum.
The method md5file can be called out of Code_Aster to obtain the value of the md5sum of one
file after round-offs:
iret, sum = md5file (fich=' nom_fichier', nbch=6, epsi=1.e-14, info=2)
4 Operands
4.1 Operand
UNITE
UNITE = links
Logical number of unit on which the result of test (OK or NOOK) will be written, except case
private individuals, links = 8 (file result).
4.2 Operand
FICHIER
FICHIER = fich,
One provides the name of the file here to be analyzed with his access path into relative compared to
repertory of execution or in absolute. Examples
: “fort.37” or
“./REPE_OUT/resultats.pos”.
4.3 Operand
VALE_K
VALE_K = kval
One provides here the value of the md5sum obtained on the file of reference (produced during an execution
the preceding one), provided in the form of a chain of 32 characters by the method hexdigest () of
modulate md5.
Handbook of Utilization
U4.9- booklet: Impression of the results and tests
HT-66/05/004/A
Code_Aster ®
Version
7.4
Titrate:
Procedure TEST_FICHIER
Date:
12/01/05
Author (S):
Key COURTEOUS Mr.
:
U4.92.04-A Page
: 4/6
4.4 Operand
NB_CHIFFRE
NB_CHIFFRE = nbch
It is about the number of significant digits preserved at the time of rounded real numbers.
More precisely, this number defines the format in which realities will be provided to the module md5.
Examples: 1.123456789E+01 rounded with
nbch=6, one obtains 11.2346 (format % 13.6g)
nbch=4, one obtains 11.23
(format % 11.4g)
4.5 Operand
EPSILON
EPSILON = epsi
All the numbers lower than this value are taken as null.
4.6 Operand
EXPR_IGNORE
EXPR_IGNORE = regexp
The lines of the file satisfying the regular expressions given behind this key word will be
been unaware of in the calculation of the md5sum.
Example:*
EXPR_IGNORE = (“DATE= [0-9] {2}/[0-9] {2}/[0-9] {4}”,
“^VERSION”)
Here lines containing DATE = jj/mm/aaaa where J, m, A are figures or starting with
VERSION are ignored.
4.7
Definition of the value of reference
REFERENCE =
/“ANALYTIQUE”:
the provided value of reference is “analytical”
/“NON_REGRESSION”:
the provided value of reference was obtained at the time of a precedent
calculation by Code_Aster
VERSION =
towards
worms is the number of the version of Aster which made it possible to obtain
value of reference (ex: “7.3.4”)
/“SOURCE_EXTERNE”:
the provided value of reference comes from a different program
that Aster (or of a bibliographical reference)
/“AUTRE_ASTER”:
the provided value of reference is that obtained by another
path Aster (another command, option of calculation,…)
Handbook of Utilization
U4.9- booklet: Impression of the results and tests
HT-66/05/004/A
Code_Aster ®
Version
7.4
Titrate:
Procedure TEST_FICHIER
Date:
12/01/05
Author (S):
Key COURTEOUS Mr.
:
U4.92.04-A Page
: 5/6
4.8 Operand
INFO
INFO = inf
Specify the detail of the information printed in the file message.
If inf=1, one has the following summary:
File: ./REPE_OUT/post_resu.pos
A number of lines: 6371
Format of the real ones: % 13.6g
Epsilon: 1e-14
md5sum: c9a6b5c983c903473b0dc9f744f854dd
REFERENCE: c9a6b5c983c903473b0dc9f744f854dd
If inf=2, one has for each line the values selected to calculate the md5sum (for a chain
characters: the chain itself, for an entirety: entirety itself, for a reality: the value
round), example:
…
LINE 4178 VALUE SELECTED 0.269134
LINE 4179 VALUE SELECTED 0.071175
LINE 4179 VALUE SELECTED 0
LINE 4179 VALUE SELECTED 0.0535577
LINE 4180 VALUE SELECTED - 5.7844E-05
LINE 4181 VALUE SELECTED - 4.28594E-05
LINE 4182 VALUE SELECTED - 3.61488E-05
LINE 4183 VALUE SELECTED 2
LINE 4183 VALUE SELECTED 2
…
LINE 4663 VALUE SELECTED $EndView
…
This makes it possible to make the “diff” between the values selected of two files to see which
values were modified.
Handbook of Utilization
U4.9- booklet: Impression of the results and tests
HT-66/05/004/A
Code_Aster ®
Version
7.4
Titrate:
Procedure TEST_FICHIER
Date:
12/01/05
Author (S):
Key COURTEOUS Mr.
:
U4.92.04-A Page
: 6/6
Intentionally white left page.
Handbook of Utilization
U4.9- booklet: Impression of the results and tests
HT-66/05/004/A
Outline document