Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
Méso-NH code
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Méso-NH
Méso-NH code
Commits
1c68aa93
Commit
1c68aa93
authored
1 year ago
by
RIETTE Sébastien
Browse files
Options
Downloads
Patches
Plain Diff
S. Riette 19 Dec 2023: add the documentation generation in the testing procedure
parent
d65642ba
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
docs/doxygen/doxygen_config
+1
-1
1 addition, 1 deletion
docs/doxygen/doxygen_config
tools/generate_standalone_doc.sh
+3
-0
3 additions, 0 deletions
tools/generate_standalone_doc.sh
tools/plot_perf.py
+14
-3
14 additions, 3 deletions
tools/plot_perf.py
tools/testing.sh
+50
-4
50 additions, 4 deletions
tools/testing.sh
with
68 additions
and
8 deletions
docs/doxygen/doxygen_config
+
1
−
1
View file @
1c68aa93
...
...
@@ -867,7 +867,7 @@ WARN_LOGFILE =
INPUT = ../../src/
INPUT += mainpage.md
INPUT += ..
INPUT += ../../tools/INSTALL.md
../../tools/INSTALL_mnh_expand.md
../../tools/INSTALL_pack_ial.md ../../tools/INSTALL_pack_mesonh.md ../../tools/INSTALL_testprogs.md
INPUT += ../../tools/INSTALL.md ../../tools/INSTALL_pack_ial.md ../../tools/INSTALL_pack_mesonh.md ../../tools/INSTALL_testprogs.md
INPUT += ../../build/with_fcm/README.md
# This tag can be used to specify the character encoding of the source files
...
...
This diff is collapsed.
Click to expand it.
tools/generate_standalone_doc.sh
+
3
−
0
View file @
1c68aa93
#!/bin/bash
set
-e
set
-o
pipefail
#abort if left command on a pipe fails
function
usage
{
echo
"Usage:
$0
[-h] output"
echo
"output output file with .pdf or .html extension"
...
...
This diff is collapsed.
Click to expand it.
tools/plot_perf.py
+
14
−
3
View file @
1c68aa93
...
...
@@ -7,6 +7,7 @@ This script plots the data contained in the performance files obtained with the
import
matplotlib.pyplot
as
plt
import
numpy
import
pandas
import
re
class
Perf
():
def
__init__
(
self
,
perffile
):
...
...
@@ -15,6 +16,7 @@ class Perf():
"""
self
.
_df
=
df
=
pandas
.
read_csv
(
perffile
,
sep
=
'
'
,
names
=
[
'
commit
'
,
'
model
'
,
'
case
'
,
'
time
'
])
def
plotPerf
(
self
,
outfile
,
model
=
None
,
title
=
None
,
num
=
None
):
"""
:param outfile: output file
...
...
@@ -34,6 +36,7 @@ class Perf():
commits
.
append
(
commit
)
if
num
is
not
None
:
commits
=
commits
[
-
num
:]
shortCommits
=
[
self
.
shortenCommit
(
c
)
for
c
in
commits
]
df
=
self
.
_df
.
groupby
(
'
model
'
)
for
igrpM
,
grpM
in
enumerate
(
models
):
...
...
@@ -44,7 +47,7 @@ class Perf():
ax
[
igrpM
].
set_title
(
'
Mean elapsed computational time for
'
+
grpM
)
else
:
ax
[
igrpM
].
set_title
(
title
.
replace
(
'
%M
'
,
grpM
))
ax
[
igrpM
].
set_ylabel
(
'
time
(ms/gp)
'
)
ax
[
igrpM
].
set_ylabel
(
'
time
'
)
ax
[
igrpM
].
set_yscale
(
'
log
'
)
dfp
=
df
.
get_group
(
grpM
).
groupby
(
'
case
'
)
...
...
@@ -57,14 +60,22 @@ class Perf():
l
=
[
numpy
.
nan
if
t
<
0.
else
t
for
t
in
dfp
.
get_group
(
grp
)[
f
][
'
time
'
]]
time
.
append
(
numpy
.
nan
if
len
(
l
)
==
0
else
numpy
.
ma
.
array
(
l
).
mean
())
ax
[
igrpM
].
plot
(
range
(
len
(
commits
)),
numpy
.
ma
.
array
(
time
),
'
o-
'
,
label
=
grp
)
if
igrpM
==
len
(
df
.
group
s
)
-
1
:
if
igrpM
==
len
(
model
s
)
-
1
:
ax
[
igrpM
].
set_xlabel
(
'
PHYEX version
'
)
ax
[
igrpM
].
set_xticks
(
range
(
len
(
commits
)))
ax
[
igrpM
].
set_xticklabels
(
c
ommits
,
rotation
=
45
,
ha
=
'
right
'
)
ax
[
igrpM
].
set_xticklabels
(
shortC
ommits
,
rotation
=
45
,
ha
=
'
right
'
)
ax
[
igrpM
].
legend
()
fig
.
tight_layout
()
fig
.
savefig
(
outfile
)
@staticmethod
def
shortenCommit
(
commit
):
"""
:param commit: full commit SHA
:return: shorten version of commit SHA
"""
return
commit
[:
7
]
if
re
.
match
(
r
'
^[0-9a-f]{40}$
'
,
commit
)
else
commit
def
listModels
(
self
):
"""
:result: list of models present in the file
...
...
This diff is collapsed.
Click to expand it.
tools/testing.sh
+
50
−
4
View file @
1c68aa93
...
...
@@ -7,7 +7,7 @@ set -o pipefail #abort if left command on a pipe fails
function
usage
{
echo
"Usage:
$0
[-h] [--repo-user USER] [--repo-protocol PROTOCOL] [--repo-repo REPO] [--no-update] [--no-compil]"
echo
" [--no-exec] [--no-comp] [--no-remove] [--force] [--commit SHA] [--ref REF]"
echo
" [--only-model MODEL] [--no-enable-gh-pages] [--perf PERF] [MAIL]"
echo
" [--only-model MODEL] [--no-enable-gh-pages] [--perf PERF]
[--no-doc-gen]
[MAIL]"
echo
"--repo-user USER"
echo
" user hosting the PHYEX repository on github,"
echo
" defaults to the env variable PHYEXREPOuser (=
$PHYEXREPOuser
)"
...
...
@@ -29,6 +29,7 @@ function usage {
echo
"--no-enable-gh-pages"
echo
" dont't try to enable the project pages on github"
echo
"--perf FILE add performance statistics in file FILE"
echo
"--no-doc-gen do not test the documentation generation"
echo
"MAIL comma-separated list of e-mail addresses (no spaces); if not provided, mail is not sent"
echo
""
echo
"This script provides functionality for automated tests."
...
...
@@ -43,7 +44,9 @@ function usage {
echo
"(for arome and/or mesonh) or with data (testprogs)."
echo
""
echo
"The script compare the results against reference simulations. These reference simulations must"
echo
"be available in the different subdirectories in
\$
{WORKDIR}."
echo
"be available in the different subdirectories in
\$
{PHYEXWORKDIR}."
echo
""
echo
"The documentation generation is also tested."
}
MAIL
=
""
...
...
@@ -63,6 +66,7 @@ force=0
models
=
""
enableghpages
=
1
perfopt
=
""
docgen
=
1
while
[
-n
"
$1
"
]
;
do
case
"
$1
"
in
...
...
@@ -81,6 +85,7 @@ while [ -n "$1" ]; do
'--only-model'
)
models
=
"
${
models
}
$2
"
;
shift
;;
'--no-enable-gh-pages'
)
enableghpages
=
0
;;
'--perf'
)
perfopt
=
"--perf
$2
"
;
shift
;;
'--no-doc-gen'
)
docgen
=
0
;;
#--) shift; break ;;
*
)
if
[
-z
"
${
MAIL
-
}
"
]
;
then
MAIL
=
"
$1
"
...
...
@@ -243,7 +248,7 @@ if [ "${SHA}" -eq 0 ]; then
log 1
"Commit hash is
${
SHA
}
"
fi
if
[
${
force
}
-eq
1
-o
$(
get_statuses
"
${
SHA
}
"
|
grep
"
${
context
}
"
|
wc
-l
)
-eq
0
]
;
then
log 1
"This commit has not been tested (or --force i
d
provided)"
log 1
"This commit has not been tested (or --force i
s
provided)"
ret
=
0
#Checkout tools, set PATH and use the last version of the testing script
...
...
@@ -262,7 +267,6 @@ if [ ${force} -eq 1 -o $(get_statuses "${SHA}" | grep "${context}" | wc -l) -eq
git fetch
"
${
PHYEXREPOgiturl
}
"
git checkout
"
${
SHA
}
"
cd
"
${
currentdir
}
"
.
"
${
WORKDIR
}
/PHYEX/tools/env.sh"
if
[
-f
"
${
WORKDIR
}
/PHYEX/tools/testing.sh"
]
;
then
if
[
"
${
currentMD5
}
"
!=
$(
md5sum
"
${
WORKDIR
}
/PHYEX/tools/testing.sh"
|
cut
-d
\
-f1
)
]
;
then
log 1
"Script has changed, running the new version"
#This log and the preivous ones are lost
...
...
@@ -270,6 +274,7 @@ if [ ${force} -eq 1 -o $(get_statuses "${SHA}" | grep "${context}" | wc -l) -eq
fi
fi
fi
.
"
${
WORKDIR
}
/PHYEX/tools/env.sh"
#Enable the gihub project pages
if
[
$enableghpages
-eq
1
]
;
then
...
...
@@ -407,6 +412,47 @@ if [ ${force} -eq 1 -o $(get_statuses "${SHA}" | grep "${context}" | wc -l) -eq
fi
done
if
[
$docgen
-eq
1
]
;
then
retdoc
=
0
log 0
"Test doc generation"
doccmd
=
"generate_standalone_doc.sh
${
WORKDIR
}
/documentation.html"
log 1
"Doc generation with
${
doccmd
}
"
set
+e
${
doccmd
}
result
=
$?
set
-e
if
[
${
result
}
-ne
0
]
;
then
retdoc
=
1
log 0
" doc generarion with generate_standalone_doc.sh: error"
else
log 0
" doc generarion with generate_standalone_doc.sh: OK"
fi
doccmd
=
"doxygen doxygen_config"
log 1
"Doc generation with
${
doccmd
}
"
cwd
=
$PWD
cd
${
WORKDIR
}
/PHYEX/docs/doxygen
set
+e
${
doccmd
}
result
=
$?
set
-e
cd
$cwd
if
[
${
result
}
-ne
0
]
;
then
retdoc
=
1
log 0
" doc generarion with doxygen: error"
else
log 0
" doc generarion with doxygen: OK"
fi
if
[
$retdoc
-eq
0
]
;
then
log 0
"..... global result for doc generation: OK"
else
ret
=
1
log 0
"XXXXX global result for doc generation: ERROR"
fi
fi
#Report result
report 0
${
ret
}
fi
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment