Skip to content

Commit

Permalink
Merge pull request #377 from astrofrog/fix-broadcast-to
Browse files Browse the repository at this point in the history
Drop Python 3.7 and fix compatibility with latest glue-core versions
  • Loading branch information
astrofrog authored Feb 11, 2023
2 parents 0d29b45 + fee68c8 commit eb7076b
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 9 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci_workflows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ jobs:
envs: |
# Standard tests
- linux: py37-test
- linux: py38-test
- linux: py39-test-pyqt6
- linux: py310-test-dev-pyqt6
- linux: py39-test
- linux: py310-test-pyqt6
- linux: py311-test-dev-pyqt6
- macos: py38-test
- macos: py39-test-dev
Expand Down
9 changes: 5 additions & 4 deletions glue_vispy_viewers/volume/layer_artist.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import uuid
import weakref

import numpy as np

from matplotlib.colors import ColorConverter

from glue.core.data import Subset, Data
from glue.core.exceptions import IncompatibleAttribute
from glue.utils import broadcast_to
from glue.core.fixed_resolution_buffer import ARRAY_CACHE, PIXEL_CACHE
from .colors import get_translucent_cmap
from .layer_state import VolumeLayerState
Expand Down Expand Up @@ -45,7 +46,7 @@ def compute_fixed_resolution_buffer(self, bounds=None):
shape = [bound[2] for bound in bounds]

if self.layer_artist is None or self.viewer_state is None:
return broadcast_to(0, shape)
return np.broadcast_to(0, shape)

if isinstance(self.layer_artist.layer, Subset):
try:
Expand All @@ -56,7 +57,7 @@ def compute_fixed_resolution_buffer(self, bounds=None):
cache_id=self.layer_artist.id)
except IncompatibleAttribute:
self.layer_artist.disable_incompatible_subset()
return broadcast_to(0, shape)
return np.broadcast_to(0, shape)
else:
self.layer_artist.enable()
else:
Expand All @@ -67,7 +68,7 @@ def compute_fixed_resolution_buffer(self, bounds=None):
cache_id=self.layer_artist.id)
except IncompatibleAttribute:
self.layer_artist.disable('Layer data is not fully linked to reference data')
return broadcast_to(0, shape)
return np.broadcast_to(0, shape)
else:
self.layer_artist.enable()

Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ install_requires =
pillow
matplotlib
vispy>=0.9.1
python_requires = >=3.7
python_requires = >=3.8

[options.entry_points]
glue.plugins =
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tox]
envlist =
py{37,38,39,310}-{test}-{dev}{,-pyqt6}
py{38,39,310,311}-{test}-{dev}{,-pyqt6}
codestyle
requires = pip >= 18.0
setuptools >= 30.3.0
Expand Down

0 comments on commit eb7076b

Please sign in to comment.