<jupyter_start><jupyter_text>Check The Rotor troubleshooting<jupyter_code>import os
import subprocess

import pandas as pd

from arc.job.trsh import scan_quality_check, trsh_scan_job, determine_ess_status
from arc.parser import parse_scan_args, parse_1d_scan_energies, parse_geometry, parse_scan_conformers
from arc.plotter import plot_1d_rotor_scan

from arc.species.converter import xyz_to_xyz_file_format

%matplotlib inline
%load_ext autoreload
%autoreload 2
path = '/Users/xiaorui/Dropbox/RMG/Co-OPTIMA/Hyperboost/Weird rotor/input.log'<jupyter_output><empty_output><jupyter_text>1.Check Convergence'done' means normally converged<jupyter_code>determine_ess_status(path, '', 'scan', 'gaussian')<jupyter_output><empty_output><jupyter_text>2. Scan Quality check`False` means nothing bad, and `True` means something wrong and needs troubleshooting<jupyter_code>scan_args = parse_scan_args(path)
energies, angles = parse_1d_scan_energies(path) 
quality = scan_quality_check('', scan_args['scan'][1:-1], energies, scan_args['step_size'], [], path)
print('scan: ', scan_args['scan'], 'scan_res:', scan_args['step_size'])
quality<jupyter_output><empty_output><jupyter_text>3. Scan troubleshooting<jupyter_code>if 'freeze' in quality[3]:
    species_scan_lists = [scan_args['scan']]
    solution = trsh_scan_job('', scan_args['step_size'], scan_args['scan'], species_scan_lists, quality[3], path)
    print(solution[0])

if 'change conformer' in quality[3]:
    xyz = parse_geometry(path)
    new_xyz = quality[3]['change conformer']
    print('original:')
    print(xyz_to_xyz_file_format(xyz))
    print('New')
    print(xyz_to_xyz_file_format(new_xyz))<jupyter_output><empty_output><jupyter_text>4. Check curve<jupyter_code>plot_1d_rotor_scan(angles, energies)<jupyter_output><empty_output><jupyter_text>5. Open MoldenExit molden either in a normal way (skull button) or stop the kernel<jupyter_code>cmd = ['/Users/xiaorui/Apps/molden/molden', f'{path}']
subprocess.Popen(cmd)<jupyter_output><empty_output><jupyter_text>6. Look at values of internal coordinates<jupyter_code>scan_conformers = parse_scan_conformers(path)<jupyter_output><empty_output><jupyter_text>you can apply `DataFrame` type filter to search for internal coordinates values, here shows an example<jupyter_code>scan_conformers[(scan_conformers['type'] == 'D') & (scan_conformers['scan'] == False)].loc[:, ['atoms', 0] + list(range(7,46))]<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.12351251538777185, 'fraction_numerical': 0.009027492819039803, 'mean_word_length': 9.074380165289256, 'pattern_counts': {'":': 0, '<': 33, '<?xml version=': 0, '>': 33, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '8', 'dir': 'jupyter-structured-clean-dedup', 'id': '12534', 'license': 'MIT', 'n_tokens_mistral': 902, 'n_tokens_neox': 868, 'n_words': 153, 'path': 'ipython/Check The Rotor Troubleshooting.ipynb', 'repo_name': 'xiaoruiDong/easy_rmg_model', 'size': '2437'}