ReactionMechanismGenerator / ARC

ARC - Automatic Rate Calculator
https://reactionmechanismgenerator.github.io/ARC/index.html
MIT License
42 stars 21 forks source link

Make sure that determining rotors twice doesn't cause an issue. #668

Closed kfir4444 closed 1 year ago

kfir4444 commented 1 year ago

Solves the issue that determining rotors twice may cause. For example:

n3_xyz = """N      -1.1997440839    -0.1610052059     0.0274738287
        H      -1.4016624407    -0.6229695533    -0.8487034080
        H      -0.0000018759     1.2861082773     0.5926077870
        N       0.0000008520     0.5651072858    -0.1124621525
        H      -1.1294692206    -0.8709078271     0.7537518889
        N       1.1997613019    -0.1609980472     0.0274604887
        H       1.1294795781    -0.8708998550     0.7537444446
        H       1.4015274689    -0.6230592706    -0.8487058662"""
spc = ARCSpecies(label='N3',
                               xyz=n3_xyz, multiplicity=1,
                               smiles='NNN',
                               directed_rotors = {"brute_force_opt":[["all"]]}) # taken from species_test.py
spc.determine_rotors()
print(spc.rotors_dict)
spc.determine_rotors()

outputs:

{0: {'pivots': [[1, 4], [4, 6]],
  'top': [[1, 2, 5], [6, 7, 8]],
  'scan': [[2, 1, 4, 6], [1, 4, 6, 7]],
  'torsion': [[1, 0, 3, 5], [0, 3, 5, 6]],
  'number_of_running_jobs': 0,
  'success': None,
  'invalidation_reason': '',
  'times_dihedral_set': 0,
  'trsh_counter': 0,
  'trsh_methods': [],
  'scan_path': '',
  'directed_scan_type': 'brute_force_opt',
  'directed_scan': {},
  'dimensions': 2,
  'original_dihedrals': [],
  'cont_indices': []}}

SpeciesError: The pivots [1, 2] do not represent a rotor in species N3. Valid rotor pivots are: [[[1, 4], [4, 6]], [1, 4], [4, 6]]
codecov[bot] commented 1 year ago

Codecov Report

Merging #668 (cc8b3c7) into main (04dabba) will increase coverage by 0.00%. The diff coverage is 100.00%.

@@           Coverage Diff           @@
##             main     #668   +/-   ##
=======================================
  Coverage   73.16%   73.17%           
=======================================
  Files          99       99           
  Lines       26414    26414           
  Branches     5534     5534           
=======================================
+ Hits        19327    19329    +2     
+ Misses       5719     5718    -1     
+ Partials     1368     1367    -1     
Flag Coverage Δ
unittests 73.17% <100.00%> (+<0.01%) :arrow_up:

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
arc/species/species.py 71.26% <100.00%> (ø)

... and 1 file with indirect coverage changes

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more