Skip to content

Commit

Permalink
Unit test (part 2) (#168)
Browse files Browse the repository at this point in the history
* 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 <ggroller@lpnhe.in2p3.fr>
Co-authored-by: jlenain <jlenain@in2p3.fr>
  • Loading branch information
3 people authored Jan 22, 2025
1 parent a7e0226 commit def9cfc
Show file tree
Hide file tree
Showing 19 changed files with 1,393 additions and 343 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,21 @@ jobs:
ctapipe-version: "v0.19.3"
install-method: "mamba"

env :
DISPLAY: ":99.0"
QT_SELECT: "qt5"
defaults:
run:
# We need login shells (-l) for micromamba to work.
shell: bash -leo pipefail {0}

steps:
- name: Install dependencies for Qt on Ubuntu
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install freeglut3-dev
- uses: actions/checkout@v4
with:
fetch-depth: 0
Expand All @@ -90,12 +99,28 @@ jobs:
environment-name: "ci"
environment-file: environment.yml


- name: Python setup
if: matrix.install-method == 'pip'
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
check-latest: true

- name: Setup xvfb for X11 display
if: matrix.os == 'ubuntu-latest'
run: |
# Stuff copied wildly from several stackoverflow posts
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
sudo apt-get install '^libxcb.*-dev' libx11-xcb-dev libglu1-mesa-dev libxrender-dev libxi-dev libxkbcommon-dev libxkbcommon-x11-dev
# start xvfb in the background
sudo /usr/bin/Xvfb $DISPLAY -screen 0 1280x1024x24 &
- name: Instal QT and setup environment on macOS
if: matrix.os == 'macos-14'
run: |
brew install pyqt@6
echo "DYLD_FRAMEWORK_PATH=$(brew --prefix qt)/lib" >> $GITHUB_ENV
- name: Install dependencies
env:
Expand All @@ -111,12 +136,17 @@ jobs:
echo "pip install -e ."
pip install -e .[test]
- name: Check pyqt version
run: |
pip list | grep PyQt
- name: Tests
run: |
pytest -n auto --dist loadscope --cov=nectarchain --cov-report=xml --ignore=src/nectarchain/user_scripts
- uses: codecov/codecov-action@v5


docs:
needs: lint
permissions:
Expand All @@ -132,6 +162,11 @@ jobs:
with:
python-version: 3.9

- name: Install dependencies for Qt 5 on Ubuntu
run: |
sudo apt-get update
sudo apt-get install freeglut3-dev
- name: Install doc dependencies
run: |
pip install -e .[docs]
Expand Down
11 changes: 7 additions & 4 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,11 @@ dependencies:
- sphinx
- sphinx-automodapi
- pydata-sphinx-theme
- pyqt # [linux]
- pip:
- zeo
- zodb
- mechanize
- browser-cookie3
- zeo
- zodb
- mechanize
- browser-cookie3
- pyqtgraph
- pyqt6 # [osx and arm64]
2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ dependencies = [
"scipy==1.11.4",
"zodb",
"zeo",
"pyqt6",
"pyqtgraph",
]

# needed for setuptools_scm, we don't define a static version
Expand Down
3 changes: 0 additions & 3 deletions src/nectarchain/makers/calibration/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@
log.handlers = logging.getLogger("__main__").handlers


__all__ = None


class NectarCAMCalibrationTool(EventsLoopNectarCAMCalibrationTool):
name = "CalibrationTool"
# PIXELS_ID_COLUMN = "pixels_id"
Expand Down
Loading

0 comments on commit def9cfc

Please sign in to comment.