1
- from .analysis_base import *
1
+ from .analysis_base import ScalingPlot , ReactionModelWrapper
2
2
3
- class ScalingAnalysis (ScalingPlot ,ReactionModelWrapper ):
3
+
4
+ class ScalingAnalysis (ScalingPlot , ReactionModelWrapper ):
4
5
"""
5
6
.. todo:: __doc__
6
7
"""
7
- def __init__ (self ,reaction_model ):
8
+ def __init__ (self , reaction_model ):
8
9
self ._rxm = reaction_model
9
10
self .scaling_mode = 'linear'
10
- ScalingPlot .__init__ (self ,self .descriptor_names ,
11
- self .descriptor_dict ,self .surface_names ,
12
- self .parameter_dict ,
13
- self .plotter_scaling_function ,
14
- self .plotter_x_axis_function )
11
+ ScalingPlot .__init__ (self , self .descriptor_names ,
12
+ self .descriptor_dict , self .surface_names ,
13
+ self .parameter_dict ,
14
+ self .plotter_scaling_function ,
15
+ self .plotter_x_axis_function )
15
16
16
- def plotter_scaling_function (self ,descriptors ,** kwargs ):
17
+ def plotter_scaling_function (self , descriptors , ** kwargs ):
17
18
"""
18
19
.. todo:: __doc__
19
20
"""
20
21
descriptors = list (descriptors )
21
- return self .scaler .get_electronic_energies (descriptors ,** kwargs )
22
+ return self .scaler .get_electronic_energies (descriptors , ** kwargs )
22
23
23
- def plotter_x_axis_function (self ,descriptors ,** kwargs ):
24
+ def plotter_x_axis_function (self , descriptors , ** kwargs ):
24
25
"""
25
26
.. todo:: __doc__
26
27
"""
@@ -32,24 +33,24 @@ def plotter_x_axis_function(self,descriptors,**kwargs):
32
33
self .coefficient_matrix = C
33
34
else :
34
35
C = self .coefficient_matrix
35
- for ads ,c in zip (
36
- self .adsorbate_names + self .transition_state_names ,C ):
36
+ for ads , c in zip (
37
+ self .adsorbate_names + self .transition_state_names , C ):
37
38
x_dict [ads ] = sum (
38
- [c [i ]* a for i ,a in enumerate (descriptors )]) + c [- 1 ]
39
+ [c [i ]* a for i , a in enumerate (descriptors )]) + c [- 1 ]
39
40
lab = ''
40
- for i ,a in enumerate (self .descriptor_names ):
41
- c_print = round (c [i ],self .descriptor_decimal_precision )
41
+ for i , a in enumerate (self .descriptor_names ):
42
+ c_print = round (c [i ], self .descriptor_decimal_precision )
42
43
if c_print != 0 :
43
44
lab += str (c_print )+ '*$E_{' + str (a )+ '}$+'
44
- const = round (c [- 1 ],self .descriptor_decimal_precision )
45
+ const = round (c [- 1 ], self .descriptor_decimal_precision )
45
46
if const > 0 :
46
47
lab += '+' + str (const )
47
48
elif const < 0 :
48
49
lab += '-' + str (- const )
49
- lab = lab .replace ('++' ,'+' )
50
- lab = lab .replace ('+-' ,'-' )
50
+ lab = lab .replace ('++' , '+' )
51
+ lab = lab .replace ('+-' , '-' )
51
52
labels [ads ] = lab
52
- return x_dict ,labels
53
+ return x_dict , labels
53
54
54
55
def get_error (self ):
55
56
"""
@@ -58,4 +59,3 @@ def get_error(self):
58
59
if not self .scaling_error :
59
60
self .plot (save = False )
60
61
return self .scaling_error
61
-
0 commit comments