Compare commits
3 Commits
feat/pilat
...
refactor/c
| Author | SHA1 | Date | |
|---|---|---|---|
| 3f29cad339 | |||
| 6a8f6c7988 | |||
| 6bfc8999f7 |
@@ -1,4 +1,4 @@
|
||||
name: CI for debye_bec
|
||||
name: CI for Debye_bec
|
||||
on:
|
||||
push:
|
||||
pull_request:
|
||||
@@ -39,59 +39,36 @@ jobs:
|
||||
env:
|
||||
QTWEBENGINE_DISABLE_SANDBOX: 1
|
||||
QT_QPA_PLATFORM: "offscreen"
|
||||
|
||||
steps:
|
||||
- name: Setup Python
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: "${{ inputs.PYTHON_VERSION || '3.11' }}"
|
||||
|
||||
- name: Checkout BEC Core
|
||||
- name: Checkout shared action repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
repository: bec/bec
|
||||
ref: "${{ inputs.BEC_CORE_BRANCH || 'main' }}"
|
||||
path: ./bec
|
||||
repository: bec/bec_shared_actions
|
||||
ref: main
|
||||
path: bec_shared_actions
|
||||
|
||||
- name: Checkout Ophyd Devices
|
||||
uses: actions/checkout@v4
|
||||
- name: Checkout Plugin and BEC Repositories
|
||||
uses: bec/bec_shared_actions/checkout_repositories@main
|
||||
# uses: ./bec_shared_actions
|
||||
with:
|
||||
repository: bec/ophyd_devices
|
||||
ref: "${{ inputs.OPHYD_DEVICES_BRANCH || 'main' }}"
|
||||
path: ./ophyd_devices
|
||||
|
||||
- name: Checkout BEC Widgets
|
||||
uses: actions/checkout@v4
|
||||
BEC_WIDGETS_BRANCH: "${{ github.event.inputs.BEC_WIDGETS_BRANCH || 'main' }}"
|
||||
BEC_CORE_BRANCH: "${{ github.event.inputs.BEC_CORE_BRANCH || 'main' }}"
|
||||
OPHYD_DEVICES_BRANCH: "${{ github.event.inputs.OPHYD_DEVICES_BRANCH || 'main' }}"
|
||||
BEC_PLUGIN_REPO_BRANCH: "${{ github.event_name == 'workflow_dispatch' && (github.event.inputs.BEC_PLUGIN_REPO_BRANCH || 'main') || github.head_ref || github.ref_name }}"
|
||||
PLUGIN_REPO_NAME: "${{ github.event.repository.name }}"
|
||||
|
||||
- name: Install external APT packages
|
||||
uses: bec/bec_shared_actions/install_apt_packages@main
|
||||
with:
|
||||
repository: bec/bec_widgets
|
||||
ref: "${{ inputs.BEC_WIDGETS_BRANCH || 'main' }}"
|
||||
path: ./bec_widgets
|
||||
|
||||
- name: Checkout BEC Plugin Repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
repository: bec/debye_bec
|
||||
ref: "${{ inputs.BEC_PLUGIN_REPO_BRANCH || github.head_ref || github.sha }}"
|
||||
path: ./debye_bec
|
||||
|
||||
- name: Install dependencies
|
||||
shell: bash
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y libgl1 libegl1 x11-utils libxkbcommon-x11-0 libdbus-1-3 xvfb
|
||||
sudo apt-get -y install libnss3 libxdamage1 libasound2t64 libatomic1 libxcursor1
|
||||
APT_PACKAGES: "libgl1 libegl1 x11-utils libxkbcommon-x11-0 libdbus-1-3 xvfb libnss3 libxdamage1 libasound2t64 libatomic1 libxcursor1"
|
||||
|
||||
- name: Install Python dependencies
|
||||
shell: bash
|
||||
run: |
|
||||
pip install uv
|
||||
uv pip install --system -e ./ophyd_devices
|
||||
uv pip install --system -e ./bec/bec_lib[dev]
|
||||
uv pip install --system -e ./bec/bec_ipython_client
|
||||
uv pip install --system -e ./bec/bec_server[dev]
|
||||
uv pip install --system -e ./bec_widgets[dev,pyside6]
|
||||
uv pip install --system -e ./debye_bec
|
||||
uses: bec/bec_shared_actions/install_python_env@main
|
||||
with:
|
||||
PYTHON_VERSION: "${{ github.event.inputs.PYTHON_VERSION || '3.11' }}"
|
||||
PLUGIN_REPO_NAME: "${{ github.event.repository.name }}"
|
||||
|
||||
- name: Run Pytest with Coverage
|
||||
id: coverage
|
||||
run: pytest --random-order --cov=./debye_bec --cov-config=./debye_bec/pyproject.toml --cov-branch --cov-report=xml --no-cov-on-fail ./debye_bec/tests/ || test $? -eq 5
|
||||
- name: Run pytest for Plugin
|
||||
uses: bec/bec_shared_actions/run_pytest_for_plugin@main
|
||||
with:
|
||||
PLUGIN_REPO_NAME: "${{ github.event.repository.name }}"
|
||||
@@ -105,7 +105,7 @@ class IonizationChamber0(PSIDeviceBase):
|
||||
super().__init__(name=name, prefix=prefix, scan_info=scan_info, **kwargs)
|
||||
|
||||
@typechecked
|
||||
def set_gain(self, gain: Literal["1e6", "1e7", "5e7", "1e8", "1e9"] | AmplifierGain) -> None:
|
||||
def set_gain(self, gain: Literal["1e6", "1e7", "5e7", "1e8", "1e9"]) -> None:
|
||||
"""Configure the gain setting of the specified channel
|
||||
|
||||
Args:
|
||||
@@ -131,10 +131,7 @@ class IonizationChamber0(PSIDeviceBase):
|
||||
self.amp.cGain_ENUM.put(AmplifierGain.G1E9)
|
||||
|
||||
def set_filter(
|
||||
self,
|
||||
value: (
|
||||
Literal["1us", "3us", "10us", "30us", "100us", "300us", "1ms", "3ms"] | AmplifierFilter
|
||||
),
|
||||
self, value: Literal["1us", "3us", "10us", "30us", "100us", "300us", "1ms", "3ms"]
|
||||
) -> None:
|
||||
"""Configure the filter setting of the specified channel
|
||||
|
||||
|
||||
@@ -65,15 +65,20 @@ class AndStatusWithList(DeviceStatus):
|
||||
|
||||
return False
|
||||
|
||||
# TODO Check if this actually works....
|
||||
def set_exception(self, exc):
|
||||
super().set_exception(exc)
|
||||
# Propagate the exception to all sub-statuses that are not done yet.
|
||||
with self._lock:
|
||||
for st in self.all_statuses:
|
||||
with st._lock:
|
||||
if not st.done:
|
||||
st.set_exception(exc)
|
||||
# # TODO Check if this actually works....
|
||||
# def set_exception(self, exc):
|
||||
# # Propagate the exception to all sub-statuses that are not done yet.
|
||||
#
|
||||
# with self._lock:
|
||||
# if self._externally_initiated_completion:
|
||||
# return
|
||||
# if self.done: # Return if status is already done.. It must be resolved already
|
||||
# return
|
||||
# super().set_exception(exc)
|
||||
# for st in self.all_statuses:
|
||||
# with st._lock:
|
||||
# if not st.done:
|
||||
# st.set_exception(exc)
|
||||
|
||||
def _run_callbacks(self):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user