From 5731e0099f7a3d93595a0af925213797aabe47f1 Mon Sep 17 00:00:00 2001 From: Ioannis Tziakos Date: Sat, 28 Jun 2025 11:53:42 +0100 Subject: [PATCH 01/48] Update c code to work with recent numpy 2.x --- chaco/plots/contour/cntr.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/chaco/plots/contour/cntr.c b/chaco/plots/contour/cntr.c index 21d052432..b0c55397d 100644 --- a/chaco/plots/contour/cntr.c +++ b/chaco/plots/contour/cntr.c @@ -32,8 +32,7 @@ #ifdef NUMPY #include "numpy/arrayobject.h" # ifndef PyArray_SBYTE -# include "numpy/oldnumeric.h" -# include "numpy/old_defines.h" +# define PyArray_SBYTE NPY_INT8 # endif #else # include "Numeric/arrayobject.h" @@ -1717,7 +1716,7 @@ static PyMethodDef module_methods[] = { MOD_INIT(contour) { PyObject* m = NULL; - + static struct PyModuleDef moduledef = { PyModuleDef_HEAD_INIT, "contour", /* m_name */ @@ -1744,4 +1743,3 @@ MOD_INIT(contour) PyModule_AddObject(m, "Cntr", (PyObject *)&CntrType); RETURN_MODINIT; } - From 848cf6f5d631101a2bf1b2dd4b7a157fbbfbfa90 Mon Sep 17 00:00:00 2001 From: Ioannis Tziakos Date: Sat, 28 Jun 2025 12:04:50 +0100 Subject: [PATCH 02/48] Consolidate workflows to test cacho using PyPI packages --- .github/workflows/test-with-pip.yml | 147 +++------------------------- 1 file changed, 13 insertions(+), 134 deletions(-) diff --git a/.github/workflows/test-with-pip.yml b/.github/workflows/test-with-pip.yml index 0c4d92bb9..516c6c138 100644 --- a/.github/workflows/test-with-pip.yml +++ b/.github/workflows/test-with-pip.yml @@ -1,4 +1,3 @@ - # This workflow installs dependencies from main branch name: Test with pip @@ -14,153 +13,33 @@ jobs: fail-fast: false matrix: os: ['ubuntu-latest', 'macos-latest', 'windows-latest'] - toolkit: ['pyside6'] + toolkit: ['null', 'pyside2', 'pyside6', 'pyqt5', 'wx'] 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 - - 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 - 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 - 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 + uses: actions/checkout@v4 - 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 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" - name: Install local packages run: pip install ".[tests,${{ matrix.toolkit }}]" - name: Sanity check package version From 322d30fb4098794497f2789e704f4b61727a499f Mon Sep 17 00:00:00 2001 From: Ioannis Tziakos Date: Sat, 28 Jun 2025 12:08:55 +0100 Subject: [PATCH 03/48] Set only the ETS_TOOLKIT --- .github/workflows/test-with-pip.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/test-with-pip.yml b/.github/workflows/test-with-pip.yml index 516c6c138..d407f4861 100644 --- a/.github/workflows/test-with-pip.yml +++ b/.github/workflows/test-with-pip.yml @@ -29,7 +29,6 @@ jobs: runs-on: ${{ matrix.os }} env: ETS_TOOLKIT: qt4.${{ matrix.kiva-backend }} - QT_API: ${{ matrix.toolkit }} steps: - name: Check out uses: actions/checkout@v4 From 9696d069addff9211177ed7f05ab33e48fc11d09 Mon Sep 17 00:00:00 2001 From: Ioannis Tziakos Date: Sat, 28 Jun 2025 12:14:54 +0100 Subject: [PATCH 04/48] Do not test the null toolkit --- .github/workflows/test-with-pip.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-with-pip.yml b/.github/workflows/test-with-pip.yml index d407f4861..367d12a73 100644 --- a/.github/workflows/test-with-pip.yml +++ b/.github/workflows/test-with-pip.yml @@ -13,7 +13,7 @@ jobs: fail-fast: false matrix: os: ['ubuntu-latest', 'macos-latest', 'windows-latest'] - toolkit: ['null', 'pyside2', 'pyside6', 'pyqt5', 'wx'] + toolkit: ['pyside2', 'pyside6', 'pyqt5', 'wx'] kiva-backend: ['image'] python-version: ['3.10', '3.11'] exclude: From cde42a40590b7b37b4e9d26d28e2a5238a10c886 Mon Sep 17 00:00:00 2001 From: Ioannis Tziakos Date: Sat, 5 Jul 2025 11:17:58 +0100 Subject: [PATCH 05/48] Replace sometrue with any --- chaco/log_mapper.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/chaco/log_mapper.py b/chaco/log_mapper.py index 7059706ff..885dc1832 100644 --- a/chaco/log_mapper.py +++ b/chaco/log_mapper.py @@ -18,7 +18,7 @@ log10, exp, zeros, - sometrue, + any, floor, ceil, ndarray, @@ -79,7 +79,7 @@ def map_screen(self, data_array): try: with np.errstate(invalid="ignore"): mask = (data_array <= LOG_MINIMUM) | isnan(data_array) - if sometrue(mask): + if any(mask): data_array = array(data_array, copy=True, ndmin=1) data_array[mask] = self.fill_value intermediate = ( From 417d9611c29d25ea6cab6886f983ff6576c66472 Mon Sep 17 00:00:00 2001 From: Ioannis Tziakos Date: Sat, 5 Jul 2025 12:30:24 +0100 Subject: [PATCH 06/48] Replace alltrue with all --- chaco/tests/test_border.py | 5 +++-- chaco/tests/test_datarange_2d.py | 5 +++-- chaco/tests/test_plot.py | 11 ++++++----- chaco/tests/test_speedups.py | 5 +++-- 4 files changed, 15 insertions(+), 11 deletions(-) diff --git a/chaco/tests/test_border.py b/chaco/tests/test_border.py index 0d22f0fc3..98d22fb56 100644 --- a/chaco/tests/test_border.py +++ b/chaco/tests/test_border.py @@ -17,7 +17,8 @@ import unittest -from numpy import array, alltrue, ravel +import numpy as np +from numpy import array, ravel # Chaco imports from chaco.api import Plot, PlotGraphicsContext @@ -26,7 +27,7 @@ class DrawBorderTestCase(unittest.TestCase): def assertRavelEqual(self, x, y): self.assertTrue( - alltrue(ravel(x) == ravel(y)), "\n%s\n !=\n%s" % (x, y) + np.all(ravel(x) == ravel(y)), "\n%s\n !=\n%s" % (x, y) ) def test_draw_border_simple(self): diff --git a/chaco/tests/test_datarange_2d.py b/chaco/tests/test_datarange_2d.py index 761878424..692cb07f0 100644 --- a/chaco/tests/test_datarange_2d.py +++ b/chaco/tests/test_datarange_2d.py @@ -11,7 +11,8 @@ import unittest import warnings -from numpy import alltrue, arange, array, ravel, transpose, zeros, inf, isinf +import numpy as np +from numpy import arange, array, ravel, transpose, zeros, inf, isinf from numpy.testing import assert_equal, assert_ from chaco.api import DataRange2D, GridDataSource, PointDataSource @@ -249,7 +250,7 @@ def assert_close_(desired, actual): diff = abs(ravel(actual) - ravel(desired)) for d in diff: if not isinf(d): - assert_(alltrue(d <= diff_allowed)) + assert_(np.all(d <= diff_allowed)) return diff --git a/chaco/tests/test_plot.py b/chaco/tests/test_plot.py index 9e458d5da..6d6f63c44 100644 --- a/chaco/tests/test_plot.py +++ b/chaco/tests/test_plot.py @@ -11,7 +11,7 @@ import unittest import numpy as np -from numpy import alltrue, arange, array +from numpy import arange, array from enable.api import ComponentEditor from enable.testing import EnableTestAssistant @@ -26,6 +26,7 @@ class PlotTestCase(unittest.TestCase): + def test_plot_from_unsupported_array_shape(self): arr = arange(8).reshape(2, 2, 2) data = ArrayPlotData(x=arr, y=arr) @@ -63,7 +64,7 @@ def test_segment_plot(self): gc = PlotGraphicsContext((250, 250)) gc.render_component(plot) actual = gc.bmp_array[:, :, :] - self.assertFalse(alltrue(actual == 255)) + self.assertFalse(np.all(actual == 255)) def test_segment_plot_color(self): x = arange(10) @@ -77,7 +78,7 @@ def test_segment_plot_color(self): gc = PlotGraphicsContext((250, 250)) gc.render_component(plot) actual = gc.bmp_array[:, :, :] - self.assertFalse(alltrue(actual == 255)) + self.assertFalse(np.all(actual == 255)) def test_segment_plot_color_width(self): x = arange(10) @@ -94,7 +95,7 @@ def test_segment_plot_color_width(self): gc = PlotGraphicsContext((250, 250)) gc.render_component(plot) actual = gc.bmp_array[:, :, :] - self.assertFalse(alltrue(actual == 255)) + self.assertFalse(np.all(actual == 255)) def test_segment_plot_map_screen(self): x = arange(10) @@ -120,7 +121,7 @@ def test_text_plot(self): gc = PlotGraphicsContext((250, 250)) gc.render_component(plot) actual = gc.bmp_array[:, :, :] - self.assertFalse(alltrue(actual == 255)) + self.assertFalse(np.all(actual == 255)) def check_map_screen(self, renderer): arr = arange(10) diff --git a/chaco/tests/test_speedups.py b/chaco/tests/test_speedups.py index aa57bdf9b..39de90144 100644 --- a/chaco/tests/test_speedups.py +++ b/chaco/tests/test_speedups.py @@ -10,7 +10,8 @@ import unittest -from numpy import alltrue, array, ravel, zeros, isinf, linspace +import numpy as np +from numpy import array, ravel, zeros, isinf, linspace def assert_close(desired, actual): @@ -18,7 +19,7 @@ def assert_close(desired, actual): diff = abs(ravel(actual) - ravel(desired)) for d in diff: if not isinf(d): - assert alltrue(d <= diff_allowed) + assert np.all(d <= diff_allowed) return From a4c9f3a313c8851038b45c65d0bef24bfdbf4321 Mon Sep 17 00:00:00 2001 From: Ioannis Tziakos Date: Sat, 5 Jul 2025 12:39:31 +0100 Subject: [PATCH 07/48] Use np.any instead of sometrue --- chaco/color_mapper.py | 4 ++-- chaco/log_mapper.py | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/chaco/color_mapper.py b/chaco/color_mapper.py index a75db75a6..a62c73745 100644 --- a/chaco/color_mapper.py +++ b/chaco/color_mapper.py @@ -12,6 +12,7 @@ """ # Major library imports +import numpy as np from numpy import ( arange, array, @@ -24,7 +25,6 @@ isnan, ones, searchsorted, - sometrue, sort, take, uint8, @@ -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" ) diff --git a/chaco/log_mapper.py b/chaco/log_mapper.py index 885dc1832..18b0f512a 100644 --- a/chaco/log_mapper.py +++ b/chaco/log_mapper.py @@ -18,7 +18,6 @@ log10, exp, zeros, - any, floor, ceil, ndarray, @@ -79,7 +78,7 @@ def map_screen(self, data_array): try: with np.errstate(invalid="ignore"): mask = (data_array <= LOG_MINIMUM) | isnan(data_array) - if any(mask): + if np.any(mask): data_array = array(data_array, copy=True, ndmin=1) data_array[mask] = self.fill_value intermediate = ( From 5e0ad517c9ef7df4c85a1833f8be3878b0d48ef2 Mon Sep 17 00:00:00 2001 From: Ioannis Tziakos Date: Sat, 12 Jul 2025 11:12:13 +0100 Subject: [PATCH 08/48] Install libraries needed by Qt --- .github/workflows/test-with-pip.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/test-with-pip.yml b/.github/workflows/test-with-pip.yml index 367d12a73..63599b972 100644 --- a/.github/workflows/test-with-pip.yml +++ b/.github/workflows/test-with-pip.yml @@ -39,6 +39,9 @@ jobs: - name: Install build dependencies run: | python -m pip install --upgrade pip wheel + - name: Install Qt dependencies + uses: .github/actions/install-qt-support + if: matrix.toolkit != 'wx' && matrix.toolkit != 'null' - name: Install local packages run: pip install ".[tests,${{ matrix.toolkit }}]" - name: Sanity check package version From 734b5840347123d2085070594f82afba8d279f9c Mon Sep 17 00:00:00 2001 From: Ioannis Tziakos Date: Sat, 12 Jul 2025 11:14:00 +0100 Subject: [PATCH 09/48] We should not need Qt developer packages --- .github/actions/install-qt-support/action.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/actions/install-qt-support/action.yml b/.github/actions/install-qt-support/action.yml index 66b98ab7e..a974048d7 100644 --- a/.github/actions/install-qt-support/action.yml +++ b/.github/actions/install-qt-support/action.yml @@ -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 From 121ab415191c11f0e05990d1c94870ab538a15ec Mon Sep 17 00:00:00 2001 From: Ioannis Tziakos Date: Sat, 12 Jul 2025 11:16:42 +0100 Subject: [PATCH 10/48] Update test-with-pip.yml --- .github/workflows/test-with-pip.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-with-pip.yml b/.github/workflows/test-with-pip.yml index 63599b972..67ad6eca5 100644 --- a/.github/workflows/test-with-pip.yml +++ b/.github/workflows/test-with-pip.yml @@ -40,7 +40,7 @@ jobs: run: | python -m pip install --upgrade pip wheel - name: Install Qt dependencies - uses: .github/actions/install-qt-support + uses: ./.github/actions/install-qt-support if: matrix.toolkit != 'wx' && matrix.toolkit != 'null' - name: Install local packages run: pip install ".[tests,${{ matrix.toolkit }}]" From f0172cb143ca8280d5edbd930c6253a3f5fd1d11 Mon Sep 17 00:00:00 2001 From: Ioannis Tziakos Date: Sat, 12 Jul 2025 11:52:37 +0100 Subject: [PATCH 11/48] Update tests to work with numpy 2.x --- chaco/plots/tests/test_barplot.py | 7 +-- .../tests/test_colormapped_scatterplot.py | 11 +++-- chaco/plots/tests/test_errorbarplot.py | 3 +- chaco/plots/tests/test_jitterplot.py | 15 +++--- chaco/plots/tests/test_line_scatterplot.py | 23 ++++----- chaco/plots/tests/test_scatterplot_1d.py | 21 +++++---- .../plots/tests/test_scatterplot_renderers.py | 10 ++-- chaco/plots/tests/test_segment_plot.py | 47 ++++++++++--------- chaco/plots/tests/test_text_plot.py | 5 +- chaco/plots/tests/test_text_plot_1d.py | 13 ++--- chaco/tools/lasso_selection.py | 4 +- 11 files changed, 83 insertions(+), 76 deletions(-) diff --git a/chaco/plots/tests/test_barplot.py b/chaco/plots/tests/test_barplot.py index d92554bd8..fdfbf2b6a 100644 --- a/chaco/plots/tests/test_barplot.py +++ b/chaco/plots/tests/test_barplot.py @@ -10,7 +10,8 @@ import unittest -from numpy import alltrue, arange, nan +import numpy as np +from numpy import arange, nan from traits.testing.api import UnittestTools @@ -71,7 +72,7 @@ def test_barplot(self): gc = PlotGraphicsContext(self.size) gc.render_component(self.barplot) actual = gc.bmp_array[:, :, :] - self.assertFalse(alltrue(actual == 255)) + self.assertFalse(np.all(actual == 255)) def test_barplot_horizontal(self): self.barplot.orientation = 'v' @@ -95,4 +96,4 @@ def test_barplot_horizontal(self): gc = PlotGraphicsContext(self.size) gc.render_component(self.barplot) actual = gc.bmp_array[:, :, :] - self.assertFalse(alltrue(actual == 255)) + self.assertFalse(np.all(actual == 255)) diff --git a/chaco/plots/tests/test_colormapped_scatterplot.py b/chaco/plots/tests/test_colormapped_scatterplot.py index a34f8fcc8..865507322 100644 --- a/chaco/plots/tests/test_colormapped_scatterplot.py +++ b/chaco/plots/tests/test_colormapped_scatterplot.py @@ -10,7 +10,8 @@ import unittest -from numpy import alltrue, arange +import numpy as np +from numpy import arange from enable.compiled_path import CompiledPath # Chaco imports @@ -59,7 +60,7 @@ def test_scatter_render(self): """ Coverage test to check basic case works """ self.gc.render_component(self.scatterplot) actual = self.gc.bmp_array[:, :, :] - self.assertFalse(alltrue(actual == 255)) + self.assertFalse(np.all(actual == 255)) def test_scatter_circle(self): """ Coverage test to check circles work """ @@ -67,7 +68,7 @@ def test_scatter_circle(self): self.gc.render_component(self.scatterplot) actual = self.gc.bmp_array[:, :, :] - self.assertFalse(alltrue(actual == 255)) + self.assertFalse(np.all(actual == 255)) def test_scatter_custom(self): """Coverage test to check custom markers work. @@ -87,7 +88,7 @@ def test_scatter_custom(self): self.gc.render_component(self.scatterplot) actual = self.gc.bmp_array[:, :, :] - self.assertFalse(alltrue(actual == 255)) + self.assertFalse(np.all(actual == 255)) def test_colormap_updated(self): """ If colormapper updated then we need to redraw """ @@ -100,4 +101,4 @@ def test_non_kiva_marker(self): self.gc.render_component(self.scatterplot) actual = self.gc.bmp_array[:, :, :] - self.assertFalse(alltrue(actual == 255)) + self.assertFalse(np.all(actual == 255)) diff --git a/chaco/plots/tests/test_errorbarplot.py b/chaco/plots/tests/test_errorbarplot.py index 74f497d7f..8ff1eaf36 100644 --- a/chaco/plots/tests/test_errorbarplot.py +++ b/chaco/plots/tests/test_errorbarplot.py @@ -11,7 +11,6 @@ import unittest import numpy as np -from numpy import alltrue # Chaco imports from chaco.api import ( @@ -46,4 +45,4 @@ def test_errorbarplot(self): gc = PlotGraphicsContext(size) gc.render_component(errorbar_plot) actual = gc.bmp_array[:, :, :] - self.assertFalse(alltrue(actual == 255)) + self.assertFalse(np.all(actual == 255)) diff --git a/chaco/plots/tests/test_jitterplot.py b/chaco/plots/tests/test_jitterplot.py index 2b04fb116..f0f452336 100644 --- a/chaco/plots/tests/test_jitterplot.py +++ b/chaco/plots/tests/test_jitterplot.py @@ -10,7 +10,8 @@ import unittest -from numpy import alltrue, arange, array +import numpy as np +from numpy import arange, array from numpy.testing import assert_almost_equal from enable.compiled_path import CompiledPath @@ -48,7 +49,7 @@ def test_scatter_1d(self): gc = PlotGraphicsContext(self.size) gc.render_component(self.scatterplot) actual = gc.bmp_array[:, :, :] - self.assertFalse(alltrue(actual == 255)) + self.assertFalse(np.all(actual == 255)) def test_scatter_1d_horizontal(self): self.scatterplot.orientation = "h" @@ -62,7 +63,7 @@ def test_scatter_1d_horizontal(self): gc = PlotGraphicsContext(self.size) gc.render_component(self.scatterplot) actual = gc.bmp_array[:, :, :] - self.assertFalse(alltrue(actual == 255)) + self.assertFalse(np.all(actual == 255)) def test_scatter_1d_flipped(self): self.scatterplot.direction = "flipped" @@ -76,7 +77,7 @@ def test_scatter_1d_flipped(self): gc = PlotGraphicsContext(self.size) gc.render_component(self.scatterplot) actual = gc.bmp_array[:, :, :] - self.assertFalse(alltrue(actual == 255)) + self.assertFalse(np.all(actual == 255)) def test_scatter_1d_horizontal_flipped(self): self.scatterplot.direction = "flipped" @@ -91,14 +92,14 @@ def test_scatter_1d_horizontal_flipped(self): gc = PlotGraphicsContext(self.size) gc.render_component(self.scatterplot) actual = gc.bmp_array[:, :, :] - self.assertFalse(alltrue(actual == 255)) + self.assertFalse(np.all(actual == 255)) def test_scatter_1d_circle(self): self.scatterplot.marker = "circle" gc = PlotGraphicsContext(self.size) gc.render_component(self.scatterplot) actual = gc.bmp_array[:, :, :] - self.assertFalse(alltrue(actual == 255)) + self.assertFalse(np.all(actual == 255)) def test_scatter_1d_custom(self): path = CompiledPath() @@ -113,7 +114,7 @@ def test_scatter_1d_custom(self): gc = PlotGraphicsContext(self.size) gc.render_component(self.scatterplot) actual = gc.bmp_array[:, :, :] - self.assertFalse(alltrue(actual == 255)) + self.assertFalse(np.all(actual == 255)) def test_scatter_1d_map_data(self): points = array([[0, 124.5], [124.5, 0]]) diff --git a/chaco/plots/tests/test_line_scatterplot.py b/chaco/plots/tests/test_line_scatterplot.py index 7c86cccf5..1bf2a23a3 100644 --- a/chaco/plots/tests/test_line_scatterplot.py +++ b/chaco/plots/tests/test_line_scatterplot.py @@ -10,7 +10,8 @@ import unittest -from numpy import alltrue, arange, array +import numpy as np +from numpy import arange, array from numpy.testing import assert_almost_equal from traits.testing.api import UnittestTools @@ -53,7 +54,7 @@ def test_linescatter_1d(self): gc = PlotGraphicsContext(self.size) gc.render_component(self.linescatterplot) actual = gc.bmp_array[:, :, :] - self.assertFalse(alltrue(actual == 255)) + self.assertFalse(np.all(actual == 255)) def test_linescatter_1d_horizontal(self): self.linescatterplot.orientation = "h" @@ -67,7 +68,7 @@ def test_linescatter_1d_horizontal(self): gc = PlotGraphicsContext(self.size) gc.render_component(self.linescatterplot) actual = gc.bmp_array[:, :, :] - self.assertFalse(alltrue(actual == 255)) + self.assertFalse(np.all(actual == 255)) def test_linescatter_1d_flipped(self): self.linescatterplot.direction = "flipped" @@ -81,7 +82,7 @@ def test_linescatter_1d_flipped(self): gc = PlotGraphicsContext(self.size) gc.render_component(self.linescatterplot) actual = gc.bmp_array[:, :, :] - self.assertFalse(alltrue(actual == 255)) + self.assertFalse(np.all(actual == 255)) def test_linescatter_1d_horizontal_flipped(self): self.linescatterplot.direction = "flipped" @@ -96,28 +97,28 @@ def test_linescatter_1d_horizontal_flipped(self): gc = PlotGraphicsContext(self.size) gc.render_component(self.linescatterplot) actual = gc.bmp_array[:, :, :] - self.assertFalse(alltrue(actual == 255)) + self.assertFalse(np.all(actual == 255)) def test_linescatter_1d_thicker(self): self.linescatterplot.line_width = 2.0 gc = PlotGraphicsContext(self.size) gc.render_component(self.linescatterplot) actual = gc.bmp_array[:, :, :] - self.assertFalse(alltrue(actual == 255)) + self.assertFalse(np.all(actual == 255)) def test_linescatter_1d_color(self): self.linescatterplot.color = "orange" gc = PlotGraphicsContext(self.size) gc.render_component(self.linescatterplot) actual = gc.bmp_array[:, :, :] - self.assertFalse(alltrue(actual == 255)) + self.assertFalse(np.all(actual == 255)) def test_linescatter_1d_line_style(self): self.linescatterplot.line_style = "dash" gc = PlotGraphicsContext(self.size) gc.render_component(self.linescatterplot) actual = gc.bmp_array[:, :, :] - self.assertFalse(alltrue(actual == 255)) + self.assertFalse(np.all(actual == 255)) def test_linescatter_1d_map_data(self): points = array([[0, 124.5], [124.5, 0]]) @@ -155,7 +156,7 @@ def test_linescatter_1d_selection(self): gc = PlotGraphicsContext(self.size) gc.render_component(self.linescatterplot) actual = gc.bmp_array[:, :, :] - self.assertFalse(alltrue(actual == 255)) + self.assertFalse(np.all(actual == 255)) def test_linescatter_1d_selection_mask_name(self): # select with a mask @@ -167,7 +168,7 @@ def test_linescatter_1d_selection_mask_name(self): gc = PlotGraphicsContext(self.size) gc.render_component(self.linescatterplot) actual = gc.bmp_array[:, :, :] - self.assertFalse(alltrue(actual == 255)) + self.assertFalse(np.all(actual == 255)) def test_linescatter_1d_selection_alpha(self): # test with different alpha @@ -179,7 +180,7 @@ def test_linescatter_1d_selection_alpha(self): gc = PlotGraphicsContext(self.size) gc.render_component(self.linescatterplot) actual = gc.bmp_array[:, :, :] - self.assertFalse(alltrue(actual == 255)) + self.assertFalse(np.all(actual == 255)) def test_linescatter_1d_set_index_range(self): new_range = DataRange1D(low=0.42, high=1.42) diff --git a/chaco/plots/tests/test_scatterplot_1d.py b/chaco/plots/tests/test_scatterplot_1d.py index a6ac97a8b..1b12a7e26 100644 --- a/chaco/plots/tests/test_scatterplot_1d.py +++ b/chaco/plots/tests/test_scatterplot_1d.py @@ -10,7 +10,8 @@ import unittest -from numpy import alltrue, arange, array +import numpy as np +from numpy import arange, array from numpy.testing import assert_almost_equal from enable.compiled_path import CompiledPath @@ -53,7 +54,7 @@ def test_scatter_1d(self): gc = PlotGraphicsContext(self.size) gc.render_component(self.scatterplot) actual = gc.bmp_array[:, :, :] - self.assertFalse(alltrue(actual == 255)) + self.assertFalse(np.all(actual == 255)) def test_scatter_1d_horizontal(self): self.scatterplot.orientation = "h" @@ -67,7 +68,7 @@ def test_scatter_1d_horizontal(self): gc = PlotGraphicsContext(self.size) gc.render_component(self.scatterplot) actual = gc.bmp_array[:, :, :] - self.assertFalse(alltrue(actual == 255)) + self.assertFalse(np.all(actual == 255)) def test_scatter_1d_flipped(self): self.scatterplot.direction = "flipped" @@ -81,7 +82,7 @@ def test_scatter_1d_flipped(self): gc = PlotGraphicsContext(self.size) gc.render_component(self.scatterplot) actual = gc.bmp_array[:, :, :] - self.assertFalse(alltrue(actual == 255)) + self.assertFalse(np.all(actual == 255)) def test_scatter_1d_horizontal_flipped(self): self.scatterplot.direction = "flipped" @@ -96,14 +97,14 @@ def test_scatter_1d_horizontal_flipped(self): gc = PlotGraphicsContext(self.size) gc.render_component(self.scatterplot) actual = gc.bmp_array[:, :, :] - self.assertFalse(alltrue(actual == 255)) + self.assertFalse(np.all(actual == 255)) def test_scatter_1d_circle(self): self.scatterplot.marker = "circle" gc = PlotGraphicsContext(self.size) gc.render_component(self.scatterplot) actual = gc.bmp_array[:, :, :] - self.assertFalse(alltrue(actual == 255)) + self.assertFalse(np.all(actual == 255)) def test_scatter_1d_custom(self): path = CompiledPath() @@ -118,7 +119,7 @@ def test_scatter_1d_custom(self): gc = PlotGraphicsContext(self.size) gc.render_component(self.scatterplot) actual = gc.bmp_array[:, :, :] - self.assertFalse(alltrue(actual == 255)) + self.assertFalse(np.all(actual == 255)) def test_scatter_1d_map_data(self): points = array([[0, 124.5], [124.5, 0]]) @@ -153,7 +154,7 @@ def test_scatter_1d_selection(self): gc = PlotGraphicsContext(self.size) gc.render_component(self.scatterplot) actual = gc.bmp_array[:, :, :] - self.assertFalse(alltrue(actual == 255)) + self.assertFalse(np.all(actual == 255)) def test_scatter_1d_selection_mask_name(self): # select with a mask @@ -165,7 +166,7 @@ def test_scatter_1d_selection_mask_name(self): gc = PlotGraphicsContext(self.size) gc.render_component(self.scatterplot) actual = gc.bmp_array[:, :, :] - self.assertFalse(alltrue(actual == 255)) + self.assertFalse(np.all(actual == 255)) def test_scatter_1d_selection_alpha(self): # test with different alpha @@ -177,7 +178,7 @@ def test_scatter_1d_selection_alpha(self): gc = PlotGraphicsContext(self.size) gc.render_component(self.scatterplot) actual = gc.bmp_array[:, :, :] - self.assertFalse(alltrue(actual == 255)) + self.assertFalse(np.all(actual == 255)) def test_scatter_1d_set_index_range(self): new_range = DataRange1D(low=0.42, high=1.42) diff --git a/chaco/plots/tests/test_scatterplot_renderers.py b/chaco/plots/tests/test_scatterplot_renderers.py index 54bcee37b..a931c133e 100644 --- a/chaco/plots/tests/test_scatterplot_renderers.py +++ b/chaco/plots/tests/test_scatterplot_renderers.py @@ -10,7 +10,7 @@ import unittest -from numpy import alltrue +import numpy as np from enable.compiled_path import CompiledPath # Chaco imports @@ -29,7 +29,7 @@ def test_scatter_fast(self): gc = PlotGraphicsContext(size) gc.render_component(scatterplot) actual = gc.bmp_array[:, :, :] - self.assertFalse(alltrue(actual == 255)) + self.assertFalse(np.all(actual == 255)) def test_scatter_circle(self): """ Coverage test to check circles work """ @@ -43,7 +43,7 @@ def test_scatter_circle(self): gc = PlotGraphicsContext(size) gc.render_component(scatterplot) actual = gc.bmp_array[:, :, :] - self.assertFalse(alltrue(actual == 255)) + self.assertFalse(np.all(actual == 255)) def test_scatter_custom(self): """ Coverage test to check custom markers work """ @@ -66,7 +66,7 @@ def test_scatter_custom(self): gc = PlotGraphicsContext(size) gc.render_component(scatterplot) actual = gc.bmp_array[:, :, :] - self.assertFalse(alltrue(actual == 255)) + self.assertFalse(np.all(actual == 255)) def test_scatter_slow(self): """ Coverage test to check multiple marker size works """ @@ -81,4 +81,4 @@ def test_scatter_slow(self): gc = PlotGraphicsContext(size) gc.render_component(scatterplot) actual = gc.bmp_array[:, :, :] - self.assertFalse(alltrue(actual == 255)) + self.assertFalse(np.all(actual == 255)) diff --git a/chaco/plots/tests/test_segment_plot.py b/chaco/plots/tests/test_segment_plot.py index 8cc6ddae3..439152e0c 100644 --- a/chaco/plots/tests/test_segment_plot.py +++ b/chaco/plots/tests/test_segment_plot.py @@ -10,7 +10,8 @@ import unittest -from numpy import alltrue, arange, array +import numpy as np +from numpy import arange, array from numpy.testing import assert_array_equal # Chaco imports @@ -79,7 +80,7 @@ def test_segment(self): gc = PlotGraphicsContext(self.size) gc.render_component(self.segment_plot) actual = gc.bmp_array[:, :, :] - self.assertFalse(alltrue(actual == 255)) + self.assertFalse(np.all(actual == 255)) def test_segment_orthogonal(self): self.segment_plot.render_style = "orthogonal" @@ -95,7 +96,7 @@ def test_segment_orthogonal(self): gc = PlotGraphicsContext(self.size) gc.render_component(self.segment_plot) actual = gc.bmp_array[:, :, :] - self.assertFalse(alltrue(actual == 255)) + self.assertFalse(np.all(actual == 255)) def test_segment_quad(self): self.segment_plot.render_style = "quad" @@ -111,7 +112,7 @@ def test_segment_quad(self): gc = PlotGraphicsContext(self.size) gc.render_component(self.segment_plot) actual = gc.bmp_array[:, :, :] - self.assertFalse(alltrue(actual == 255)) + self.assertFalse(np.all(actual == 255)) def test_segment_cubic(self): self.segment_plot.render_style = "cubic" @@ -127,7 +128,7 @@ def test_segment_cubic(self): gc = PlotGraphicsContext(self.size) gc.render_component(self.segment_plot) actual = gc.bmp_array[:, :, :] - self.assertFalse(alltrue(actual == 255)) + self.assertFalse(np.all(actual == 255)) def test_segment_color(self): self.set_color_data() @@ -135,7 +136,7 @@ def test_segment_color(self): gc = PlotGraphicsContext(self.size) gc.render_component(self.segment_plot) actual = gc.bmp_array[:, :, :] - self.assertFalse(alltrue(actual == 255)) + self.assertFalse(np.all(actual == 255)) def test_segment_color_orthogonal(self): self.segment_plot.render_style = "orthogonal" @@ -144,7 +145,7 @@ def test_segment_color_orthogonal(self): gc = PlotGraphicsContext(self.size) gc.render_component(self.segment_plot) actual = gc.bmp_array[:, :, :] - self.assertFalse(alltrue(actual == 255)) + self.assertFalse(np.all(actual == 255)) def test_segment_color_quad(self): self.segment_plot.render_style = "quad" @@ -153,7 +154,7 @@ def test_segment_color_quad(self): gc = PlotGraphicsContext(self.size) gc.render_component(self.segment_plot) actual = gc.bmp_array[:, :, :] - self.assertFalse(alltrue(actual == 255)) + self.assertFalse(np.all(actual == 255)) def test_segment_color_cubic(self): self.segment_plot.render_style = "cubic" @@ -162,7 +163,7 @@ def test_segment_color_cubic(self): gc = PlotGraphicsContext(self.size) gc.render_component(self.segment_plot) actual = gc.bmp_array[:, :, :] - self.assertFalse(alltrue(actual == 255)) + self.assertFalse(np.all(actual == 255)) def test_segment_width(self): self.set_width_data() @@ -170,7 +171,7 @@ def test_segment_width(self): gc = PlotGraphicsContext(self.size) gc.render_component(self.segment_plot) actual = gc.bmp_array[:, :, :] - self.assertFalse(alltrue(actual == 255)) + self.assertFalse(np.all(actual == 255)) def test_segment_width_orthogonal(self): self.segment_plot.render_style = "orthogonal" @@ -179,7 +180,7 @@ def test_segment_width_orthogonal(self): gc = PlotGraphicsContext(self.size) gc.render_component(self.segment_plot) actual = gc.bmp_array[:, :, :] - self.assertFalse(alltrue(actual == 255)) + self.assertFalse(np.all(actual == 255)) def test_segment_width_quad(self): self.segment_plot.render_style = "quad" @@ -188,7 +189,7 @@ def test_segment_width_quad(self): gc = PlotGraphicsContext(self.size) gc.render_component(self.segment_plot) actual = gc.bmp_array[:, :, :] - self.assertFalse(alltrue(actual == 255)) + self.assertFalse(np.all(actual == 255)) def test_segment_width_cubic(self): self.segment_plot.render_style = "cubic" @@ -197,7 +198,7 @@ def test_segment_width_cubic(self): gc = PlotGraphicsContext(self.size) gc.render_component(self.segment_plot) actual = gc.bmp_array[:, :, :] - self.assertFalse(alltrue(actual == 255)) + self.assertFalse(np.all(actual == 255)) def test_segment_width_color(self): self.set_width_data() @@ -206,7 +207,7 @@ def test_segment_width_color(self): gc = PlotGraphicsContext(self.size) gc.render_component(self.segment_plot) actual = gc.bmp_array[:, :, :] - self.assertFalse(alltrue(actual == 255)) + self.assertFalse(np.all(actual == 255)) def test_segment_width_orthogonal_color(self): self.segment_plot.render_style = "orthogonal" @@ -216,7 +217,7 @@ def test_segment_width_orthogonal_color(self): gc = PlotGraphicsContext(self.size) gc.render_component(self.segment_plot) actual = gc.bmp_array[:, :, :] - self.assertFalse(alltrue(actual == 255)) + self.assertFalse(np.all(actual == 255)) def test_segment_width_quad_color(self): self.segment_plot.render_style = "quad" @@ -226,7 +227,7 @@ def test_segment_width_quad_color(self): gc = PlotGraphicsContext(self.size) gc.render_component(self.segment_plot) actual = gc.bmp_array[:, :, :] - self.assertFalse(alltrue(actual == 255)) + self.assertFalse(np.all(actual == 255)) def test_segment_width_cubic_color(self): self.segment_plot.render_style = "cubic" @@ -236,7 +237,7 @@ def test_segment_width_cubic_color(self): gc = PlotGraphicsContext(self.size) gc.render_component(self.segment_plot) actual = gc.bmp_array[:, :, :] - self.assertFalse(alltrue(actual == 255)) + self.assertFalse(np.all(actual == 255)) def test_segment_alpha(self): self.segment_plot.alpha = 0.5 @@ -244,7 +245,7 @@ def test_segment_alpha(self): gc = PlotGraphicsContext(self.size) gc.render_component(self.segment_plot) actual = gc.bmp_array[:, :, :] - self.assertFalse(alltrue(actual == 255)) + self.assertFalse(np.all(actual == 255)) def test_segment_orthogonal_alpha(self): self.segment_plot.render_style = "orthogonal" @@ -253,7 +254,7 @@ def test_segment_orthogonal_alpha(self): gc = PlotGraphicsContext(self.size) gc.render_component(self.segment_plot) actual = gc.bmp_array[:, :, :] - self.assertFalse(alltrue(actual == 255)) + self.assertFalse(np.all(actual == 255)) def test_segment_quad_alpha(self): self.segment_plot.render_style = "quad" @@ -262,7 +263,7 @@ def test_segment_quad_alpha(self): gc = PlotGraphicsContext(self.size) gc.render_component(self.segment_plot) actual = gc.bmp_array[:, :, :] - self.assertFalse(alltrue(actual == 255)) + self.assertFalse(np.all(actual == 255)) def test_segment_cubic_alpha(self): self.segment_plot.render_style = "cubic" @@ -271,7 +272,7 @@ def test_segment_cubic_alpha(self): gc = PlotGraphicsContext(self.size) gc.render_component(self.segment_plot) actual = gc.bmp_array[:, :, :] - self.assertFalse(alltrue(actual == 255)) + self.assertFalse(np.all(actual == 255)) def test_segment_selection(self): mask = array([True, True, False, False, True]) @@ -290,7 +291,7 @@ def test_segment_selection(self): gc = PlotGraphicsContext(self.size) gc.render_component(self.segment_plot) actual = gc.bmp_array[:, :, :] - self.assertFalse(alltrue(actual == 255)) + self.assertFalse(np.all(actual == 255)) def test_segment_selection_color(self): mask = array([True, True, False, False, True]) @@ -309,4 +310,4 @@ def test_segment_selection_color(self): gc = PlotGraphicsContext(self.size) gc.render_component(self.segment_plot) actual = gc.bmp_array[:, :, :] - self.assertFalse(alltrue(actual == 255)) + self.assertFalse(np.all(actual == 255)) diff --git a/chaco/plots/tests/test_text_plot.py b/chaco/plots/tests/test_text_plot.py index 19d59ad09..c4eb21300 100644 --- a/chaco/plots/tests/test_text_plot.py +++ b/chaco/plots/tests/test_text_plot.py @@ -10,7 +10,8 @@ import unittest -from numpy import alltrue, arange, array +import numpy as np +from numpy import arange, array # Chaco imports from chaco.api import ( @@ -63,4 +64,4 @@ def test_text(self): gc = PlotGraphicsContext(self.size) gc.render_component(self.text_plot) actual = gc.bmp_array[:, :, :] - self.assertFalse(alltrue(actual == 255)) + self.assertFalse(np.all(actual == 255)) diff --git a/chaco/plots/tests/test_text_plot_1d.py b/chaco/plots/tests/test_text_plot_1d.py index 9ae76fae9..417176b59 100644 --- a/chaco/plots/tests/test_text_plot_1d.py +++ b/chaco/plots/tests/test_text_plot_1d.py @@ -10,7 +10,8 @@ import unittest -from numpy import alltrue, arange, array +import numpy as np +from numpy import arange, array from numpy.testing import assert_almost_equal from traits.testing.api import UnittestTools @@ -65,7 +66,7 @@ def test_text_1d(self): gc = PlotGraphicsContext(self.size) gc.render_component(self.textplot) actual = gc.bmp_array[:, :, :] - self.assertFalse(alltrue(actual == 255)) + self.assertFalse(np.all(actual == 255)) def test_text_1d_horizontal(self): self.textplot.orientation = "h" @@ -77,7 +78,7 @@ def test_text_1d_horizontal(self): gc = PlotGraphicsContext(self.size) gc.render_component(self.textplot) actual = gc.bmp_array[:, :, :] - self.assertFalse(alltrue(actual == 255)) + self.assertFalse(np.all(actual == 255)) def test_text_1d_flipped(self): self.textplot.direction = "flipped" @@ -89,7 +90,7 @@ def test_text_1d_flipped(self): gc = PlotGraphicsContext(self.size) gc.render_component(self.textplot) actual = gc.bmp_array[:, :, :] - self.assertFalse(alltrue(actual == 255)) + self.assertFalse(np.all(actual == 255)) def test_text_1d_horizontal_flipped(self): self.textplot.direction = "flipped" @@ -102,14 +103,14 @@ def test_text_1d_horizontal_flipped(self): gc = PlotGraphicsContext(self.size) gc.render_component(self.textplot) actual = gc.bmp_array[:, :, :] - self.assertFalse(alltrue(actual == 255)) + self.assertFalse(np.all(actual == 255)) def test_text_1d_rotated(self): self.textplot.text_rotate_angle = 45 gc = PlotGraphicsContext(self.size) gc.render_component(self.textplot) actual = gc.bmp_array[:, :, :] - self.assertFalse(alltrue(actual == 255)) + self.assertFalse(np.all(actual == 255)) def test_text_1d_map_data(self): points = array([[0, 124.5], [124.5, 0]]) diff --git a/chaco/tools/lasso_selection.py b/chaco/tools/lasso_selection.py index fa446189d..685afd4c0 100644 --- a/chaco/tools/lasso_selection.py +++ b/chaco/tools/lasso_selection.py @@ -12,7 +12,7 @@ """ # Major library imports import numpy -from numpy import array, column_stack, empty, sometrue, vstack, zeros +from numpy import array, column_stack, empty, vstack, zeros # Enthought library imports from traits.api import ( @@ -306,7 +306,7 @@ def _update_selection(self): else: selected_mask |= active_selection - if sometrue( + if numpy.any( selected_mask != self.selection_datasource.metadata[self.metadata_name] ): From bf25995c33a28482dea604cddd0edc01a322646e Mon Sep 17 00:00:00 2001 From: Ioannis Tziakos Date: Sat, 12 Jul 2025 11:52:49 +0100 Subject: [PATCH 12/48] Update code to work with numpy 2.x --- chaco/base_contour_plot.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/chaco/base_contour_plot.py b/chaco/base_contour_plot.py index 9f2adf429..9cef21fa4 100644 --- a/chaco/base_contour_plot.py +++ b/chaco/base_contour_plot.py @@ -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 @@ -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 From e66d1297dc0c0731677b37a370c87853f7b820b4 Mon Sep 17 00:00:00 2001 From: Ioannis Tziakos Date: Sat, 12 Jul 2025 11:52:59 +0100 Subject: [PATCH 13/48] Update build requirements for python > 3.9 --- pyproject.toml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index b1256a319..40b9b8ad2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,10 @@ [build-system] -requires = ["cython", "oldest-supported-numpy", "setuptools", "wheel"] +requires = [ + "cython", + "oldest-supported-numpy; python_version<'3.9'", + "numpy>=2; python_version>='3.9'", + "setuptools", + "wheel"] build-backend = "setuptools.build_meta" [tool.cibuildwheel] From e8d7aa2baf5297d42fad0eaa787e256c77ef3264 Mon Sep 17 00:00:00 2001 From: Ioannis Tziakos Date: Sat, 12 Jul 2025 12:12:47 +0100 Subject: [PATCH 14/48] Set the ETS_TOOLKIT correctly --- .github/workflows/test-with-pip.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-with-pip.yml b/.github/workflows/test-with-pip.yml index 67ad6eca5..97122ec02 100644 --- a/.github/workflows/test-with-pip.yml +++ b/.github/workflows/test-with-pip.yml @@ -28,7 +28,7 @@ jobs: toolkit: 'pyside2' runs-on: ${{ matrix.os }} env: - ETS_TOOLKIT: qt4.${{ matrix.kiva-backend }} + ETS_TOOLKIT: ${{ matrix.tookit }}.image steps: - name: Check out uses: actions/checkout@v4 @@ -41,7 +41,7 @@ jobs: python -m pip install --upgrade pip wheel - name: Install Qt dependencies uses: ./.github/actions/install-qt-support - if: matrix.toolkit != 'wx' && matrix.toolkit != 'null' + if: matrix.os == 'ubuntu-latest' - name: Install local packages run: pip install ".[tests,${{ matrix.toolkit }}]" - name: Sanity check package version From 08a68a5ac057220e37a493a6708c6be809a5a3cd Mon Sep 17 00:00:00 2001 From: Ioannis Tziakos Date: Sat, 12 Jul 2025 12:15:48 +0100 Subject: [PATCH 15/48] Fix typo --- .github/workflows/test-with-pip.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-with-pip.yml b/.github/workflows/test-with-pip.yml index 97122ec02..3cf4ed304 100644 --- a/.github/workflows/test-with-pip.yml +++ b/.github/workflows/test-with-pip.yml @@ -28,7 +28,7 @@ jobs: toolkit: 'pyside2' runs-on: ${{ matrix.os }} env: - ETS_TOOLKIT: ${{ matrix.tookit }}.image + ETS_TOOLKIT: ${{ matrix.toolkit }}.image steps: - name: Check out uses: actions/checkout@v4 From 1721dbe96767637b53f73e1f8318cea988efa989 Mon Sep 17 00:00:00 2001 From: Ioannis Tziakos Date: Sat, 12 Jul 2025 12:18:29 +0100 Subject: [PATCH 16/48] Use kiva-backend variable --- .github/workflows/test-with-pip.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-with-pip.yml b/.github/workflows/test-with-pip.yml index 3cf4ed304..095cbf54e 100644 --- a/.github/workflows/test-with-pip.yml +++ b/.github/workflows/test-with-pip.yml @@ -28,7 +28,7 @@ jobs: toolkit: 'pyside2' runs-on: ${{ matrix.os }} env: - ETS_TOOLKIT: ${{ matrix.toolkit }}.image + ETS_TOOLKIT: ${{ matrix.toolkit }}.${{ matrix.kiva-backend }} steps: - name: Check out uses: actions/checkout@v4 From 224b2232500ba22de3981d2030449f7a31afa47c Mon Sep 17 00:00:00 2001 From: Ioannis Tziakos Date: Sat, 19 Jul 2025 14:07:56 +0100 Subject: [PATCH 17/48] Add a composite action to set the ETS_TOOLKIT environment variable --- .github/actions/ets_toolkit/action.yml | 42 ++++++++++++++++++++++++++ .github/workflows/test-with-pip.yml | 6 ++-- 2 files changed, 45 insertions(+), 3 deletions(-) create mode 100644 .github/actions/ets_toolkit/action.yml diff --git a/.github/actions/ets_toolkit/action.yml b/.github/actions/ets_toolkit/action.yml new file mode 100644 index 000000000..a1d491907 --- /dev/null +++ b/.github/actions/ets_toolkit/action.yml @@ -0,0 +1,42 @@ +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 + run: 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 + run: 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 + run: 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 + run: echo "QT_API=pyside6" >> $GITHUB_ENV + shell: ${{ inputs.shell }} diff --git a/.github/workflows/test-with-pip.yml b/.github/workflows/test-with-pip.yml index 095cbf54e..8b4a35021 100644 --- a/.github/workflows/test-with-pip.yml +++ b/.github/workflows/test-with-pip.yml @@ -13,7 +13,7 @@ jobs: fail-fast: false matrix: os: ['ubuntu-latest', 'macos-latest', 'windows-latest'] - toolkit: ['pyside2', 'pyside6', 'pyqt5', 'wx'] + toolkit: ['pyside2', 'pyside6', 'pyqt5', 'wx', 'null'] kiva-backend: ['image'] python-version: ['3.10', '3.11'] exclude: @@ -27,8 +27,6 @@ jobs: - os: 'macos-latest' toolkit: 'pyside2' runs-on: ${{ matrix.os }} - env: - ETS_TOOLKIT: ${{ matrix.toolkit }}.${{ matrix.kiva-backend }} steps: - name: Check out uses: actions/checkout@v4 @@ -46,6 +44,8 @@ jobs: run: pip install ".[tests,${{ matrix.toolkit }}]" - name: Sanity check package version run: pip list + - run: ./.github/actions/ets_toolkit + toolkit: ${{ matrix.toolkit }} - name: Run chaco test suite (Linux) env: PYTHONFAULTHANDLER: 1 From a5dd6fc3780f0fc8597ca6eac65eac3e3c7a127e Mon Sep 17 00:00:00 2001 From: Ioannis Tziakos Date: Sat, 26 Jul 2025 10:37:47 +0100 Subject: [PATCH 18/48] Fix workflow --- .github/workflows/test-with-pip.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-with-pip.yml b/.github/workflows/test-with-pip.yml index 8b4a35021..898016f2e 100644 --- a/.github/workflows/test-with-pip.yml +++ b/.github/workflows/test-with-pip.yml @@ -45,7 +45,8 @@ jobs: - name: Sanity check package version run: pip list - run: ./.github/actions/ets_toolkit - toolkit: ${{ matrix.toolkit }} + with: + toolkit: ${{ matrix.toolkit }} - name: Run chaco test suite (Linux) env: PYTHONFAULTHANDLER: 1 From beefdd8b56c9c2bf272afbab1ed27aaad46ffd28 Mon Sep 17 00:00:00 2001 From: Ioannis Tziakos Date: Sat, 26 Jul 2025 10:40:09 +0100 Subject: [PATCH 19/48] more fixes --- .github/workflows/test-with-pip.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-with-pip.yml b/.github/workflows/test-with-pip.yml index 898016f2e..c4a19e149 100644 --- a/.github/workflows/test-with-pip.yml +++ b/.github/workflows/test-with-pip.yml @@ -44,7 +44,8 @@ jobs: run: pip install ".[tests,${{ matrix.toolkit }}]" - name: Sanity check package version run: pip list - - run: ./.github/actions/ets_toolkit + - name: Set ETS_TOOLKIT + uses: ./.github/actions/ets_toolkit with: toolkit: ${{ matrix.toolkit }} - name: Run chaco test suite (Linux) From efb38c3473a59a64215e43d7bf8640fc078127b9 Mon Sep 17 00:00:00 2001 From: Ioannis Tziakos Date: Sat, 26 Jul 2025 10:43:59 +0100 Subject: [PATCH 20/48] Fix ets_toolkit action --- .github/actions/ets_toolkit/action.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/actions/ets_toolkit/action.yml b/.github/actions/ets_toolkit/action.yml index a1d491907..1d48d511a 100644 --- a/.github/actions/ets_toolkit/action.yml +++ b/.github/actions/ets_toolkit/action.yml @@ -32,8 +32,9 @@ runs: shell: ${{ inputs.shell }} - name: PySide2 toolkit if: inputs.toolkit == 'pyside2' - run: echo "ETS_TOOLKIT=qt.${{ inputs.kiva }}" >> $GITHUB_ENV - run: echo "QT_API=pyside2" >> $GITHUB_ENV + 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' From c1a073e4d76ead1d28618abaf128191b83f21a3b Mon Sep 17 00:00:00 2001 From: Ioannis Tziakos Date: Sat, 26 Jul 2025 10:46:53 +0100 Subject: [PATCH 21/48] more fixes for the ets_toolkit action --- .github/actions/ets_toolkit/action.yml | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/.github/actions/ets_toolkit/action.yml b/.github/actions/ets_toolkit/action.yml index 1d48d511a..e0dc5f36a 100644 --- a/.github/actions/ets_toolkit/action.yml +++ b/.github/actions/ets_toolkit/action.yml @@ -22,13 +22,15 @@ runs: shell: ${{ inputs.shell }} - name: PyQT5 toolkit if: inputs.toolkit == 'pyqt5' - run: echo "ETS_TOOLKIT=qt.${{ inputs.kiva }}" >> $GITHUB_ENV - run: echo "QT_API=pyqt5" >> $GITHUB_ENV + 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 - run: echo "QT_API=pyqt6" >> $GITHUB_ENV + 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' @@ -38,6 +40,7 @@ runs: shell: ${{ inputs.shell }} - name: PySide6 toolkit if: inputs.toolkit == 'pyside6' - run: echo "ETS_TOOLKIT=qt.${{ inputs.kiva }}" >> $GITHUB_ENV - run: echo "QT_API=pyside6" >> $GITHUB_ENV + run: | + echo "ETS_TOOLKIT=qt.${{ inputs.kiva }}" >> $GITHUB_ENV + echo "QT_API=pyside6" >> $GITHUB_ENV shell: ${{ inputs.shell }} From 568dac26675f381b9969c93de3c3ac7cd0cf15ee Mon Sep 17 00:00:00 2001 From: Ioannis Tziakos Date: Sat, 26 Jul 2025 10:57:57 +0100 Subject: [PATCH 22/48] Update pip testing workflow - Set ETS_TOOLKIT early - Install wx dependencies on ubuntu when necessary - Install qt dependencies on ubuntu when necessary --- .github/workflows/test-with-pip.yml | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/.github/workflows/test-with-pip.yml b/.github/workflows/test-with-pip.yml index c4a19e149..2700bf76c 100644 --- a/.github/workflows/test-with-pip.yml +++ b/.github/workflows/test-with-pip.yml @@ -34,20 +34,24 @@ jobs: uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} + - name: Set ETS_TOOLKIT + uses: ./.github/actions/ets_toolkit + with: + toolkit: ${{ matrix.toolkit }} - name: Install build dependencies run: | python -m pip install --upgrade pip wheel - - name: Install Qt dependencies + - name: Install wxdependencies for Linux + run: | + 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' + if: matrix.os == 'ubuntu-latest' && startsWith(matrix.toolkit, 'py') - name: Install local packages run: pip install ".[tests,${{ matrix.toolkit }}]" - name: Sanity check package version run: pip list - - name: Set ETS_TOOLKIT - uses: ./.github/actions/ets_toolkit - with: - toolkit: ${{ matrix.toolkit }} - name: Run chaco test suite (Linux) env: PYTHONFAULTHANDLER: 1 From f151f5ed310dc513c35c8c966a215c72851c389b Mon Sep 17 00:00:00 2001 From: Ioannis Tziakos Date: Sat, 26 Jul 2025 11:04:48 +0100 Subject: [PATCH 23/48] Run apt update before installing packages --- .github/workflows/test-with-pip.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test-with-pip.yml b/.github/workflows/test-with-pip.yml index 2700bf76c..1fdd20335 100644 --- a/.github/workflows/test-with-pip.yml +++ b/.github/workflows/test-with-pip.yml @@ -43,6 +43,7 @@ jobs: python -m pip install --upgrade pip wheel - name: Install wxdependencies for Linux run: | + 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 From bd6499a65d392f01bc83a34b5ab305c06967d082 Mon Sep 17 00:00:00 2001 From: Ioannis Tziakos Date: Sat, 26 Jul 2025 11:22:56 +0100 Subject: [PATCH 24/48] Cache pip packages --- .github/workflows/test-with-pip.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test-with-pip.yml b/.github/workflows/test-with-pip.yml index 1fdd20335..c4ad85b3f 100644 --- a/.github/workflows/test-with-pip.yml +++ b/.github/workflows/test-with-pip.yml @@ -34,6 +34,7 @@ jobs: uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} + cache: 'pip' - name: Set ETS_TOOLKIT uses: ./.github/actions/ets_toolkit with: From 6e0c02bf49b92c49deb61d70132fb8e7b02adb79 Mon Sep 17 00:00:00 2001 From: Ioannis Tziakos Date: Sat, 26 Jul 2025 13:16:47 +0100 Subject: [PATCH 25/48] Add Cython to the build dependencies --- .github/workflows/test-with-pip.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-with-pip.yml b/.github/workflows/test-with-pip.yml index c4ad85b3f..9eb01d0e3 100644 --- a/.github/workflows/test-with-pip.yml +++ b/.github/workflows/test-with-pip.yml @@ -41,7 +41,7 @@ jobs: toolkit: ${{ matrix.toolkit }} - name: Install build dependencies run: | - python -m pip install --upgrade pip wheel + python -m pip install --upgrade pip wheel Cython - name: Install wxdependencies for Linux run: | sudo apt-get update From e1acf0ffe64121174cbb5a56025ac16675007cb4 Mon Sep 17 00:00:00 2001 From: Ioannis Tziakos Date: Sat, 26 Jul 2025 13:38:09 +0100 Subject: [PATCH 26/48] Update EDM testing --- .github/workflows/test-with-edm.yml | 66 +++++++++++------------------ ci/edm.yaml | 4 ++ ci/edmtool.py | 32 ++++++-------- 3 files changed, 41 insertions(+), 61 deletions(-) create mode 100644 ci/edm.yaml diff --git a/.github/workflows/test-with-edm.yml b/.github/workflows/test-with-edm.yml index 544a23e32..4ec0b98ea 100644 --- a/.github/workflows/test-with-edm.yml +++ b/.github/workflows/test-with-edm.yml @@ -7,61 +7,45 @@ name: Test with EDM on Python 3.8 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', '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 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 }} diff --git a/ci/edm.yaml b/ci/edm.yaml new file mode 100644 index 000000000..9773a5cba --- /dev/null +++ b/ci/edm.yaml @@ -0,0 +1,4 @@ +store_url: https://packages.enthought.com +repositories: + - enthought/free + - enthought/lgpl diff --git a/ci/edmtool.py b/ci/edmtool.py index dbd8ddb1f..fcecfa177 100644 --- a/ci/edmtool.py +++ b/ci/edmtool.py @@ -77,8 +77,7 @@ import click supported_combinations = { - '3.6': {'pyside2', 'pyqt5', 'null'}, - '3.8': {'pyside6', 'null'}, + '3.11': {'pyside6', 'pyqt6', 'wx', 'null'}, } dependencies = { @@ -111,10 +110,9 @@ github_url_fmt = "git+http://github.com/enthought/{0}.git#egg={0}" extra_dependencies = { - 'pyside2': {'pyside2'}, + 'pyqt6': {'pyqt6'}, 'pyside6': {'pyside6'}, - 'pyqt': {'pyqt'}, - 'pyqt5': {'pyqt5'}, + "wx": {'wxPython'}, 'null': set() } @@ -163,10 +161,9 @@ } environment_vars = { - 'pyside2': {'ETS_TOOLKIT': 'qt4', 'QT_API': 'pyside2'}, - 'pyside6': {'ETS_TOOLKIT': 'qt4', 'QT_API': 'pyside6'}, - 'pyqt': {'ETS_TOOLKIT': 'qt4', 'QT_API': 'pyqt'}, - 'pyqt5': {'ETS_TOOLKIT': 'qt4', 'QT_API': 'pyqt5'}, + 'pyside6': {'ETS_TOOLKIT': 'qt', 'QT_API': 'pyside6'}, + 'pyqt6': {'ETS_TOOLKIT': 'qt', 'QT_API': 'pyqt6'}, + 'wx': {'ETS_TOOLKIT': 'wx'}, 'null': {'ETS_TOOLKIT': 'null.image'}, } @@ -185,7 +182,7 @@ def cli(): @cli.command() -@click.option('--runtime', default='3.6') +@click.option('--runtime', default='3.11') @click.option('--toolkit', default='null') @click.option('--environment', default=None) @click.option( @@ -208,11 +205,6 @@ def install(runtime, toolkit, environment, editable, source): | ci_dependencies ) - if toolkit.startswith("pyside"): - addn_repositories = "--add-repository enthought/lgpl" - else: - addn_repositories = "" - # edm commands to setup the development environment commands = [ "edm environments create {environment} --force --version={runtime}", @@ -267,7 +259,7 @@ def install(runtime, toolkit, environment, editable, source): @cli.command() -@click.option('--runtime', default='3.6') +@click.option('--runtime', default='3.11') @click.option('--toolkit', default='null') @click.option('--environment', default=None) def test(runtime, toolkit, environment): @@ -295,7 +287,7 @@ def test(runtime, toolkit, environment): @cli.command() -@click.option('--runtime', default='3.6') +@click.option('--runtime', default='3.11') @click.option('--toolkit', default='null') @click.option('--environment', default=None) def cleanup(runtime, toolkit, environment): @@ -312,7 +304,7 @@ def cleanup(runtime, toolkit, environment): @cli.command() -@click.option('--runtime', default='3.6') +@click.option('--runtime', default='3.11') @click.option('--toolkit', default='null') def test_clean(runtime, toolkit): """ Run tests in a clean environment, cleaning up afterwards @@ -342,7 +334,7 @@ def update(runtime, toolkit, environment): @cli.command() -@click.option("--runtime", default="3.6", help="Python version to use") +@click.option("--runtime", default="3.11", help="Python version to use") @click.option("--toolkit", default="null", help="Toolkit and API to use") @click.option("--environment", default=None, help="EDM environment to use") def docs(runtime, toolkit, environment): @@ -417,7 +409,7 @@ def test_all(): @cli.command() -@click.option("--runtime", default="3.6", help="Python version to use") +@click.option("--runtime", default="3.11", help="Python version to use") @click.option("--toolkit", default="null", help="Toolkit and API to use") @click.option("--environment", default=None, help="EDM environment to use") def flake8(runtime, toolkit, environment): From 2fcd7413d64585e02440668ccb6ee6af43311a02 Mon Sep 17 00:00:00 2001 From: Ioannis Tziakos Date: Sat, 26 Jul 2025 13:39:47 +0100 Subject: [PATCH 27/48] minor cleanup --- ci/edmtool.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/edmtool.py b/ci/edmtool.py index fcecfa177..6a01e3cd3 100644 --- a/ci/edmtool.py +++ b/ci/edmtool.py @@ -208,7 +208,7 @@ def install(runtime, toolkit, environment, editable, source): # edm commands to setup the development environment commands = [ "edm environments create {environment} --force --version={runtime}", - "edm install -y -e {environment} {packages} " + addn_repositories, + "edm install -y -e {environment} {packages}", ("edm run -e {environment} -- pip install -r ci/requirements.txt" " --no-dependencies"), ] From 403200e134b742ce09a00431ad52e84015cac4a1 Mon Sep 17 00:00:00 2001 From: Ioannis Tziakos Date: Sat, 26 Jul 2025 13:40:17 +0100 Subject: [PATCH 28/48] disable pip install for now --- .github/workflows/test-with-pip.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-with-pip.yml b/.github/workflows/test-with-pip.yml index 9eb01d0e3..71a539041 100644 --- a/.github/workflows/test-with-pip.yml +++ b/.github/workflows/test-with-pip.yml @@ -3,7 +3,7 @@ name: Test with pip on: - pull_request: + #pull_request: # Make it possible to manually trigger the workflow workflow_dispatch: From 9072c4cff46b75a3f3996d3bd254c3db68cd2453 Mon Sep 17 00:00:00 2001 From: Ioannis Tziakos Date: Sat, 26 Jul 2025 13:43:29 +0100 Subject: [PATCH 29/48] Install swig only when need to build enable from source --- ci/edmtool.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ci/edmtool.py b/ci/edmtool.py index 6a01e3cd3..b9c0c59c4 100644 --- a/ci/edmtool.py +++ b/ci/edmtool.py @@ -91,8 +91,6 @@ "traitsui", "cython", "enable", - # Needed to install enable from source - "swig", } pypi_dependencies = {} @@ -229,6 +227,7 @@ def install(runtime, toolkit, environment, editable, source): "--environment {environment} --force " ) commands = [cmd_fmt + source_pkg for source_pkg in source_dependencies] + commands.append(f'edm install -e --environment {environment} swig') execute(commands, parameters) source_pkgs = [ github_url_fmt.format(pkg) for pkg in source_dependencies From e44fa6857ca0205cc890f87fe7437d9703639a11 Mon Sep 17 00:00:00 2001 From: Ioannis Tziakos Date: Sat, 26 Jul 2025 13:50:35 +0100 Subject: [PATCH 30/48] Update Python requirement --- pyproject.toml | 7 +------ setup.py | 1 + 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 40b9b8ad2..46901ad2a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,10 +1,5 @@ [build-system] -requires = [ - "cython", - "oldest-supported-numpy; python_version<'3.9'", - "numpy>=2; python_version>='3.9'", - "setuptools", - "wheel"] +requires = ["cython", "numpy>=2", "setuptools", "wheel"] build-backend = "setuptools.build_meta" [tool.cibuildwheel] diff --git a/setup.py b/setup.py index ed97584ab..1fc909309 100644 --- a/setup.py +++ b/setup.py @@ -367,4 +367,5 @@ def resolve_version(): packages=find_packages(), platforms=["Windows", "Linux", "Mac OS-X", "Unix", "Solaris"], zip_safe=False, + python_requires=">=3.9", ) From 4710aa24b6d40dd5be797dfc8e940aa2bed62c5f Mon Sep 17 00:00:00 2001 From: Ioannis Tziakos Date: Sat, 23 Aug 2025 11:12:21 +0100 Subject: [PATCH 31/48] Update build matrix for edm testing --- .github/workflows/test-with-edm.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-with-edm.yml b/.github/workflows/test-with-edm.yml index 4ec0b98ea..39d496aa7 100644 --- a/.github/workflows/test-with-edm.yml +++ b/.github/workflows/test-with-edm.yml @@ -18,7 +18,14 @@ jobs: matrix: toolkit: ['null', 'pyside6', 'wx'] runtime: ['3.11'] - os: ['ubuntu-latest', 'windows-latest', 'macos-latest'] + 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@v4 From c495bb9444e3410fe4d5a7b681239aad4f9963d6 Mon Sep 17 00:00:00 2001 From: Ioannis Tziakos Date: Sat, 23 Aug 2025 11:40:46 +0100 Subject: [PATCH 32/48] Install opengl on linux workers --- .github/workflows/test-with-edm.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/test-with-edm.yml b/.github/workflows/test-with-edm.yml index 39d496aa7..1b1736faf 100644 --- a/.github/workflows/test-with-edm.yml +++ b/.github/workflows/test-with-edm.yml @@ -38,6 +38,11 @@ jobs: 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 libglvnd + 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 From d3485ba2002f88bea3de15fd7c9b9e60540a2819 Mon Sep 17 00:00:00 2001 From: Ioannis Tziakos Date: Sat, 23 Aug 2025 11:45:49 +0100 Subject: [PATCH 33/48] Use ubuntu specific packages --- .github/workflows/test-with-edm.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-with-edm.yml b/.github/workflows/test-with-edm.yml index 1b1736faf..2d521eb1c 100644 --- a/.github/workflows/test-with-edm.yml +++ b/.github/workflows/test-with-edm.yml @@ -41,7 +41,7 @@ jobs: - name: Install opengl for Linux run: | sudo apt-get update - sudo apt-get install libglvnd + sudo apt-get install mesa-utils libglu1-mesa-dev freeglut3-dev mesa-common-dev if: matrix.os == 'ubuntu-latest' && matrix.toolkit != 'null' - name: Install click to the default EDM environment run: edm install -y wheel click coverage From caf208cb730c34020b7bf2246bd7c0e5d197b7bd Mon Sep 17 00:00:00 2001 From: Ioannis Tziakos Date: Sat, 23 Aug 2025 11:50:24 +0100 Subject: [PATCH 34/48] Cleanup linux packages to install --- .github/workflows/test-with-edm.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-with-edm.yml b/.github/workflows/test-with-edm.yml index 2d521eb1c..3afadc0bb 100644 --- a/.github/workflows/test-with-edm.yml +++ b/.github/workflows/test-with-edm.yml @@ -41,7 +41,7 @@ jobs: - name: Install opengl for Linux run: | sudo apt-get update - sudo apt-get install mesa-utils libglu1-mesa-dev freeglut3-dev mesa-common-dev + sudo apt-get install libglu1-mesa if: matrix.os == 'ubuntu-latest' && matrix.toolkit != 'null' - name: Install click to the default EDM environment run: edm install -y wheel click coverage From be7c0fe1ff90f9c516b718fbbd2b1750d4252dd4 Mon Sep 17 00:00:00 2001 From: Ioannis Tziakos Date: Sat, 23 Aug 2025 12:01:36 +0100 Subject: [PATCH 35/48] Add more packages --- .github/workflows/test-with-edm.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-with-edm.yml b/.github/workflows/test-with-edm.yml index 3afadc0bb..7d0c50713 100644 --- a/.github/workflows/test-with-edm.yml +++ b/.github/workflows/test-with-edm.yml @@ -41,7 +41,7 @@ jobs: - name: Install opengl for Linux run: | sudo apt-get update - sudo apt-get install libglu1-mesa + sudo apt-get install libglu1-mesa libegl-mesa0 if: matrix.os == 'ubuntu-latest' && matrix.toolkit != 'null' - name: Install click to the default EDM environment run: edm install -y wheel click coverage From 3f939e923fbdbf0ab1ae10525d1da3a09fa93111 Mon Sep 17 00:00:00 2001 From: Ioannis Tziakos Date: Sat, 23 Aug 2025 12:05:08 +0100 Subject: [PATCH 36/48] Install libglvn --- .github/workflows/test-with-edm.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-with-edm.yml b/.github/workflows/test-with-edm.yml index 7d0c50713..88a1f8dea 100644 --- a/.github/workflows/test-with-edm.yml +++ b/.github/workflows/test-with-edm.yml @@ -41,7 +41,7 @@ jobs: - name: Install opengl for Linux run: | sudo apt-get update - sudo apt-get install libglu1-mesa libegl-mesa0 + sudo apt-get install libglvnd0 if: matrix.os == 'ubuntu-latest' && matrix.toolkit != 'null' - name: Install click to the default EDM environment run: edm install -y wheel click coverage From 2d0abe71e33cf460f7bc337e86713225a55636da Mon Sep 17 00:00:00 2001 From: Ioannis Tziakos Date: Sat, 23 Aug 2025 12:07:39 +0100 Subject: [PATCH 37/48] start again --- .github/workflows/test-with-edm.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-with-edm.yml b/.github/workflows/test-with-edm.yml index 88a1f8dea..760c77373 100644 --- a/.github/workflows/test-with-edm.yml +++ b/.github/workflows/test-with-edm.yml @@ -41,7 +41,7 @@ jobs: - name: Install opengl for Linux run: | sudo apt-get update - sudo apt-get install libglvnd0 + sudo apt-get install libopengl0 if: matrix.os == 'ubuntu-latest' && matrix.toolkit != 'null' - name: Install click to the default EDM environment run: edm install -y wheel click coverage From 0e20094180aae50bf6acd3897bfe85f7842d3d18 Mon Sep 17 00:00:00 2001 From: Ioannis Tziakos Date: Sat, 23 Aug 2025 12:12:38 +0100 Subject: [PATCH 38/48] Add egl --- .github/workflows/test-with-edm.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-with-edm.yml b/.github/workflows/test-with-edm.yml index 760c77373..07d728cc6 100644 --- a/.github/workflows/test-with-edm.yml +++ b/.github/workflows/test-with-edm.yml @@ -41,7 +41,7 @@ jobs: - name: Install opengl for Linux run: | sudo apt-get update - sudo apt-get install libopengl0 + 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 From 7e7b1ad125ace5bc8b6343a17f49ba165e8a44ab Mon Sep 17 00:00:00 2001 From: Ioannis Tziakos Date: Sat, 23 Aug 2025 12:38:00 +0100 Subject: [PATCH 39/48] Disable downsample acceleration on macos See https://github.com/enthought/chaco/issues/918 --- chaco/downsample/lttb.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/chaco/downsample/lttb.py b/chaco/downsample/lttb.py index 7b8370c1f..81e87cb11 100644 --- a/chaco/downsample/lttb.py +++ b/chaco/downsample/lttb.py @@ -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 platofrm logger = logging.getLogger(__name__) @@ -20,7 +20,10 @@ logger.warning( "Can't import _lttb extension module, lttb downsampling will not work." ) - +if platofrm.system() == 'Darwin': + # Disabling acceleration on MacOS see + # https://github.com/enthought/chaco/issues/918 + _lttb = None def largest_triangle_three_buckets(points, n_buckets): """Apply the largest triangle three buckets algorithm to data points From 36a0f7c5ac2eafa0f87b76b907117bc04b4d97d4 Mon Sep 17 00:00:00 2001 From: Ioannis Tziakos Date: Sat, 23 Aug 2025 12:40:36 +0100 Subject: [PATCH 40/48] Fix workflow description --- .github/workflows/test-with-edm.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-with-edm.yml b/.github/workflows/test-with-edm.yml index 07d728cc6..19d06f6af 100644 --- a/.github/workflows/test-with-edm.yml +++ b/.github/workflows/test-with-edm.yml @@ -2,7 +2,7 @@ # 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 From 229f02801b46988197ecacd5e139614adbdc16a1 Mon Sep 17 00:00:00 2001 From: Ioannis Tziakos Date: Sat, 23 Aug 2025 12:41:31 +0100 Subject: [PATCH 41/48] Fix trypo --- chaco/downsample/lttb.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/chaco/downsample/lttb.py b/chaco/downsample/lttb.py index 81e87cb11..1d145500e 100644 --- a/chaco/downsample/lttb.py +++ b/chaco/downsample/lttb.py @@ -8,7 +8,7 @@ # # Thanks for using Enthought open source! import logging -import platofrm +import platform logger = logging.getLogger(__name__) @@ -20,7 +20,7 @@ logger.warning( "Can't import _lttb extension module, lttb downsampling will not work." ) -if platofrm.system() == 'Darwin': +if platform.system() == 'Darwin': # Disabling acceleration on MacOS see # https://github.com/enthought/chaco/issues/918 _lttb = None From 64d11ee53778323a48dc4b47bd296326d1d52151 Mon Sep 17 00:00:00 2001 From: Ioannis Tziakos Date: Sat, 23 Aug 2025 12:58:19 +0100 Subject: [PATCH 42/48] Skip tests if the lttb modules is not available --- chaco/downsample/tests/test_lttb.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/chaco/downsample/tests/test_lttb.py b/chaco/downsample/tests/test_lttb.py index 627dec9f8..963ba96e2 100644 --- a/chaco/downsample/tests/test_lttb.py +++ b/chaco/downsample/tests/test_lttb.py @@ -14,7 +14,7 @@ import numpy as np from numpy.testing import assert_array_equal, assert_almost_equal -from ..lttb import largest_triangle_three_buckets +from ..lttb import largest_triangle_three_buckets, _lttb TIMING_SETUP = """ @@ -28,6 +28,7 @@ """ +@unttitest.skipIf(_lttb is None, "operation is not available") class TestLargestTriangleThreeBuckets(unittest.TestCase): def test_timing(self): statement = "largest_triangle_three_buckets(a, n_buckets)" From 37a5dcc934a5bd59def443989d195bee21f2b986 Mon Sep 17 00:00:00 2001 From: Ioannis Tziakos Date: Sat, 23 Aug 2025 12:58:43 +0100 Subject: [PATCH 43/48] Enable pull request trigger for testing with pypi --- .github/workflows/test-with-pip.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-with-pip.yml b/.github/workflows/test-with-pip.yml index 71a539041..9eb01d0e3 100644 --- a/.github/workflows/test-with-pip.yml +++ b/.github/workflows/test-with-pip.yml @@ -3,7 +3,7 @@ name: Test with pip on: - #pull_request: + pull_request: # Make it possible to manually trigger the workflow workflow_dispatch: From 4d64ee67cf11a0d65fa7384d02e24c0247affa27 Mon Sep 17 00:00:00 2001 From: Ioannis Tziakos Date: Sat, 23 Aug 2025 13:02:12 +0100 Subject: [PATCH 44/48] Fix typo --- chaco/downsample/tests/test_lttb.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chaco/downsample/tests/test_lttb.py b/chaco/downsample/tests/test_lttb.py index 963ba96e2..a50c3d3cc 100644 --- a/chaco/downsample/tests/test_lttb.py +++ b/chaco/downsample/tests/test_lttb.py @@ -28,7 +28,7 @@ """ -@unttitest.skipIf(_lttb is None, "operation is not available") +@unittest.skipIf(_lttb is None, "operation is not available") class TestLargestTriangleThreeBuckets(unittest.TestCase): def test_timing(self): statement = "largest_triangle_three_buckets(a, n_buckets)" From 85dd70cee264ca58b1b032655ccaa5bf2463babd Mon Sep 17 00:00:00 2001 From: Ioannis Tziakos Date: Sat, 30 Aug 2025 10:09:19 +0100 Subject: [PATCH 45/48] Do not disable _lttb on macOS --- chaco/downsample/lttb.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/chaco/downsample/lttb.py b/chaco/downsample/lttb.py index 1d145500e..bbd84052a 100644 --- a/chaco/downsample/lttb.py +++ b/chaco/downsample/lttb.py @@ -20,10 +20,7 @@ logger.warning( "Can't import _lttb extension module, lttb downsampling will not work." ) -if platform.system() == 'Darwin': - # Disabling acceleration on MacOS see - # https://github.com/enthought/chaco/issues/918 - _lttb = None + def largest_triangle_three_buckets(points, n_buckets): """Apply the largest triangle three buckets algorithm to data points From 25a93c8c4c9d134af1b5bf9204b0ca698261615b Mon Sep 17 00:00:00 2001 From: Ioannis Tziakos Date: Sat, 30 Aug 2025 10:13:57 +0100 Subject: [PATCH 46/48] Update test_lttb - Update comment when skipped - Skip failing test on macOS --- chaco/downsample/tests/test_lttb.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/chaco/downsample/tests/test_lttb.py b/chaco/downsample/tests/test_lttb.py index a50c3d3cc..fe66649b7 100644 --- a/chaco/downsample/tests/test_lttb.py +++ b/chaco/downsample/tests/test_lttb.py @@ -10,6 +10,7 @@ import unittest import timeit +import platform import numpy as np from numpy.testing import assert_array_equal, assert_almost_equal @@ -28,7 +29,7 @@ """ -@unittest.skipIf(_lttb is None, "operation is not available") +@unittest.skipIf(_lttb is None, "extension is not compiled") class TestLargestTriangleThreeBuckets(unittest.TestCase): def test_timing(self): statement = "largest_triangle_three_buckets(a, n_buckets)" @@ -45,6 +46,9 @@ def test_timing(self): # 0.0112847280502 2016/10/18, 2.8 GHz 16 GB mid-2014 MacBook Pro self.assertLess(t, 0.1) + @unittest.skipIf( + platform.system() == 'Darwin', + 'Test fails on macOS; https://github.com/enthought/chaco/issues/918') def test_linear(self): a = np.empty(shape=(101, 2)) a[:, 0] = np.linspace(0.0, 10.0, 101) From 599b96e1eb6c9612a1feee31ab776c3d132df4a6 Mon Sep 17 00:00:00 2001 From: Ioannis Tziakos Date: Sat, 30 Aug 2025 10:36:22 +0100 Subject: [PATCH 47/48] Skip know failures for wx on macOS --- chaco/plots/tests/test_image_plot.py | 6 ++++-- chaco/tests/test_plot.py | 5 +++++ chaco/tools/tests/test_cursor_tool.py | 4 ++++ 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/chaco/plots/tests/test_image_plot.py b/chaco/plots/tests/test_image_plot.py index afed30367..8da0b4f79 100644 --- a/chaco/plots/tests/test_image_plot.py +++ b/chaco/plots/tests/test_image_plot.py @@ -9,10 +9,9 @@ # Thanks for using Enthought open source! import os - +import platform import tempfile from contextlib import contextmanager - import unittest import numpy as np @@ -207,6 +206,9 @@ def test_map_screen(self): # regression test for enthought/chaco#528 @unittest.skipIf(is_null, "Skip on 'null' toolkit") + @unittest.skipIf( + ETSConfig.toolkit == "wx" and platform.system() == 'Darwin', + "Test does not work correctly on wx; https://github.com/enthought/chaco/issues/919") def test_resize_to_zero(self): class TestResize(HasTraits): plot = Instance(Component) diff --git a/chaco/tests/test_plot.py b/chaco/tests/test_plot.py index 6d6f63c44..66cb1f5de 100644 --- a/chaco/tests/test_plot.py +++ b/chaco/tests/test_plot.py @@ -9,6 +9,7 @@ # Thanks for using Enthought open source! import unittest +import platform import numpy as np from numpy import arange, array @@ -171,6 +172,10 @@ def _plot_default(self): @unittest.skipIf(ETSConfig.toolkit == "null", "Skip on 'null' toolkit") class TestEmptyPlot(unittest.TestCase, EnableTestAssistant): + + @unittest.skipIf( + ETSConfig.toolkit == "wx" and platform.system() == 'Darwin', + "Test does not work correctly on wx; https://github.com/enthought/chaco/issues/919") def test_dont_crash_on_click(self): from traitsui.testing.api import UITester tester = UITester() diff --git a/chaco/tools/tests/test_cursor_tool.py b/chaco/tools/tests/test_cursor_tool.py index 7f7a443da..563b60f7f 100644 --- a/chaco/tools/tests/test_cursor_tool.py +++ b/chaco/tools/tests/test_cursor_tool.py @@ -8,6 +8,7 @@ # # Thanks for using Enthought open source! import unittest +import platform import numpy as np @@ -26,6 +27,9 @@ class TestCursorTool(unittest.TestCase, EnableTestAssistant): # regression test for enthought/chaco#289 @unittest.skipIf(ETSConfig.toolkit == "null", "Skip on 'null' toolkit") + @unittest.skipIf( + ETSConfig.toolkit == "wx" and platform.system() == 'Darwin', + "Test does not work correctly on wx; https://github.com/enthought/chaco/issues/919") def test_use_with_log_mappers(self): class TestCursor(HasTraits): plot = Instance(Plot) From e191287919a2afefd8628f0a7d705f01303034c7 Mon Sep 17 00:00:00 2001 From: Ioannis Tziakos Date: Sat, 30 Aug 2025 10:39:34 +0100 Subject: [PATCH 48/48] skip one more test --- chaco/tools/tests/test_cursor_tool.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/chaco/tools/tests/test_cursor_tool.py b/chaco/tools/tests/test_cursor_tool.py index 563b60f7f..6d1e23305 100644 --- a/chaco/tools/tests/test_cursor_tool.py +++ b/chaco/tools/tests/test_cursor_tool.py @@ -66,6 +66,9 @@ def _plot_default(self): ) @unittest.skipIf(ETSConfig.toolkit == "null", "Skip on 'null' toolkit") + @unittest.skipIf( + ETSConfig.toolkit == "wx" and platform.system() == 'Darwin', + "Test does not work correctly on wx; https://github.com/enthought/chaco/issues/919") def test_use_with_linear_mappers(self): class TestCursor(HasTraits): plot = Instance(Plot)