Skip to content

Commit

Permalink
some pep8 style
Browse files Browse the repository at this point in the history
  • Loading branch information
mhangaard committed Dec 4, 2018
1 parent 2420344 commit 46f3664
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 21 deletions.
1 change: 1 addition & 0 deletions catmap/analyze/matrix_map.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from .analysis_base import *
from .vector_map import *


class MatrixMap(VectorMap):
"""
.. todo:: __doc__
Expand Down
42 changes: 21 additions & 21 deletions catmap/analyze/scaling.py
Original file line number Diff line number Diff line change
@@ -1,26 +1,27 @@
from .analysis_base import *
from .analysis_base import ScalingPlot, ReactionModelWrapper

class ScalingAnalysis(ScalingPlot,ReactionModelWrapper):

class ScalingAnalysis(ScalingPlot, ReactionModelWrapper):
"""
.. todo:: __doc__
"""
def __init__(self,reaction_model):
def __init__(self, reaction_model):
self._rxm = reaction_model
self.scaling_mode = 'linear'
ScalingPlot.__init__(self,self.descriptor_names,
self.descriptor_dict,self.surface_names,
self.parameter_dict,
self.plotter_scaling_function,
self.plotter_x_axis_function)
ScalingPlot.__init__(self, self.descriptor_names,
self.descriptor_dict, self.surface_names,
self.parameter_dict,
self.plotter_scaling_function,
self.plotter_x_axis_function)

def plotter_scaling_function(self,descriptors,**kwargs):
def plotter_scaling_function(self, descriptors, **kwargs):
"""
.. todo:: __doc__
"""
descriptors = list(descriptors)
return self.scaler.get_electronic_energies(descriptors,**kwargs)
return self.scaler.get_electronic_energies(descriptors, **kwargs)

def plotter_x_axis_function(self,descriptors,**kwargs):
def plotter_x_axis_function(self, descriptors, **kwargs):
"""
.. todo:: __doc__
"""
Expand All @@ -32,24 +33,24 @@ def plotter_x_axis_function(self,descriptors,**kwargs):
self.coefficient_matrix = C
else:
C = self.coefficient_matrix
for ads,c in zip(
self.adsorbate_names+self.transition_state_names,C):
for ads, c in zip(
self.adsorbate_names+self.transition_state_names, C):
x_dict[ads] = sum(
[c[i]*a for i,a in enumerate(descriptors)]) + c[-1]
[c[i]*a for i, a in enumerate(descriptors)]) + c[-1]
lab = ''
for i,a in enumerate(self.descriptor_names):
c_print = round(c[i],self.descriptor_decimal_precision)
for i, a in enumerate(self.descriptor_names):
c_print = round(c[i], self.descriptor_decimal_precision)
if c_print != 0:
lab += str(c_print)+'*$E_{'+str(a)+'}$+'
const = round(c[-1],self.descriptor_decimal_precision)
const = round(c[-1], self.descriptor_decimal_precision)
if const > 0:
lab += '+' + str(const)
elif const < 0:
lab += '-' + str(-const)
lab = lab.replace('++','+')
lab = lab.replace('+-','-')
lab = lab.replace('++', '+')
lab = lab.replace('+-', '-')
labels[ads] = lab
return x_dict,labels
return x_dict, labels

def get_error(self):
"""
Expand All @@ -58,4 +59,3 @@ def get_error(self):
if not self.scaling_error:
self.plot(save=False)
return self.scaling_error

1 change: 1 addition & 0 deletions catmap/analyze/vector_map.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from .analysis_base import *
from string import Template


class VectorMap(MapPlot, ReactionModelWrapper):
"""
.. todo:: __doc__
Expand Down

0 comments on commit 46f3664

Please sign in to comment.