From cce60748e2ee4fc1c00e2d11342781d62cf00097 Mon Sep 17 00:00:00 2001 From: Jan Mayer Date: Tue, 27 Apr 2021 21:06:30 +0200 Subject: [PATCH] Fix error message with cal pos nuc Test more ROOT versions Run newer black version --- .github/workflows/compile-without-helpers.yml | 2 +- .github/workflows/run-tests.yml | 15 +++++++++++++-- changelog.md | 5 +++++ hdtv/histogram.py | 2 +- hdtv/plugins/EnergyCalibration.py | 4 ++-- hdtv/plugins/textInterface.py | 2 +- 6 files changed, 23 insertions(+), 7 deletions(-) diff --git a/.github/workflows/compile-without-helpers.yml b/.github/workflows/compile-without-helpers.yml index 3f14dc44..4c2e5f91 100644 --- a/.github/workflows/compile-without-helpers.yml +++ b/.github/workflows/compile-without-helpers.yml @@ -19,7 +19,7 @@ jobs: - name: Install dependencies shell: bash -l {0} - run: conda install root='6.18.04' + run: conda install root='6.24.0' - name: Build shell: bash -l {0} diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 14753212..f6c5a2d1 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -7,13 +7,24 @@ jobs: runs-on: ubuntu-latest strategy: matrix: + # Notes: + # - '6.18.00', '6.18.04', '6.20.0' take too long to install via conda (>1h instead of ~5min) + # - '6.22.00', '6.22.02' are incompatible + # - 6.22.4 missing from https://anaconda.org/conda-forge/root/files python-version: [3.6, 3.7, 3.8] - root-version: ['6.16.00', '6.18.00', '6.18.04', '6.20.0', '6.20.2', '6.20.4', '6.20.6'] + root-version: ['6.16.00', '6.20.2', '6.20.4', '6.20.6', '6.22.6', '6.22.8', '6.24.0'] exclude: - python-version: 3.8 root-version: '6.16.00' - python-version: 3.8 root-version: '6.18.00' + include: + - python-version: 3.9 + root-version: '6.22.6' + - python-version: 3.9 + root-version: '6.22.8' + - python-version: 3.9 + root-version: '6.24.0' fail-fast: false steps: @@ -37,4 +48,4 @@ jobs: - name: Post Coverage uses: codecov/codecov-action@v1 - if: matrix.python-version == 3.8 && matrix.root-version == '6.18.04' + if: matrix.python-version == 3.8 && matrix.root-version == '6.24.0' diff --git a/changelog.md b/changelog.md index 28d6e805..14851ca0 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,10 @@ # HDTV Changelog +## 21.04 +- Fix error with errormessage in cal pos nuc (@jmayer) +- Test more ROOT versions +- Test Python 3.9 + ## 20.12 - Fix performance degradation with ROOT 6.20. and higher (fixes #6) (@jmayer) - Fix compatibility with unreleased ROOT Versions 6.19.x (@jmayer) diff --git a/hdtv/histogram.py b/hdtv/histogram.py index 541b47c3..438b34d1 100644 --- a/hdtv/histogram.py +++ b/hdtv/histogram.py @@ -476,7 +476,7 @@ def info(self): g = self.gates[i] s += "%d - %d " % (g.p1.pos_cal, g.p2.pos_cal) if not i == len(self.gates): - "and " + "and" return s diff --git a/hdtv/plugins/EnergyCalibration.py b/hdtv/plugins/EnergyCalibration.py index 88324c6d..407ed059 100644 --- a/hdtv/plugins/EnergyCalibration.py +++ b/hdtv/plugins/EnergyCalibration.py @@ -122,8 +122,8 @@ def MatchPeaksAndEnergies(peaks, energies, sigma): accordance.append(pair[i]) if len(accordance) < 4: - hdtv.ui.msg(accordance) - hdtv.ui.warning("Only a few (peak,energy) pairs are found.") + # hdtv.ui.msg(accordance) + hdtv.ui.warning("Only few (peak,energy) pairs found. Try with a larger --sigma") return accordance diff --git a/hdtv/plugins/textInterface.py b/hdtv/plugins/textInterface.py index 0233d261..7a72ba13 100644 --- a/hdtv/plugins/textInterface.py +++ b/hdtv/plugins/textInterface.py @@ -112,7 +112,7 @@ def pager(self, html, end="\n"): @bindings.add("c-c") @bindings.add("q") def _(event): - " Quit. " + "Quit." event.app.exit() application = Application(