From 4e4bd1f96a18aca0c48ee7182eae490b0c05a858 Mon Sep 17 00:00:00 2001 From: avcopan Date: Tue, 7 Sep 2021 17:05:33 -0400 Subject: [PATCH] Fix linting issues --- automol/geom/_extra.py | 4 ++-- automol/inchi/_conv.py | 2 +- automol/par.py | 6 +++--- automol/reac/_enum.py | 9 ++++++--- automol/reac/_scan.py | 2 +- automol/reac/_zmat.py | 2 +- automol/rotor/_rotor.py | 3 ++- automol/tests/test_reac.py | 8 ++++---- phydat/phycon.py | 6 +++--- 9 files changed, 23 insertions(+), 19 deletions(-) diff --git a/automol/geom/_extra.py b/automol/geom/_extra.py index abd7b915..fb6e2635 100644 --- a/automol/geom/_extra.py +++ b/automol/geom/_extra.py @@ -254,10 +254,10 @@ def is_unique(geo, geo_lst, check_dct=None): # def hydrogen_bonded_structure(geo, grxn=None, # dist_thresh=4.55, angle_thresh=1.92): -def hydrogen_bonded_structure(geo, grxn=None, - dist_thresh=4.92, angle_thresh=1.92): # def hydrogen_bonded_structure(geo, grxn=None, # dist_thresh=5.3, angle_thresh=1.92): +def hydrogen_bonded_structure(geo, grxn=None, + dist_thresh=4.92, angle_thresh=1.92): """ Compare bond lengths in structure to determine if there is a hydrogen bond diff --git a/automol/inchi/_conv.py b/automol/inchi/_conv.py index 1d480ca3..3cf6db48 100644 --- a/automol/inchi/_conv.py +++ b/automol/inchi/_conv.py @@ -186,7 +186,7 @@ def add_stereo(ich): :rtype: str """ geo = geometry(ich) - print ('geometry test:',automol.geom.string(geo)) + print('geometry test:', automol.geom.string(geo)) ich = automol.geom.inchi(geo, stereo=True) return ich diff --git a/automol/par.py b/automol/par.py index 1f954ac8..d2e78285 100644 --- a/automol/par.py +++ b/automol/par.py @@ -102,9 +102,9 @@ def string(rxn_class): cls_str = typ(rxn_class) out_str = '' - for string in (isc_str, radrad_str, spin_str, cls_str): - if string: - out_str += '{} '.format(string) + for str_ in (isc_str, radrad_str, spin_str, cls_str): + if str_: + out_str += '{} '.format(str_) return out_str.strip() diff --git a/automol/reac/_enum.py b/automol/reac/_enum.py index 5844e50a..5473f7e5 100644 --- a/automol/reac/_enum.py +++ b/automol/reac/_enum.py @@ -100,7 +100,10 @@ def hydrogen_migrations(rct_gras, viable_only=True): # 2. Homolytic scissions -def homolytic_scissions(rct_gras, viable_only=True): +# AVC comment: replaced commented-out if statement by changing the default here +# to False. Is the viability check broken for this case? +# def homolytic_scissions(rct_gras, viable_only=True): +def homolytic_scissions(rct_gras, viable_only=False): """ find all possible homolytic scission reactions for these reactants :param rct_gras: graphs for the reactants, without stereo and without @@ -149,8 +152,8 @@ def homolytic_scissions(rct_gras, viable_only=True): prds_keys=list(map(atom_keys, prd_gras)), )) # filter removes all reactions - # if viable_only: - # rxns = filter_viable_reactions(rxns) + if viable_only: + rxns = filter_viable_reactions(rxns) return ts_unique(rxns) diff --git a/automol/reac/_scan.py b/automol/reac/_scan.py index 366abcc0..ca99aa85 100644 --- a/automol/reac/_scan.py +++ b/automol/reac/_scan.py @@ -233,7 +233,7 @@ def elimination_grid(zrxn, zma, npoints=(7, 5)): grid1 = numpy.linspace(r1min, r1max, npoints1) grid2 = numpy.linspace(r2min, r2max, npoints2) - + print(automol.zmat.string(zma)) print(frm_name, frm_bnd_len) print(grid1) diff --git a/automol/reac/_zmat.py b/automol/reac/_zmat.py index f6b2aaa6..30aa1306 100644 --- a/automol/reac/_zmat.py +++ b/automol/reac/_zmat.py @@ -385,5 +385,5 @@ def _zma_names(zma, bnd_keys): frm_bnd_keys = ts.forming_bond_keys(zrxn.forward_ts_graph) brk_bnd_keys = ts.breaking_bond_keys(zrxn.forward_ts_graph) - + return (_zma_names(zma, frm_bnd_keys), _zma_names(zma, brk_bnd_keys)) diff --git a/automol/rotor/_rotor.py b/automol/rotor/_rotor.py index a69356ee..2cce5eed 100644 --- a/automol/rotor/_rotor.py +++ b/automol/rotor/_rotor.py @@ -119,7 +119,8 @@ def grids(rotor_lst, for rotor in rotor_lst: rotor_grids = () for torsion in rotor: - print('rotor grids input test:', torsion.zma, torsion.name, span, torsion.symmetry, increment) + print('rotor grids input test:', torsion.zma, torsion.name, + span, torsion.symmetry, increment) rotor_grids += ( automol.pot.grid( torsion.zma, torsion.name, diff --git a/automol/tests/test_reac.py b/automol/tests/test_reac.py index dbe57105..93d2efb1 100644 --- a/automol/tests/test_reac.py +++ b/automol/tests/test_reac.py @@ -4,7 +4,7 @@ import numpy import automol from automol.par import ReactionClass -from automol.graph import ts +# from automol.graph import ts SUBSTITUTION_RXN_STR = """ reaction class: substitution @@ -894,8 +894,8 @@ def _check_reaction(rxn_obj, # print(automol.zmat.string(zma)) # print(zrxn) - frm_bnd_keys = ts.forming_bond_keys(zrxn.forward_ts_graph) - brk_bnd_keys = ts.breaking_bond_keys(zrxn.forward_ts_graph) + # frm_bnd_keys = ts.forming_bond_keys(zrxn.forward_ts_graph) + # brk_bnd_keys = ts.breaking_bond_keys(zrxn.forward_ts_graph) # print('keys') # print(frm_bnd_keys) # print(brk_bnd_keys) @@ -918,7 +918,7 @@ def _check_reaction(rxn_obj, gbnd_keys = automol.reac.rotational_bond_keys(grxn) assert len(gbnd_keys) == len(bnd_keys) - zaxes = sorted(map(sorted, bnd_keys)) + # zaxes = sorted(map(sorted, bnd_keys)) axes = sorted(map(sorted, gbnd_keys)) tors_symms = [automol.reac.rotational_symmetry_number(grxn, *a) for a in axes] diff --git a/phydat/phycon.py b/phydat/phycon.py index 1f0c9df5..a7c46962 100644 --- a/phydat/phycon.py +++ b/phydat/phycon.py @@ -15,9 +15,9 @@ SOL = (qcc.get('speed of light in vacuum') * qcc.conversion_factor('meter / second', 'bohr hartree / h')) SOLMS = qcc.get('speed of light in vacuum') -KB = qcc.get('kb') # The Boltzmann constant (JK$^{-1}$) -H = qcc.get('h') # The Planck constant (Js) -HBAR = qcc.get('hbar') # The Planck constant (Js) over 2pi +KB = qcc.get('kb') # The Boltzmann constant (JK$^{-1}$) +H = qcc.get('h') # The Planck constant (Js) +HBAR = qcc.get('hbar') # The Planck constant (Js) over 2pi # Energy Conversion factors KCAL2CAL = qcc.conversion_factor('kcal/mol', 'cal/mol')