Skip to content

Commit

Permalink
Merge pull request #102 from UCL/100-pyver
Browse files Browse the repository at this point in the history
100 pyver
  • Loading branch information
thompson318 authored Dec 8, 2021
2 parents 40847fc + 158adf7 commit 65cf8df
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 7 deletions.
26 changes: 20 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-ver: [3.6, 3.7, 3.8, 3.9]

exclude:
- os: macos-latest
python-ver: 3.6

runs-on: ${{ matrix.os }}

Expand All @@ -13,25 +18,34 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: 3.6
python-version: ${{ matrix.python-ver }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install tox
pip install -r requirements-dev.txt
- name: Run tox on ubuntu using xvfb
- name: Run tests on ubuntu using xvfb
if: startsWith(matrix.os, 'ubuntu')
run: |
sudo apt-get install xvfb
sudo Xvfb :1 -screen 0 1024x768x24 </dev/null &
export DISPLAY=":1"
xvfb-run tox
coverage erase
coverage run -a --source ./sksurgeryimage -m pytest
coverage report -m
- name: Run tox on windows/mac
- name: Run tests on windows/mac
# Matches the 'o' in 'windows' or 'macos'
if: contains(matrix.os, 'o')
run: |
tox
coverage erase
coverage run -a --source ./sksurgeryimage -m pytest
coverage report -m
- name: Linting
run: |
pylint --rcfile=tests/pylintrc sksurgeryimage
- name: Run coveralls
run: |
Expand Down
6 changes: 5 additions & 1 deletion sksurgeryimage/calibration/charuco.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,11 @@ def filter_out_wrong_markers(marker_corners,
number_of_nearest_markers = len(board.nearestMarkerIdx[i])
assert number_of_nearest_markers == 2
for j in range(0, number_of_nearest_markers):
marker_id = board.ids[board.nearestMarkerIdx[i][j][0]][0]
try:
marker_id = board.ids[board.nearestMarkerIdx[i][j][0]][0]
except IndexError:
marker_id = board.ids[board.nearestMarkerIdx[i][j]]

marker_index = -1
for k in range(0, number_of_markers):
if marker_ids[k][0] == marker_id:
Expand Down

0 comments on commit 65cf8df

Please sign in to comment.