• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

vispy / vispy / 14448798101
75%

Build:
DEFAULT BRANCH: main
Ran 14 Apr 2025 02:56PM UTC
Jobs 4
Files 344
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

14 Apr 2025 02:53PM UTC coverage: 74.808% (+0.01%) from 74.796%
14448798101

push

github

web-flow
Fix bad_color handling and simplify some logic (#2662)

Unfortunately I still had unresolved issues when merging #2659. That's
what I get for not manually checking if things work one more time after
changing "obvious" things...

The main issue is that the order of application of clim, gamma and
bad_color were conflicting. By passing through NaN values to the
colormap (the last to be applied) fixed and simplified the code
significantly on the ImageVisual side.

Anyways, here's a functioning version. To test, use this snipped adapted
from #2620:

```py
import sys
from vispy import scene, app
from vispy.color import get_colormap
import numpy as np


canvas = scene.SceneCanvas(keys='interactive', bgcolor='white')
canvas.size = 600, 800
view = canvas.central_widget.add_view()

img_data = np.zeros((500, 500), np.float32)
for i in range(10):
    img_data[i*50:(i+1)*50, :] = i

img_data[:, 20:60] = np.nan

image = scene.visuals.Image(img_data, 
                            cmap='fire',
                            clim=[1, 8],
                            interpolation='cubic', 
                            texture_format='auto')
view.add(image)

view.camera = scene.cameras.TurntableCamera()
view.camera.set_range()
canvas.show()
```

The bad color can now be handled from the image visual directly:

```py
image.bad_color = (0, 1, 0, 1)
```

5824 of 10558 branches covered (55.16%)

43 of 43 new or added lines in 4 files covered. (100.0%)

24062 of 32165 relevant lines covered (74.81%)

2.45 hits per line

Jobs
ID Job ID Ran Files Coverage
1 run-2 - 14448798101.1 14 Apr 2025 03:06PM UTC 344
74.06
2 run-3 - 14448798101.2 14 Apr 2025 03:06PM UTC 344
51.89
3 run-4 - 14448798101.3 14 Apr 2025 03:06PM UTC 344
72.36
4 run-1 - 14448798101.4 14 Apr 2025 03:06PM UTC 344
46.62
Source Files on build 14448798101
  • Tree
  • List 344
  • Changed 5
  • Source Changed 0
  • Coverage Changed 5
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • af44e0f4 on github
  • Prev Build on main (#14401696871)
  • Next Build on main (#14467850922)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc