Skip to content

Commit 971bcec

Browse files
authored
Merge branch 'main' into fix/914_typo_in_base_2d_plot_py
2 parents b3a31d5 + 15eb71e commit 971bcec

31 files changed

+257
-307
lines changed
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Set ETS_TOOLKIT
2+
description: 'Set the ETS_TOOLKIT environment variable'
3+
inputs:
4+
toolkit:
5+
required: true
6+
description: 'The GUI toolkit to use (wx, null, pyqt5, pyqt6, pyside2, pyside6)'
7+
kiva:
8+
default: 'image'
9+
description: 'The kiva toolkit to set'
10+
shell:
11+
default: 'bash'
12+
runs:
13+
using: composite
14+
steps:
15+
- name: Null toolkit
16+
if: inputs.toolkit == 'null'
17+
run: echo "ETS_TOOLKIT=null.${{ inputs.kiva }}" >> $GITHUB_ENV
18+
shell: ${{ inputs.shell }}
19+
- name: WxPython toolkit
20+
if: inputs.toolkit == 'wx'
21+
run: echo "ETS_TOOLKIT=wx.${{ inputs.kiva }}" >> $GITHUB_ENV
22+
shell: ${{ inputs.shell }}
23+
- name: PyQT5 toolkit
24+
if: inputs.toolkit == 'pyqt5'
25+
run: |
26+
echo "ETS_TOOLKIT=qt.${{ inputs.kiva }}" >> $GITHUB_ENV
27+
echo "QT_API=pyqt5" >> $GITHUB_ENV
28+
shell: ${{ inputs.shell }}
29+
- name: PyQT6 toolkit
30+
if: inputs.toolkit == 'pyqt6'
31+
run: |
32+
echo "ETS_TOOLKIT=qt.${{ inputs.kiva }}" >> $GITHUB_ENV
33+
echo "QT_API=pyqt6" >> $GITHUB_ENV
34+
shell: ${{ inputs.shell }}
35+
- name: PySide2 toolkit
36+
if: inputs.toolkit == 'pyside2'
37+
run: |
38+
echo "ETS_TOOLKIT=qt.${{ inputs.kiva }}" >> $GITHUB_ENV
39+
echo "QT_API=pyside2" >> $GITHUB_ENV
40+
shell: ${{ inputs.shell }}
41+
- name: PySide6 toolkit
42+
if: inputs.toolkit == 'pyside6'
43+
run: |
44+
echo "ETS_TOOLKIT=qt.${{ inputs.kiva }}" >> $GITHUB_ENV
45+
echo "QT_API=pyside6" >> $GITHUB_ENV
46+
shell: ${{ inputs.shell }}

.github/actions/install-qt-support/action.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,6 @@ runs:
77
if: runner.os == 'Linux'
88
run: |
99
sudo apt-get update
10-
sudo apt-get install qtbase5-dev
11-
sudo apt-get install qtchooser
12-
sudo apt-get install qt5-qmake
13-
sudo apt-get install qtbase5-dev-tools
1410
sudo apt-get install libegl1
1511
sudo apt-get install libxkbcommon-x11-0
1612
sudo apt-get install libxcb-icccm4

.github/workflows/test-with-edm.yml

Lines changed: 38 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -2,66 +2,62 @@
22
# Note that some packages may not actually be installed from EDM but from
33
# PyPI, see ci/edmtool.py implementations.
44

5-
name: Test with EDM on Python 3.8
5+
name: Test with EDM
66

77
on: pull_request
88

99
env:
10-
INSTALL_EDM_VERSION: 3.5.0
10+
INSTALL_EDM_VERSION: 4.1.1
11+
PYTHONUNBUFFERED: 1
12+
EDM_CONFIG: '${{ github.workspace }}/ci/edm.yaml'
1113

1214
jobs:
1315

14-
# Test against EDM packages on Linux
15-
test-edm-linux-38:
16+
test-edm:
1617
strategy:
1718
matrix:
18-
toolkit: ['null', 'pyside6']
19-
runs-on: ubuntu-latest
20-
steps:
21-
- uses: actions/checkout@v3
22-
- name: Install Qt dependencies
23-
uses: ./.github/actions/install-qt-support
24-
if: matrix.toolkit != 'null'
25-
- name: Cache EDM packages
26-
uses: actions/cache@v2
27-
with:
28-
path: ~/.cache
29-
key: ${{ runner.os }}-3.8-${{ matrix.toolkit }}-${{ hashFiles('ci/edmtool.py') }}
30-
- name: Setup EDM
31-
uses: enthought/setup-edm-action@v2
32-
with:
33-
edm-version: ${{ env.INSTALL_EDM_VERSION }}
34-
- name: Install click to the default EDM environment
35-
run: edm install -y wheel click coverage
36-
- name: Install test environment
37-
run: edm run -- python ci/edmtool.py install --runtime=3.8 --toolkit=${{ matrix.toolkit }}
38-
- name: Flake8
39-
run: edm run -- python ci/edmtool.py flake8 --runtime=3.8 --toolkit=${{ matrix.toolkit }}
40-
if: matrix.toolkit == 'null'
41-
- name: Run tests
42-
run: xvfb-run -a --server-args="-screen 0 1024x768x24" edm run -- python ci/edmtool.py test --runtime=3.8 --toolkit=${{ matrix.toolkit }}
43-
44-
# Test against EDM packages on Windows and OSX
45-
test-with-edm-38:
46-
strategy:
47-
matrix:
48-
os: [windows-latest]
49-
toolkit: ['null', 'pyside6']
19+
toolkit: ['null', 'pyside6', 'wx']
20+
runtime: ['3.11']
21+
os: ['ubuntu-latest', 'windows-latest']
22+
include:
23+
- toolkit: 'null'
24+
runtime: '3.11'
25+
os: macos-latest
26+
- toolkit: 'pyside6'
27+
runtime: '3.11'
28+
os: macos-latest
5029
runs-on: ${{ matrix.os }}
5130
steps:
52-
- uses: actions/checkout@v2
31+
- uses: actions/checkout@v4
5332
- name: Cache EDM packages
54-
uses: actions/cache@v2
33+
uses: actions/cache@v4
5534
with:
5635
path: ~/.cache
57-
key: ${{ runner.os }}-3.8-${{ matrix.toolkit }}-${{ hashFiles('ci/edmtool.py') }}
36+
key: ${{ runner.os }}-${{ matrix.toolkit }}-${{ matrix.runtime }}-${{ hashFiles('ci/edmtool.py') }}
5837
- name: Setup EDM
59-
uses: enthought/setup-edm-action@v1
38+
uses: enthought/setup-edm-action@v4.1
6039
with:
6140
edm-version: ${{ env.INSTALL_EDM_VERSION }}
41+
- name: Install opengl for Linux
42+
run: |
43+
sudo apt-get update
44+
sudo apt-get install libopengl0 libegl1
45+
if: matrix.os == 'ubuntu-latest' && matrix.toolkit != 'null'
6246
- name: Install click to the default EDM environment
6347
run: edm install -y wheel click coverage
48+
- name: Set ETS_TOOLKIT
49+
uses: ./.github/actions/ets_toolkit
50+
with:
51+
toolkit: ${{ matrix.toolkit }}
6452
- name: Install test environment
65-
run: edm run -- python ci/edmtool.py install --runtime=3.8 --toolkit=${{ matrix.toolkit }}
53+
run: edm run -- python ci/edmtool.py install --toolkit=${{ matrix.toolkit }} --runtime=${{ matrix.runtime }}
54+
- name: Run tests on Linux
55+
if: matrix.os == 'ubuntu-latest'
56+
env:
57+
PYTHONFAULTHANDLER: 1
58+
run: xvfb-run -a --server-args="-screen 0 1024x768x24" edm run -- python ci/edmtool.py test --toolkit=${{ matrix.toolkit }} --runtime=${{ matrix.runtime }}
6659
- name: Run tests
67-
run: edm run -- python ci/edmtool.py test --runtime=3.8 --toolkit=${{ matrix.toolkit }}
60+
if: matrix.os != 'ubuntu-latest'
61+
env:
62+
PYTHONFAULTHANDLER: 1
63+
run: edm run -- python ci/edmtool.py test --toolkit=${{ matrix.toolkit }} --runtime=${{ matrix.runtime }}

.github/workflows/test-with-pip.yml

Lines changed: 25 additions & 136 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
# This workflow installs dependencies from main branch
32

43
name: Test with pip
@@ -14,153 +13,43 @@ jobs:
1413
fail-fast: false
1514
matrix:
1615
os: ['ubuntu-latest', 'macos-latest', 'windows-latest']
17-
toolkit: ['pyside6']
16+
toolkit: ['pyside2', 'pyside6', 'pyqt5', 'wx', 'null']
1817
kiva-backend: ['image']
19-
python-version: ['3.8', '3.11']
20-
include:
21-
# Do more Python versions on linux
22-
- os: 'ubuntu-latest'
23-
toolkit: 'pyside6'
24-
kiva-backend: 'image'
25-
python-version: '3.9'
26-
- os: 'ubuntu-latest'
27-
toolkit: 'pyside6'
28-
kiva-backend: 'image'
29-
python-version: '3.10'
18+
python-version: ['3.10', '3.11']
19+
exclude:
20+
# No PySide2 wheels available for Python 3.11
21+
- toolkit: 'pyside2'
22+
python-version: '3.11'
23+
# No PyQt5 wheels available for Python 3.11
24+
- toolkit: 'pyqt5'
25+
python-version: '3.11'
26+
# No PySide2 wheels for macos-latest
27+
- os: 'macos-latest'
28+
toolkit: 'pyside2'
3029
runs-on: ${{ matrix.os }}
31-
env:
32-
ETS_TOOLKIT: qt4.${{ matrix.kiva-backend }}
33-
QT_API: ${{ matrix.toolkit }}
3430
steps:
3531
- name: Check out
36-
uses: actions/checkout@v3
32+
uses: actions/checkout@v4
3733
- name: Set up Python
3834
uses: actions/setup-python@v4
3935
with:
4036
python-version: ${{ matrix.python-version }}
41-
- name: Install Qt dependencies
42-
uses: ./.github/actions/install-qt-support
43-
if: matrix.toolkit == 'pyside6'
44-
- name: Install dependencies for Linux
45-
run: |
46-
# needed for Celiagg
47-
sudo apt-get install libfreetype-dev libharfbuzz-dev
48-
# needed for Cairo
49-
sudo apt-get install libcairo2-dev
50-
if: matrix.os == 'ubuntu-latest'
51-
- name: Install dependencies for Mac
52-
run: |
53-
brew install cairo
54-
if: matrix.os == 'macos-latest'
55-
- name: Install build dependencies
56-
run: |
57-
python -m pip install --upgrade pip wheel
58-
- name: Install local enable main (temporary)
59-
run: pip install --force "enable[celiagg,layout,svg] @ git+https://github.com/enthought/enable.git"
60-
- name: Install local packages
61-
run: pip install ".[tests,${{ matrix.toolkit }}]"
62-
- name: Sanity check package version
63-
run: pip list
64-
- name: Run chaco test suite (Linux)
65-
env:
66-
PYTHONFAULTHANDLER: 1
67-
# kiva agg requires at least 15-bit color depth.
68-
run: xvfb-run -a --server-args="-screen 0 1024x768x24" python -m unittest discover -v chaco
69-
if: matrix.os == 'ubuntu-latest'
70-
working-directory: ${{ runner.temp }}
71-
- name: Run enable test suite (not Linux)
72-
env:
73-
PYTHONFAULTHANDLER: 1
74-
run: python -m unittest discover -v chaco
75-
if: matrix.os != 'ubuntu-latest'
76-
working-directory: ${{ runner.temp }}
77-
78-
test-wx:
79-
strategy:
80-
fail-fast: false
81-
matrix:
82-
os: ['windows-latest']
83-
toolkit: ['wx']
84-
kiva-backend: ['image']
85-
python-version: ['3.8', '3.10']
86-
runs-on: ${{ matrix.os }}
87-
env:
88-
ETS_TOOLKIT: ${{ matrix.toolkit }}.${{ matrix.kiva-backend }}
89-
steps:
90-
- name: Check out
91-
uses: actions/checkout@v3
92-
- name: Set up Python
93-
uses: actions/setup-python@v4
37+
cache: 'pip'
38+
- name: Set ETS_TOOLKIT
39+
uses: ./.github/actions/ets_toolkit
9440
with:
95-
python-version: ${{ matrix.python-version }}
96-
- name: Install dependencies for Linux
97-
run: |
98-
# needed for Celiagg
99-
sudo apt-get install libfreetype-dev libharfbuzz-dev
100-
# needed for Cairo
101-
sudo apt-get install libcairo2-dev
102-
if: matrix.os == 'ubuntu-latest'
103-
- name: Install dependencies for Mac
104-
run: |
105-
brew install cairo
106-
if: matrix.os == 'macos-latest'
41+
toolkit: ${{ matrix.toolkit }}
10742
- name: Install build dependencies
10843
run: |
109-
python -m pip install --upgrade pip wheel
110-
- name: Install local enable main (temporary)
111-
run: pip install --force "enable[celiagg,layout,svg] @ git+https://github.com/enthought/enable.git"
112-
- name: Install local packages
113-
run: pip install ".[tests,${{ matrix.toolkit }}]"
114-
- name: Sanity check package version
115-
run: pip list
116-
- name: Run chaco test suite (Linux)
117-
env:
118-
PYTHONFAULTHANDLER: 1
119-
# kiva agg requires at least 15-bit color depth.
120-
run: xvfb-run -a --server-args="-screen 0 1024x768x24" python -m unittest discover -v chaco
121-
if: matrix.os == 'ubuntu-latest'
122-
working-directory: ${{ runner.temp }}
123-
- name: Run enable test suite (not Linux)
124-
env:
125-
PYTHONFAULTHANDLER: 1
126-
run: python -m unittest discover -v chaco
127-
if: matrix.os != 'ubuntu-latest'
128-
working-directory: ${{ runner.temp }}
129-
130-
test-null:
131-
strategy:
132-
fail-fast: false
133-
matrix:
134-
os: ['ubuntu-latest', 'macos-latest', 'windows-latest']
135-
toolkit: ['null']
136-
kiva-backend: ['image', 'celiagg']
137-
python-version: ['3.8', '3.11']
138-
runs-on: ${{ matrix.os }}
139-
env:
140-
ETS_TOOLKIT: ${{ matrix.toolkit }}.${{ matrix.kiva-backend }}
141-
steps:
142-
- name: Check out
143-
uses: actions/checkout@v3
144-
- name: Set up Python
145-
uses: actions/setup-python@v4
146-
with:
147-
python-version: ${{ matrix.python-version }}
148-
- name: Install dependencies for Linux
149-
run: |
150-
# needed for Celiagg
151-
sudo apt-get install libfreetype-dev libharfbuzz-dev
152-
# needed for Cairo
153-
sudo apt-get install libcairo2-dev
154-
if: matrix.os == 'ubuntu-latest'
155-
- name: Install dependencies for Mac
156-
run: |
157-
brew install cairo
158-
if: matrix.os == 'macos-latest'
159-
- name: Install build dependencies
44+
python -m pip install --upgrade pip wheel Cython
45+
- name: Install wxdependencies for Linux
16046
run: |
161-
python -m pip install --upgrade pip wheel
162-
- name: Install local enable main (temporary)
163-
run: pip install --force "enable[celiagg,cairo,layout,svg] @ git+https://github.com/enthought/enable.git"
47+
sudo apt-get update
48+
sudo apt-get install libgtk-3-dev
49+
if: matrix.os == 'ubuntu-latest' && matrix.toolkit == 'wx'
50+
- name: Install Qt dependencies on Linux
51+
uses: ./.github/actions/install-qt-support
52+
if: matrix.os == 'ubuntu-latest' && startsWith(matrix.toolkit, 'py')
16453
- name: Install local packages
16554
run: pip install ".[tests,${{ matrix.toolkit }}]"
16655
- name: Sanity check package version

chaco/base_contour_plot.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
#
99
# Thanks for using Enthought open source!
1010

11-
from numpy import array, isscalar, issubsctype, linspace, number
11+
from numpy import array, isscalar, issubdtype, linspace, number
1212

1313
# Enthought library imports
1414
from enable.api import ColorTrait
@@ -135,7 +135,7 @@ def _update_colors(self, numcolors=None):
135135
# be converted via self._color_map_trait.
136136
else:
137137
if len(colors) in (3, 4) and (
138-
isscalar(colors[0]) and issubsctype(type(colors[0]), number)
138+
isscalar(colors[0]) and issubdtype(type(colors[0]), number)
139139
):
140140
self._color_map_trait = colors
141141
self._colors = [self._color_map_trait_] * numcolors

chaco/color_mapper.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
"""
1313

1414
# Major library imports
15+
import numpy as np
1516
from numpy import (
1617
arange,
1718
array,
@@ -24,7 +25,6 @@
2425
isnan,
2526
ones,
2627
searchsorted,
27-
sometrue,
2828
sort,
2929
take,
3030
uint8,
@@ -413,7 +413,7 @@ def _make_mapping_array(self, n, data):
413413
raise ValueError(
414414
"data mapping points must start with x=0. and end with x=1"
415415
)
416-
if sometrue(sort(x) - x):
416+
if np.any(sort(x) - x):
417417
raise ValueError(
418418
"data mapping points must have x in increasing order"
419419
)

chaco/downsample/lttb.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
# is also available online at http://www.enthought.com/licenses/BSD.txt
88
#
99
# Thanks for using Enthought open source!
10-
1110
import logging
11+
import platform
1212

1313
logger = logging.getLogger(__name__)
1414

0 commit comments

Comments
 (0)