diff --git a/catmap/analyze/mechanism.py b/catmap/analyze/mechanism.py index 438f0ecf..8fe688ce 100755 --- a/catmap/analyze/mechanism.py +++ b/catmap/analyze/mechanism.py @@ -7,6 +7,9 @@ except ImportError: print('Warning! graphviz not imported.') from itertools import chain, product +import matplotlib as mpl +mpl.rcParams['text.usetex'] = True +import pylab as plt class MechanismAnalysis(MechanismPlot,ReactionModelWrapper,MapPlot): """ diff --git a/catmap/scalers/__init__.py b/catmap/scalers/__init__.py index 7a8c9fbd..f4ba18af 100755 --- a/catmap/scalers/__init__.py +++ b/catmap/scalers/__init__.py @@ -3,3 +3,4 @@ from .thermodynamic_scaler import * from .concentration_scaler import * from .null_scaler import * +from .lookup_scaler import * diff --git a/catmap/scalers/lookup_scaler.py b/catmap/scalers/lookup_scaler.py new file mode 100755 index 00000000..20fd44fa --- /dev/null +++ b/catmap/scalers/lookup_scaler.py @@ -0,0 +1,31 @@ +from .scaler_base import * + +class LookupScaler(ScalerBase): + """Scaler which looks up all available energies for a given surface.""" + + def get_electronic_energies(self,descriptors): + + assert descriptors in self.surface_names, "Descriptor must be a surface name for LookupScaler." + + surf_idx = self.surface_names.index(descriptors) + all_ads = self.adsorbate_names + self.transition_state_names + + E_dict = {} + gas_names = list(self.gas_names) + + for g in gas_names: + E_dict[g] = self.species_definitions[g]['formation_energy'] + + for sp in all_ads: + E = self.species_definitions[sp]['formation_energy'][surf_idx] + try: + E = float(E) + E_dict[sp] = E + except ValueError: #if the energy doesn't exist for a given surface it is stored as '-' + pass + + return E_dict + + def get_rxn_parameters(self,descriptors): + Gs = self.get_free_energies(descriptors) + return [Gs[d] for d in self.adsorbate_names+self.transition_state_names] diff --git a/requirements.txt b/requirements.txt index 188ce1ab..28db1022 100644 --- a/requirements.txt +++ b/requirements.txt @@ -6,3 +6,4 @@ ase == 3.17 ; python_version < "3.5" ase ; python_version >= "3.5" graphviz tqdm +pathlib