1
- """
1
+ '''
2
2
http://pymolwiki.org/index.php/spectrumany
3
3
4
4
(c) 2010 Thomas Holder
5
5
6
6
License: BSD-2-Clause
7
- """
7
+ '''
8
8
9
9
from __future__ import print_function
10
10
20
20
21
21
22
22
def spectrumany (expression , color_list , selection = '(all)' , minimum = None , maximum = None , quiet = 1 ):
23
- """
24
- DESCRIPTION
23
+ '''
24
+ DESCRIPTION
25
25
26
26
Define a color spectrum with as many color-stops as you like (at least 2).
27
27
28
- USAGE
28
+ USAGE
29
29
30
30
spectrumany expression, color_list [, selection [, minimum [, maximum ]]]
31
31
32
- ARGUMENTS
32
+ ARGUMENTS
33
33
34
34
expression = count, resi, b, q, or pc: respectively, atom count, residue
35
35
index, temperature factor, occupancy, or partial charge {default: count}
@@ -38,15 +38,15 @@ def spectrumany(expression, color_list, selection='(all)', minimum=None, maximum
38
38
39
39
... all other arguments like with `spectrum` command
40
40
41
- EXAMPLE
41
+ EXAMPLE
42
42
43
43
spectrumany count, forest green yellow white
44
44
spectrumany b, red yellow white, (polymer), maximum=100.0
45
45
46
- SEE ALSO
46
+ SEE ALSO
47
47
48
48
spectrum
49
- """
49
+ '''
50
50
quiet = int (quiet )
51
51
colors = color_list .split ()
52
52
if len (colors ) < 2 :
@@ -67,7 +67,7 @@ def spectrumany(expression, color_list, selection='(all)', minimum=None, maximum
67
67
68
68
if None in [minimum , maximum ]:
69
69
stored .e = list ()
70
- cmd .iterate (selection , 'stored.e.append(%s)' % minmax_expr )
70
+ cmd .iterate (selection , 'stored.e.append(%s)' % ( minmax_expr ) )
71
71
if minimum is None :
72
72
minimum = min (stored .e )
73
73
if maximum is None :
@@ -77,7 +77,7 @@ def spectrumany(expression, color_list, selection='(all)', minimum=None, maximum
77
77
print (' Spectrum: range (%.5f to %.5f)' % (minimum , maximum ))
78
78
79
79
if maximum == minimum :
80
- print ('no spectrum possible, only equal %s values' % expression )
80
+ print ('no spectrum possible, only equal %s values' % ( expression ) )
81
81
return
82
82
83
83
if expression in discrete_expr :
0 commit comments