Skip to content

Commit def9cfc

Browse files
guillaumegrolleronguillaume.grolleronjlenain
authored
Unit test (part 2) (#168)
* tests for charges_component * test charge compopent + core component refactored * bugfix when ArgumentError are raised bugfix : nsamples waveformcontainer whas missing new getters * test for waveforms_component * base test for flatfiled SPE component * minor changes in photostat * test flatfield spe components * test photostat component * test for spe makers * add pyqtgraph dependencies * need to fix pyqt6 in trr suite * Test installing freeglut3-dev for pyqt in CI on Ubuntu runners * We seem to be hitting pytest-dev/pytest#3216. Try reducing the number of threads to 1 in CI * Test all imports on top * add xvfb to allow X11 display with pyqtgraph * Install Qt 5 dependencies on macOS in CI * Install system packages on runner before setting up python environment * using platform selectors in conda recipe * install xquartz on macOS in CI * fix pyqt again * reactive multi proc tests --------- Co-authored-by: guillaume.grolleron <[email protected]> Co-authored-by: jlenain <[email protected]>
1 parent a7e0226 commit def9cfc

19 files changed

+1393
-343
lines changed

.github/workflows/ci.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,21 @@ jobs:
6767
ctapipe-version: "v0.19.3"
6868
install-method: "mamba"
6969

70+
env :
71+
DISPLAY: ":99.0"
72+
QT_SELECT: "qt5"
7073
defaults:
7174
run:
7275
# We need login shells (-l) for micromamba to work.
7376
shell: bash -leo pipefail {0}
7477

7578
steps:
79+
- name: Install dependencies for Qt on Ubuntu
80+
if: matrix.os == 'ubuntu-latest'
81+
run: |
82+
sudo apt-get update
83+
sudo apt-get install freeglut3-dev
84+
7685
- uses: actions/checkout@v4
7786
with:
7887
fetch-depth: 0
@@ -90,12 +99,28 @@ jobs:
9099
environment-name: "ci"
91100
environment-file: environment.yml
92101

102+
93103
- name: Python setup
94104
if: matrix.install-method == 'pip'
95105
uses: actions/setup-python@v5
96106
with:
97107
python-version: ${{ matrix.python-version }}
98108
check-latest: true
109+
110+
- name: Setup xvfb for X11 display
111+
if: matrix.os == 'ubuntu-latest'
112+
run: |
113+
# Stuff copied wildly from several stackoverflow posts
114+
sudo apt-get install -y xvfb libxkbcommon-x11-0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-xinerama0 libxcb-xinput0 libxcb-xfixes0 libxcb-shape0 libglib2.0-0 libgl1-mesa-dev
115+
sudo apt-get install '^libxcb.*-dev' libx11-xcb-dev libglu1-mesa-dev libxrender-dev libxi-dev libxkbcommon-dev libxkbcommon-x11-dev
116+
# start xvfb in the background
117+
sudo /usr/bin/Xvfb $DISPLAY -screen 0 1280x1024x24 &
118+
119+
- name: Instal QT and setup environment on macOS
120+
if: matrix.os == 'macos-14'
121+
run: |
122+
brew install pyqt@6
123+
echo "DYLD_FRAMEWORK_PATH=$(brew --prefix qt)/lib" >> $GITHUB_ENV
99124
100125
- name: Install dependencies
101126
env:
@@ -111,12 +136,17 @@ jobs:
111136
echo "pip install -e ."
112137
pip install -e .[test]
113138
139+
- name: Check pyqt version
140+
run: |
141+
pip list | grep PyQt
142+
114143
- name: Tests
115144
run: |
116145
pytest -n auto --dist loadscope --cov=nectarchain --cov-report=xml --ignore=src/nectarchain/user_scripts
117146
118147
- uses: codecov/codecov-action@v5
119148

149+
120150
docs:
121151
needs: lint
122152
permissions:
@@ -132,6 +162,11 @@ jobs:
132162
with:
133163
python-version: 3.9
134164

165+
- name: Install dependencies for Qt 5 on Ubuntu
166+
run: |
167+
sudo apt-get update
168+
sudo apt-get install freeglut3-dev
169+
135170
- name: Install doc dependencies
136171
run: |
137172
pip install -e .[docs]

environment.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,11 @@ dependencies:
1717
- sphinx
1818
- sphinx-automodapi
1919
- pydata-sphinx-theme
20+
- pyqt # [linux]
2021
- pip:
21-
- zeo
22-
- zodb
23-
- mechanize
24-
- browser-cookie3
22+
- zeo
23+
- zodb
24+
- mechanize
25+
- browser-cookie3
26+
- pyqtgraph
27+
- pyqt6 # [osx and arm64]

pyproject.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ dependencies = [
2727
"scipy==1.11.4",
2828
"zodb",
2929
"zeo",
30+
"pyqt6",
31+
"pyqtgraph",
3032
]
3133

3234
# needed for setuptools_scm, we don't define a static version

src/nectarchain/makers/calibration/core.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@
99
log.handlers = logging.getLogger("__main__").handlers
1010

1111

12-
__all__ = None
13-
14-
1512
class NectarCAMCalibrationTool(EventsLoopNectarCAMCalibrationTool):
1613
name = "CalibrationTool"
1714
# PIXELS_ID_COLUMN = "pixels_id"

0 commit comments

Comments
 (0)