File: PYMOL-802.py

package info (click to toggle)
pymol 3.1.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 74,084 kB
  • sloc: cpp: 482,660; python: 89,328; ansic: 29,512; javascript: 6,792; sh: 84; makefile: 25
file content (29 lines) | stat: -rw-r--r-- 1,082 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
'''
PYMOL-802
Ray tracing is broken in 1.6.0

Solution: for edge sampling, if opaque background and result pixel
          is not opaque, fill it in with the background color by interpolating
          rgb values and setting alpha to 1

Test: as many combinations of settings for ray tracing to make sure alpha is correctly
      set in all pixels
'''

import os
from pymol import cmd, CmdException, testing, stored

class TestPYMOL802(testing.PyMOLTestCase):

    @testing.foreach((-1,'on',True), (1,'on',True), (0,'on',False), (-1,'off',False))
    def test802(self, ray_opaque_background, opaque_background, trans_check):
        cmd.load(self.datafile('1oky.pdb.gz'))
        cmd.hide()
        cmd.show('cartoon')
        cmd.set('ray_opaque_background', ray_opaque_background)
        cmd.set('opaque_background', opaque_background)
        if trans_check:
            self.assertImageHasNoTransparency(self.get_imagearray(width=100, height=100, ray=1))
        else:
            self.assertImageHasTransparency(self.get_imagearray(width=100, height=100, ray=1))