Skip to content

Commit f8597e9

Browse files
committed
combine the messy Cython declarations (and remove dupes) in reaction.py
1 parent 42855fd commit f8597e9

File tree

1 file changed

+18
-7
lines changed

1 file changed

+18
-7
lines changed

rmgpy/reaction.py

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -731,13 +731,24 @@ def get_equilibrium_constant(self, T, potential=0., type='Kc', surface_site_dens
731731
surface species, the `surface_site_density` is the assumed reference. For protons (H+),
732732
a reference concentration of 1000 mol/m^3 (1 mol/L) is assumed
733733
"""
734-
cython.declare(dGrxn=cython.double, K=cython.double, C0=cython.double, P0=cython.double)
735-
cython.declare(dN_gas=cython.int, dN_surf=cython.int, dGrxn=cython.double, K=cython.double, C0=cython.double, P0=cython.double)
736-
cython.declare(number_of_gas_reactants=cython.int, number_of_gas_products=cython.int)
737-
cython.declare(number_of_surface_reactants=cython.int, number_of_surface_products=cython.int)
738-
cython.declare(dN_surf=cython.int, dN_gas=cython.int, sites=cython.int)
739-
cython.declare(sigma_nu=cython.double)
740-
cython.declare(rectant=Species, product=Species, spcs=Species)
734+
cython.declare(
735+
dGrxn=cython.double,
736+
K=cython.double,
737+
C0=cython.double,
738+
P0=cython.double,
739+
dN_gas=cython.int,
740+
dN_surf=cython.int,
741+
sites=cython.int,
742+
number_of_gas_reactants=cython.int,
743+
number_of_gas_products=cython.int,
744+
number_of_surface_reactants=cython.int,
745+
number_of_surface_products=cython.int,
746+
sigma_nu=cython.double,
747+
rectant=Species,
748+
product=Species,
749+
spcs=Species,
750+
)
751+
cython.declare()
741752
# Use free energy of reaction to calculate Ka
742753
dGrxn = self.get_free_energy_of_reaction(T, potential)
743754
K = np.exp(-dGrxn / constants.R / T)

0 commit comments

Comments
 (0)