Skip to content

Commit 57920a8

Browse files
authored
Merge pull request #66 from oglez/master
Merging changes related to some fine-tuning of plots and also checks in CI/CD comparing the python and C++ version
2 parents 292e444 + 42cf84e commit 57920a8

File tree

10 files changed

+328
-167
lines changed

10 files changed

+328
-167
lines changed

.github/workflows/resultchecks.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Result_checks
2+
on:
3+
workflow_run:
4+
workflows: [Software_check]
5+
types: [completed]
6+
7+
jobs:
8+
compare_plots:
9+
runs-on: ubuntu-latest
10+
container:
11+
image: cmscloud/al9-cms:latest
12+
options: --user root
13+
steps:
14+
- name: Checking_out_code
15+
uses: actions/checkout@v4
16+
with:
17+
fetch-depth: 0
18+
- name: Preparing_packages
19+
run: |
20+
echo "python version="`python3 -V`
21+
ls -la
22+
pwd
23+
dnf install -y root ImageMagick python3-root
24+
echo "ROOT version="`root-config --version`
25+
- name: Python_plots
26+
run: |
27+
source scripts/setup_cmstyle
28+
cd tests
29+
for xfch in test_cmsCanvas test_THStack test_cms2DHisto
30+
do
31+
python3 ${xfch}.py
32+
sha256sum ${xfch}.png
33+
done
34+
- name: Cpp_plots
35+
run: |
36+
source scripts/setup_cmstyle
37+
cd tests
38+
for xfch in test_cmsCanvas test_THStack test_cms2DHisto
39+
do
40+
root -b -q ${xfch}.C
41+
sha256sum ${xfch}_C.png
42+
done
43+
- name: Comparison_of_plots
44+
run: |
45+
cd tests
46+
for xfch in `ls *_C.png`
47+
do
48+
xfch2=`echo ${xfch} | sed s%_C.png%.png%`
49+
echo -n "Comparison of $xfch and $xfch2 yields "
50+
# NCC metric seems to have problems in some recent versions???
51+
# echo `compare -metric NCC $xfch $xfch2 /dev/null`
52+
echo `compare -metric RMSE $xfch $xfch2 /dev/null`
53+
done
54+
#

.github/workflows/softwarecheck.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ jobs:
1616
fetch-depth: 0
1717
- name: Checking_python_3.9
1818
run: |
19-
python3 -V
20-
ls
19+
echo "python version="`python3 -V`
20+
ls -la
2121
pwd
2222
python3 -m py_compile src/cmsstyle/cmsstyle.py
2323
ls -lh src/cmsstyle/__pycache__/
@@ -27,18 +27,18 @@ jobs:
2727
echo '{gROOT->LoadMacro("cmsstyle.C++");}' > compiling.C
2828
2929
dnf install -y root
30-
echo 'ROOT VERSION='`root-config --version`
30+
echo "ROOT version="`root-config --version`
3131
root -q compiling.C
3232
ls -lh cmsstyle_C.so
3333
#
3434
py2-job:
3535
runs-on: ubuntu-latest
3636

3737
steps:
38-
- name: Checkout repository (on host)
38+
- name: Checkout repository (on host) for python 2.7 check
3939
uses: actions/checkout@v4
4040

41-
- name: Run checks inside container
41+
- name: Run checks inside container for python 2.7 check
4242
uses: addnab/docker-run-action@v3
4343
with:
4444
image: cmscloud/cc7-cms:latest
@@ -47,4 +47,5 @@ jobs:
4747
python -V
4848
find . -type f
4949
python -m py_compile src/cmsstyle/cmsstyle.py
50-
ls -lh src/cmsstyle/cmsstyle.pyc
50+
ls -lh src/cmsstyle/cmsstyle.pyc
51+
#

0 commit comments

Comments
 (0)