From 66c6fe7832217512cdcf283dc582de1bef8374ed Mon Sep 17 00:00:00 2001 From: Nave Danan Date: Thu, 17 Mar 2022 22:18:05 +0200 Subject: [PATCH 1/4] Fixed env specs --- environment.yml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/environment.yml b/environment.yml index 3fc55247..77a6a4b1 100644 --- a/environment.yml +++ b/environment.yml @@ -11,7 +11,7 @@ dependencies: - cairo - cairocffi - rmg::cantera >=2.3.0 - - cclib >=1.6 + - conda-forge::cclib >=1.6.3 - rmg::chemprop - codecov - coolprop @@ -33,11 +33,12 @@ dependencies: - mock - rmg::mopac - mpmath + - rmg::muq2 - networkx - nose - rmg::numdifftools - numpy >=1.15.4 - - openbabel + - conda-forge::openbabel >= 3 - paramiko >=2.6.0 - pandas - psutil @@ -59,4 +60,12 @@ dependencies: - scipy - sphinx - rmg::symmetry + - xlrd - xlwt + - anaconda::sphinx_rtd_theme + - anaconda::paramiko >=2.6.0 + - conda-forge::py3dmol >= 0.8.0 + - conda-forge::ase >=3.15.0 + - anaconda::ipython + - anaconda::sphinx + - conda-forge::qcelemental == 0.20.0 From 26d47ea0e9f4cdccd3e083875f59c1e6dbeb363c Mon Sep 17 00:00:00 2001 From: Nave Danan Date: Thu, 17 Mar 2022 22:20:38 +0200 Subject: [PATCH 2/4] Fixed condition in schema check_pdep_only_if_gas_phase --- t3/schema.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/t3/schema.py b/t3/schema.py index f690b13d..e0a44fb4 100644 --- a/t3/schema.py +++ b/t3/schema.py @@ -503,7 +503,7 @@ def check_model(cls, value): @validator('pdep') def check_pdep_only_if_gas_phase(cls, value, values): """RMG.pdep validator""" - if value is not None and values['reactors'] is not None: + if value is not None and 'reactors' in values and values['reactors'] is not None: reactor_types = set([reactor.type for reactor in values['reactors']]) if value is not None and not any(['gas' in reactor for reactor in reactor_types]): raise ValueError(f'A pdep section can only be specified for gas phase reactors, got: {reactor_types}') From d26780c24ece56edba1ba54303139a0ac07d5459 Mon Sep 17 00:00:00 2001 From: Nave Danan Date: Thu, 17 Mar 2022 22:25:02 +0200 Subject: [PATCH 3/4] Fixed T0 and P0 can be list or scalar --- t3/simulate/cantera_constantTP.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/t3/simulate/cantera_constantTP.py b/t3/simulate/cantera_constantTP.py index 836f0fb6..220c5629 100644 --- a/t3/simulate/cantera_constantTP.py +++ b/t3/simulate/cantera_constantTP.py @@ -209,6 +209,8 @@ def reinitialize_simulation(self, """ # assign initial conditions if V0 is None: + T0 = T0[0] if isinstance(T0, np.ndarray) else T0 + P0 = T0[0] if isinstance(T0, np.ndarray) else P0 self.model.TPX = T0, P0, X0 elif P0 is None: self.model.TDX = T0, 1 / V0, X0 @@ -394,6 +396,7 @@ def get_sa_coefficients(self): Returns: sa_dict (dict): a SA dictionary, whose structure is given in the docstring for T3/t3/main.py """ + sa_dict = {'kinetics': dict(), 'thermo': dict(), 'time': list()} for condition_data in self.all_data: From 6355f16214b8f900907724c9417889e32e0cda7e Mon Sep 17 00:00:00 2001 From: Nave Danan Date: Thu, 17 Mar 2022 22:27:41 +0200 Subject: [PATCH 4/4] Fixed in case of noneType species get speices via stracture --- t3/main.py | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/t3/main.py b/t3/main.py index 948a4a33..ccc08e2e 100755 --- a/t3/main.py +++ b/t3/main.py @@ -55,7 +55,13 @@ from arc.species import ARCSpecies from arc.species.converter import check_xyz_dict -from t3.common import PROJECTS_BASE_PATH, VALID_CHARS, delete_root_rmg_log, get_species_by_label, time_lapse +from t3.common import (PROJECTS_BASE_PATH, + VALID_CHARS, + delete_root_rmg_log, + get_rmg_species_from_a_species_dict, + get_species_by_label, + time_lapse, + ) from t3.logger import Logger from t3.schema import InputBase from t3.simulate.factory import simulate_factory @@ -304,6 +310,7 @@ def execute(self): # obtain the dictionary containing all SA coefficients for these species self.sa_dict = simulate_adapter.get_sa_coefficients() + # determine what needs to be calculated additional_calcs_required = self.determine_species_to_calculate() @@ -683,8 +690,12 @@ def determine_species_to_calculate(self) -> bool: for input_species in self.rmg['species']: if input_species['observable'] or input_species['SA_observable']: sa_observables_exist = True - if self.species_requires_refinement(species=get_species_by_label(input_species['label'], - self.rmg_species)): + species = get_species_by_label(input_species['label'], self.rmg_species) or \ + get_rmg_species_from_a_species_dict(input_species) + if species is None: + raise ValueError(f'Cannot find species\n{input_species} in the species list,' + f'and cannot create a species without a proper structure.') + if self.species_requires_refinement(species=species): species_keys.append(self.add_species( species=get_species_by_label(input_species['label'], self.rmg_species), reasons=['SA observable'], @@ -978,6 +989,8 @@ def species_requires_refinement(self, species: Species) -> bool: Returns: bool: Whether the species thermochemical properties should be calculated. ``True`` if they should be. """ + if species is None: + raise ValueError('Cannot process value None for argument species.') thermo_comment = species.thermo.comment.split('Solvation')[0] if self.get_species_key(species=species) is None \ and ('group additivity' in thermo_comment or '+ radical(' in thermo_comment):