From 4b2b6eff5f3267d459049572919d06a1ac61f0e5 Mon Sep 17 00:00:00 2001 From: Alon Grinberg Dana Date: Wed, 30 Oct 2019 14:26:15 -0400 Subject: [PATCH 1/3] BugFix: Incorrect value assignment fixed in me.pyx --- rmgpy/pdep/me.pyx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rmgpy/pdep/me.pyx b/rmgpy/pdep/me.pyx index 91bc798bcc..928d52beea 100644 --- a/rmgpy/pdep/me.pyx +++ b/rmgpy/pdep/me.pyx @@ -104,7 +104,7 @@ cpdef generate_full_me_matrix(network, bint products=True): if k_ij[i, j, n_grains - 1,0] > 0 or k_ij[j, i, n_grains - 1,0] > 0: for r in range(n_grains): for s in range(n_j): - u, v = indices[i, r, s], v = indices[j,r,s] + u, v = indices[i, r, s], indices[j, r, s] if u > -1 and v > -1: me_mat[u, v] = k_ij[j, i, r, s] me_mat[u, u] -= k_ij[j, i, r, s] From baba24803324a0ad80f7f9916e3e228a0d1066dd Mon Sep 17 00:00:00 2001 From: Alon Grinberg Dana Date: Wed, 30 Oct 2019 14:26:41 -0400 Subject: [PATCH 2/3] Don't raise an error if a YAML file does not have all pdep attributed even if running a pdep job These attributes can be given in the Arkane species file, and this check crushes Arkane before loading additional species parameters. If these parameters are indeed missing, Arkane will crush anyway downstream. --- arkane/common.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/arkane/common.py b/arkane/common.py index 4231a852e5..d0eab37638 100644 --- a/arkane/common.py +++ b/arkane/common.py @@ -297,9 +297,6 @@ def load_yaml(self, path, label=None, pdep=False): self.imaginary_frequency = ScalarQuantity() self.imaginary_frequency.make_object(data=freq_data, class_dict=class_dict) - if pdep and not self.is_ts and (self.transport_data is None or self.energy_transfer_model is None): - raise ValueError('Transport data and an energy transfer model must be given if pressure-dependent ' - 'calculations are requested. Check file {0}'.format(path)) if pdep and not self.is_ts and self.smiles is None and self.adjacency_list is None \ and self.inchi is None and self.molecular_weight is None: raise ValueError('The molecular weight was not specified, and a structure was not given so it could ' From c9c1d2742ccbbdb95ce943a50ef74d6968865b6a Mon Sep 17 00:00:00 2001 From: Alon Grinberg Dana Date: Wed, 30 Oct 2019 14:28:15 -0400 Subject: [PATCH 3/3] PEP8 style change: `eqRatios` to `eq_ratios` in pdep/network.py Also fixes a bug where in cse.pyx we assign `eq_ratios = network.eq_ratios` (it is now correct) --- rmgpy/pdep/network.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/rmgpy/pdep/network.py b/rmgpy/pdep/network.py index 85f9142fe8..8b69886245 100644 --- a/rmgpy/pdep/network.py +++ b/rmgpy/pdep/network.py @@ -75,8 +75,8 @@ class Network(object): `active_j_rotor` ``True`` if the J-rotor is treated as active, ``False`` if treated as adiabatic `rmgmode` ``True`` if in RMG mode, ``False`` otherwise ----------------------- ---------------------------------------------------- - `eqRatios` An array containing concentration of each isomer and reactant channel present at equilibrium - `coll_freq` An array of the frequency of collision between + `eq_ratios` An array containing concentration of each isomer and reactant channel present at equilibrium + `coll_freq` An array of the frequency of collision between `Mcoll` Matrix of first-order rate coefficients for collisional population transfer between grains for each isomer `dens_states` 3D np array of stable configurations, number of grains, and number of J ======================= ==================================================== @@ -269,7 +269,7 @@ def calculate_rate_coefficients(self, Tlist, Plist, method, error_check=True): K[t, p, :, :] = self.K # Check that the k(T,P) values satisfy macroscopic equilibrium - eq_ratios = self.eqRatios + eq_ratios = self.eq_ratios for i in range(n_isom + n_reac): for j in range(i): Keq0 = K[t, p, j, i] / K[t, p, i, j] @@ -693,7 +693,7 @@ def calculate_microcanonical_rates(self): rxn.network_kinetics.get_rate_coefficient(temperature) # Determine the expected value of the equilibrium constant (Kc) - Keq_expected = self.eqRatios[prod] / self.eqRatios[reac] + Keq_expected = self.eq_ratios[prod] / self.eq_ratios[reac] # Determine the actual values of k(T) and Keq C0 = 1e5 / (constants.R * temperature) @@ -831,7 +831,7 @@ def calculate_equilibrium_ratios(self): if self.products[i].has_statmech() or self.products[i].has_thermo(): G = self.products[i].get_free_energy(temperature) eq_ratios[n_isom + n_reac + i] = math.exp(-G / constants.R / temperature) * conc ** (len(self.products[i].species) - 1) - self.eqRatios = eq_ratios + self.eq_ratios = eq_ratios return eq_ratios / np.sum(eq_ratios) def calculate_collision_model(self):