Skip to content

Commit

Permalink
Merge pull request #327 from odin-detector/325_python_ci
Browse files Browse the repository at this point in the history
Update python package testing and CI action
  • Loading branch information
timcnicholls authored Oct 30, 2023
2 parents 9f25ddc + ab4ed55 commit d9dabb8
Show file tree
Hide file tree
Showing 9 changed files with 539 additions and 506 deletions.
24 changes: 19 additions & 5 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,30 @@ on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']
defaults:
run:
working-directory: python

steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Test odin-data
- name: Set up python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Install odin-data python pacakge
run: |
python3 -m venv venv && source venv/bin/activate && pip install --upgrade pip
cd python
python -m pip install --upgrade pip
pip install .[dev,meta_writer]
python -c "from odin_data import __version__; print(__version__)"
pytest tests/test_hdf5dataset.py
- name: Run tests
run:
pytest -vs --cov=odin_data --cov-report=term-missing
5 changes: 4 additions & 1 deletion python/setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,16 @@ classifiers =
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Programming Language :: Python :: 3.11

[options]
packages = find:
package_dir =
=src

install_requires =
odin-control @ git+https://git@github.com/odin-detector/odin-control.git@1.3.0
odin-control @ git+https://git@github.com/odin-detector/odin-control.git@1.4.0
posix_ipc>=1.0.4
pysnmp>=4.4.4
numpy>=1.14.0
Expand All @@ -35,6 +37,7 @@ meta_writer =
# For development tests/docs
dev =
pytest
pytest-cov
# Docs
sphinx-autobuild
sphinx-external-toc
Expand Down
10 changes: 5 additions & 5 deletions python/src/odin_data/control/live_view_proxy_adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def __init__(self, **kwargs):
self.publish_channel.bind()
except ZMQError as channel_err:
# ZMQError raised here if the socket addr is already in use.
logging.error("Connection Failed. Error given: %s", channel_err.message)
logging.error("Connection Failed. Error given: %s", str(channel_err))
self.max_queue = self.options.get(QUEUE_LENGTH_CONFIG_NAME, DEFAULT_QUEUE_LENGTH)

if SOURCE_ENDPOINTS_CONFIG_NAME in self.options:
Expand All @@ -76,14 +76,17 @@ def __init__(self, **kwargs):
self.drop_warn_percent,
self.add_to_queue))
except (ValueError, ZMQError):
logging.debug("Error parsing target list: %s", target_str)
logging.error("Error parsing target list: %s", target_str)
else:
self.source_endpoints = [LiveViewProxyNode(
"node_1",
DEFAULT_SOURCE_ENDPOINT,
self.drop_warn_percent,
self.add_to_queue)]

self.last_sent_frame = (0, 0)
self.dropped_frame_count = 0

tree = {
"target_endpoint": (lambda: self.dest_endpoint, None),
'last_sent_frame': (lambda: self.last_sent_frame, None),
Expand All @@ -98,9 +101,6 @@ def __init__(self, **kwargs):

self.queue = PriorityQueue(self.max_queue)

self.last_sent_frame = (0, 0)
self.dropped_frame_count = 0

self.get_frame_from_queue()

def cleanup(self):
Expand Down
Loading

0 comments on commit d9dabb8

Please sign in to comment.