Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
5731e00
Update c code to work with recent numpy 2.x
itziakos Jun 28, 2025
848cf6f
Consolidate workflows to test cacho using PyPI packages
itziakos Jun 28, 2025
322d30f
Set only the ETS_TOOLKIT
itziakos Jun 28, 2025
9696d06
Do not test the null toolkit
itziakos Jun 28, 2025
cde42a4
Replace sometrue with any
itziakos Jul 5, 2025
417d961
Replace alltrue with all
itziakos Jul 5, 2025
a4c9f3a
Use np.any instead of sometrue
itziakos Jul 5, 2025
5e0ad51
Install libraries needed by Qt
itziakos Jul 12, 2025
734b584
We should not need Qt developer packages
itziakos Jul 12, 2025
121ab41
Update test-with-pip.yml
itziakos Jul 12, 2025
f0172cb
Update tests to work with numpy 2.x
itziakos Jul 12, 2025
bf25995
Update code to work with numpy 2.x
itziakos Jul 12, 2025
e66d129
Update build requirements for python > 3.9
itziakos Jul 12, 2025
e8d7aa2
Set the ETS_TOOLKIT correctly
itziakos Jul 12, 2025
08a68a5
Fix typo
itziakos Jul 12, 2025
1721dbe
Use kiva-backend variable
itziakos Jul 12, 2025
224b223
Add a composite action to set the ETS_TOOLKIT environment variable
itziakos Jul 19, 2025
a5dd6fc
Fix workflow
itziakos Jul 26, 2025
beefdd8
more fixes
itziakos Jul 26, 2025
efb38c3
Fix ets_toolkit action
itziakos Jul 26, 2025
c1a073e
more fixes for the ets_toolkit action
itziakos Jul 26, 2025
568dac2
Update pip testing workflow
itziakos Jul 26, 2025
f151f5e
Run apt update before installing packages
itziakos Jul 26, 2025
bd6499a
Cache pip packages
itziakos Jul 26, 2025
6e0c02b
Add Cython to the build dependencies
itziakos Jul 26, 2025
e1acf0f
Update EDM testing
itziakos Jul 26, 2025
2fcd741
minor cleanup
itziakos Jul 26, 2025
403200e
disable pip install for now
itziakos Jul 26, 2025
9072c4c
Install swig only when need to build enable from source
itziakos Jul 26, 2025
e44fa68
Update Python requirement
itziakos Jul 26, 2025
4710aa2
Update build matrix for edm testing
itziakos Aug 23, 2025
c495bb9
Install opengl on linux workers
itziakos Aug 23, 2025
d3485ba
Use ubuntu specific packages
itziakos Aug 23, 2025
caf208c
Cleanup linux packages to install
itziakos Aug 23, 2025
be7c0fe
Add more packages
itziakos Aug 23, 2025
3f939e9
Install libglvn
itziakos Aug 23, 2025
2d0abe7
start again
itziakos Aug 23, 2025
0e20094
Add egl
itziakos Aug 23, 2025
7e7b1ad
Disable downsample acceleration on macos
itziakos Aug 23, 2025
36a0f7c
Fix workflow description
itziakos Aug 23, 2025
229f028
Fix trypo
itziakos Aug 23, 2025
64d11ee
Skip tests if the lttb modules is not available
itziakos Aug 23, 2025
37a5dcc
Enable pull request trigger for testing with pypi
itziakos Aug 23, 2025
4d64ee6
Fix typo
itziakos Aug 23, 2025
85dd70c
Do not disable _lttb on macOS
itziakos Aug 30, 2025
25a93c8
Update test_lttb
itziakos Aug 30, 2025
599b96e
Skip know failures for wx on macOS
itziakos Aug 30, 2025
e191287
skip one more test
itziakos Aug 30, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions .github/actions/ets_toolkit/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Set ETS_TOOLKIT
description: 'Set the ETS_TOOLKIT environment variable'
inputs:
toolkit:
required: true
description: 'The GUI toolkit to use (wx, null, pyqt5, pyqt6, pyside2, pyside6)'
kiva:
default: 'image'
description: 'The kiva toolkit to set'
shell:
default: 'bash'
runs:
using: composite
steps:
- name: Null toolkit
if: inputs.toolkit == 'null'
run: echo "ETS_TOOLKIT=null.${{ inputs.kiva }}" >> $GITHUB_ENV
shell: ${{ inputs.shell }}
- name: WxPython toolkit
if: inputs.toolkit == 'wx'
run: echo "ETS_TOOLKIT=wx.${{ inputs.kiva }}" >> $GITHUB_ENV
shell: ${{ inputs.shell }}
- name: PyQT5 toolkit
if: inputs.toolkit == 'pyqt5'
run: |
echo "ETS_TOOLKIT=qt.${{ inputs.kiva }}" >> $GITHUB_ENV
echo "QT_API=pyqt5" >> $GITHUB_ENV
shell: ${{ inputs.shell }}
- name: PyQT6 toolkit
if: inputs.toolkit == 'pyqt6'
run: |
echo "ETS_TOOLKIT=qt.${{ inputs.kiva }}" >> $GITHUB_ENV
echo "QT_API=pyqt6" >> $GITHUB_ENV
shell: ${{ inputs.shell }}
- name: PySide2 toolkit
if: inputs.toolkit == 'pyside2'
run: |
echo "ETS_TOOLKIT=qt.${{ inputs.kiva }}" >> $GITHUB_ENV
echo "QT_API=pyside2" >> $GITHUB_ENV
shell: ${{ inputs.shell }}
- name: PySide6 toolkit
if: inputs.toolkit == 'pyside6'
run: |
echo "ETS_TOOLKIT=qt.${{ inputs.kiva }}" >> $GITHUB_ENV
echo "QT_API=pyside6" >> $GITHUB_ENV
shell: ${{ inputs.shell }}
4 changes: 0 additions & 4 deletions .github/actions/install-qt-support/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@ runs:
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install qtbase5-dev
sudo apt-get install qtchooser
sudo apt-get install qt5-qmake
sudo apt-get install qtbase5-dev-tools
sudo apt-get install libegl1
sudo apt-get install libxkbcommon-x11-0
sudo apt-get install libxcb-icccm4
Expand Down
80 changes: 38 additions & 42 deletions .github/workflows/test-with-edm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,66 +2,62 @@
# Note that some packages may not actually be installed from EDM but from
# PyPI, see ci/edmtool.py implementations.

name: Test with EDM on Python 3.8
name: Test with EDM

on: pull_request

env:
INSTALL_EDM_VERSION: 3.5.0
INSTALL_EDM_VERSION: 4.1.1
PYTHONUNBUFFERED: 1
EDM_CONFIG: '${{ github.workspace }}/ci/edm.yaml'

jobs:

# Test against EDM packages on Linux
test-edm-linux-38:
test-edm:
strategy:
matrix:
toolkit: ['null', 'pyside6']
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install Qt dependencies
uses: ./.github/actions/install-qt-support
if: matrix.toolkit != 'null'
- name: Cache EDM packages
uses: actions/cache@v2
with:
path: ~/.cache
key: ${{ runner.os }}-3.8-${{ matrix.toolkit }}-${{ hashFiles('ci/edmtool.py') }}
- name: Setup EDM
uses: enthought/setup-edm-action@v2
with:
edm-version: ${{ env.INSTALL_EDM_VERSION }}
- name: Install click to the default EDM environment
run: edm install -y wheel click coverage
- name: Install test environment
run: edm run -- python ci/edmtool.py install --runtime=3.8 --toolkit=${{ matrix.toolkit }}
- name: Flake8
run: edm run -- python ci/edmtool.py flake8 --runtime=3.8 --toolkit=${{ matrix.toolkit }}
if: matrix.toolkit == 'null'
- name: Run tests
run: xvfb-run -a --server-args="-screen 0 1024x768x24" edm run -- python ci/edmtool.py test --runtime=3.8 --toolkit=${{ matrix.toolkit }}

# Test against EDM packages on Windows and OSX
test-with-edm-38:
strategy:
matrix:
os: [windows-latest]
toolkit: ['null', 'pyside6']
toolkit: ['null', 'pyside6', 'wx']
runtime: ['3.11']
os: ['ubuntu-latest', 'windows-latest']
include:
- toolkit: 'null'
runtime: '3.11'
os: macos-latest
- toolkit: 'pyside6'
runtime: '3.11'
os: macos-latest
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Cache EDM packages
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: ~/.cache
key: ${{ runner.os }}-3.8-${{ matrix.toolkit }}-${{ hashFiles('ci/edmtool.py') }}
key: ${{ runner.os }}-${{ matrix.toolkit }}-${{ matrix.runtime }}-${{ hashFiles('ci/edmtool.py') }}
- name: Setup EDM
uses: enthought/setup-edm-action@v1
uses: enthought/setup-edm-action@v4.1
with:
edm-version: ${{ env.INSTALL_EDM_VERSION }}
- name: Install opengl for Linux
run: |
sudo apt-get update
sudo apt-get install libopengl0 libegl1
if: matrix.os == 'ubuntu-latest' && matrix.toolkit != 'null'
- name: Install click to the default EDM environment
run: edm install -y wheel click coverage
- name: Set ETS_TOOLKIT
uses: ./.github/actions/ets_toolkit
with:
toolkit: ${{ matrix.toolkit }}
- name: Install test environment
run: edm run -- python ci/edmtool.py install --runtime=3.8 --toolkit=${{ matrix.toolkit }}
run: edm run -- python ci/edmtool.py install --toolkit=${{ matrix.toolkit }} --runtime=${{ matrix.runtime }}
- name: Run tests on Linux
if: matrix.os == 'ubuntu-latest'
env:
PYTHONFAULTHANDLER: 1
run: xvfb-run -a --server-args="-screen 0 1024x768x24" edm run -- python ci/edmtool.py test --toolkit=${{ matrix.toolkit }} --runtime=${{ matrix.runtime }}
- name: Run tests
run: edm run -- python ci/edmtool.py test --runtime=3.8 --toolkit=${{ matrix.toolkit }}
if: matrix.os != 'ubuntu-latest'
env:
PYTHONFAULTHANDLER: 1
run: edm run -- python ci/edmtool.py test --toolkit=${{ matrix.toolkit }} --runtime=${{ matrix.runtime }}
161 changes: 25 additions & 136 deletions .github/workflows/test-with-pip.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

# This workflow installs dependencies from main branch

name: Test with pip
Expand All @@ -14,153 +13,43 @@ jobs:
fail-fast: false
matrix:
os: ['ubuntu-latest', 'macos-latest', 'windows-latest']
toolkit: ['pyside6']
toolkit: ['pyside2', 'pyside6', 'pyqt5', 'wx', 'null']
kiva-backend: ['image']
python-version: ['3.8', '3.11']
include:
# Do more Python versions on linux
- os: 'ubuntu-latest'
toolkit: 'pyside6'
kiva-backend: 'image'
python-version: '3.9'
- os: 'ubuntu-latest'
toolkit: 'pyside6'
kiva-backend: 'image'
python-version: '3.10'
python-version: ['3.10', '3.11']
exclude:
# No PySide2 wheels available for Python 3.11
- toolkit: 'pyside2'
python-version: '3.11'
# No PyQt5 wheels available for Python 3.11
- toolkit: 'pyqt5'
python-version: '3.11'
# No PySide2 wheels for macos-latest
- os: 'macos-latest'
toolkit: 'pyside2'
runs-on: ${{ matrix.os }}
env:
ETS_TOOLKIT: qt4.${{ matrix.kiva-backend }}
QT_API: ${{ matrix.toolkit }}
steps:
- name: Check out
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install Qt dependencies
uses: ./.github/actions/install-qt-support
if: matrix.toolkit == 'pyside6'
- name: Install dependencies for Linux
run: |
# needed for Celiagg
sudo apt-get install libfreetype-dev libharfbuzz-dev
# needed for Cairo
sudo apt-get install libcairo2-dev
if: matrix.os == 'ubuntu-latest'
- name: Install dependencies for Mac
run: |
brew install cairo
if: matrix.os == 'macos-latest'
- name: Install build dependencies
run: |
python -m pip install --upgrade pip wheel
- name: Install local enable main (temporary)
run: pip install --force "enable[celiagg,layout,svg] @ git+https://github.com/enthought/enable.git"
- name: Install local packages
run: pip install ".[tests,${{ matrix.toolkit }}]"
- name: Sanity check package version
run: pip list
- name: Run chaco test suite (Linux)
env:
PYTHONFAULTHANDLER: 1
# kiva agg requires at least 15-bit color depth.
run: xvfb-run -a --server-args="-screen 0 1024x768x24" python -m unittest discover -v chaco
if: matrix.os == 'ubuntu-latest'
working-directory: ${{ runner.temp }}
- name: Run enable test suite (not Linux)
env:
PYTHONFAULTHANDLER: 1
run: python -m unittest discover -v chaco
if: matrix.os != 'ubuntu-latest'
working-directory: ${{ runner.temp }}

test-wx:
strategy:
fail-fast: false
matrix:
os: ['windows-latest']
toolkit: ['wx']
kiva-backend: ['image']
python-version: ['3.8', '3.10']
runs-on: ${{ matrix.os }}
env:
ETS_TOOLKIT: ${{ matrix.toolkit }}.${{ matrix.kiva-backend }}
steps:
- name: Check out
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
cache: 'pip'
- name: Set ETS_TOOLKIT
uses: ./.github/actions/ets_toolkit
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies for Linux
run: |
# needed for Celiagg
sudo apt-get install libfreetype-dev libharfbuzz-dev
# needed for Cairo
sudo apt-get install libcairo2-dev
if: matrix.os == 'ubuntu-latest'
- name: Install dependencies for Mac
run: |
brew install cairo
if: matrix.os == 'macos-latest'
toolkit: ${{ matrix.toolkit }}
- name: Install build dependencies
run: |
python -m pip install --upgrade pip wheel
- name: Install local enable main (temporary)
run: pip install --force "enable[celiagg,layout,svg] @ git+https://github.com/enthought/enable.git"
- name: Install local packages
run: pip install ".[tests,${{ matrix.toolkit }}]"
- name: Sanity check package version
run: pip list
- name: Run chaco test suite (Linux)
env:
PYTHONFAULTHANDLER: 1
# kiva agg requires at least 15-bit color depth.
run: xvfb-run -a --server-args="-screen 0 1024x768x24" python -m unittest discover -v chaco
if: matrix.os == 'ubuntu-latest'
working-directory: ${{ runner.temp }}
- name: Run enable test suite (not Linux)
env:
PYTHONFAULTHANDLER: 1
run: python -m unittest discover -v chaco
if: matrix.os != 'ubuntu-latest'
working-directory: ${{ runner.temp }}

test-null:
strategy:
fail-fast: false
matrix:
os: ['ubuntu-latest', 'macos-latest', 'windows-latest']
toolkit: ['null']
kiva-backend: ['image', 'celiagg']
python-version: ['3.8', '3.11']
runs-on: ${{ matrix.os }}
env:
ETS_TOOLKIT: ${{ matrix.toolkit }}.${{ matrix.kiva-backend }}
steps:
- name: Check out
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies for Linux
run: |
# needed for Celiagg
sudo apt-get install libfreetype-dev libharfbuzz-dev
# needed for Cairo
sudo apt-get install libcairo2-dev
if: matrix.os == 'ubuntu-latest'
- name: Install dependencies for Mac
run: |
brew install cairo
if: matrix.os == 'macos-latest'
- name: Install build dependencies
python -m pip install --upgrade pip wheel Cython
- name: Install wxdependencies for Linux
run: |
python -m pip install --upgrade pip wheel
- name: Install local enable main (temporary)
run: pip install --force "enable[celiagg,cairo,layout,svg] @ git+https://github.com/enthought/enable.git"
sudo apt-get update
sudo apt-get install libgtk-3-dev
if: matrix.os == 'ubuntu-latest' && matrix.toolkit == 'wx'
- name: Install Qt dependencies on Linux
uses: ./.github/actions/install-qt-support
if: matrix.os == 'ubuntu-latest' && startsWith(matrix.toolkit, 'py')
- name: Install local packages
run: pip install ".[tests,${{ matrix.toolkit }}]"
- name: Sanity check package version
Expand Down
4 changes: 2 additions & 2 deletions chaco/base_contour_plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#
# Thanks for using Enthought open source!

from numpy import array, isscalar, issubsctype, linspace, number
from numpy import array, isscalar, issubdtype, linspace, number

# Enthought library imports
from enable.api import ColorTrait
Expand Down Expand Up @@ -135,7 +135,7 @@ def _update_colors(self, numcolors=None):
# be converted via self._color_map_trait.
else:
if len(colors) in (3, 4) and (
isscalar(colors[0]) and issubsctype(type(colors[0]), number)
isscalar(colors[0]) and issubdtype(type(colors[0]), number)
):
self._color_map_trait = colors
self._colors = [self._color_map_trait_] * numcolors
Expand Down
4 changes: 2 additions & 2 deletions chaco/color_mapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"""

# Major library imports
import numpy as np
from numpy import (
arange,
array,
Expand All @@ -24,7 +25,6 @@
isnan,
ones,
searchsorted,
sometrue,
sort,
take,
uint8,
Expand Down Expand Up @@ -413,7 +413,7 @@ def _make_mapping_array(self, n, data):
raise ValueError(
"data mapping points must start with x=0. and end with x=1"
)
if sometrue(sort(x) - x):
if np.any(sort(x) - x):
raise ValueError(
"data mapping points must have x in increasing order"
)
Expand Down
2 changes: 1 addition & 1 deletion chaco/downsample/lttb.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
# is also available online at http://www.enthought.com/licenses/BSD.txt
#
# Thanks for using Enthought open source!

import logging
import platform

logger = logging.getLogger(__name__)

Expand Down
Loading
Loading