orto 0.26.2__tar.gz → 0.27.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,12 +1,12 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: orto
3
- Version: 0.26.2
3
+ Version: 0.27.0
4
4
  Summary: A package to make life easier when performing Orca calculations.
5
- Home-page: https://gitlab.com/kragskow-group/orto
5
+ Home-page: https://orto.kragskow.group
6
6
  Author: Jon Kragskow
7
7
  Author-email: jgck20@bath.ac.uk
8
8
  Project-URL: Bug Tracker, https://gitlab.com/kragskow-group/orto/issues
9
- Project-URL: Documentation, https://www.kragskow.dev/orto/index.html
9
+ Project-URL: Documentation, https://orto.kragskow.group
10
10
  Classifier: Programming Language :: Python :: 3
11
11
  Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
12
12
  Classifier: Operating System :: OS Independent
@@ -0,0 +1 @@
1
+ __version__ = '0.27.0'
@@ -108,7 +108,7 @@ def extract_sf_energies_func(uargs):
108
108
  if len(all_data) > 1:
109
109
  f.write(f'# Section {it + 1:d}\n')
110
110
 
111
- f.write('State, Root, Multiplicity, Relative Energy (cm^-1)\n')
111
+ f.write('State, Root, Multiplicity, Relative Energy (cm⁻¹)\n')
112
112
 
113
113
  f.write(
114
114
  f'1, {data['root'][0]:d}, {data['multiplicity'][0]:d}, 0\n' # noqa
@@ -190,7 +190,7 @@ def extract_so_energies_func(uargs):
190
190
  if len(all_energies) > 1:
191
191
  f.write(f'# Section {it + 1:d}\n')
192
192
 
193
- f.write('State, Relative Energy (cm^-1)\n')
193
+ f.write('State, Relative Energy (cm⁻¹)\n')
194
194
 
195
195
  for eit, energy in enumerate(energies):
196
196
  f.write(
@@ -242,7 +242,7 @@ def extract_gmatrix_func(uargs, save=True):
242
242
  with open(out_name, 'w') as f:
243
243
  for it, data in enumerate(all_data):
244
244
  if len(all_data) > 1:
245
- f.write(f'Section {it + 1:d}')
245
+ f.write(f'Section {it + 1:d}\n')
246
246
  for key, val in data.items():
247
247
  f.write(f'{key}:\n')
248
248
  f.write(str(val).replace('[', '').replace(']', ''))
@@ -701,7 +701,7 @@ def distort_func(uargs):
701
701
  data = oe.FrequencyExtractor.extract(uargs.output_file)
702
702
 
703
703
  ut.cprint(
704
- 'Distorting along mode #{}: {: .2f} cm^-1'.format(
704
+ 'Distorting along mode #{}: {: .2f} cm⁻¹'.format(
705
705
  uargs.mode_number,
706
706
  data[0]['energy (cm^-1)'][uargs.mode_number]
707
707
  ),
@@ -907,7 +907,7 @@ def extract_freq_func(uargs, save=True):
907
907
  uargs.num = len(data[0]['energy (cm^-1)'])
908
908
 
909
909
  if not save:
910
- print('Frequencies (cm^-1) and intensities (km/mol)')
910
+ print('Frequencies (cm⁻¹) and intensities (km/mol)')
911
911
  for frq, inty in zip(
912
912
  data[0]['energy (cm^-1)'][:uargs.num],
913
913
  data[0]['IR Intensity (km mol^-1)'][:uargs.num]
@@ -919,7 +919,7 @@ def extract_freq_func(uargs, save=True):
919
919
  with open(out_name, 'w') as f:
920
920
  f.write(
921
921
  f'# Frequencies and intensities from {uargs.output_file}\n')
922
- f.write('# Frequency (cm^-1), Intensity (km/mol)\n')
922
+ f.write('# Frequency (cm⁻¹), Intensity (km/mol)\n')
923
923
  for frq, inty in zip(
924
924
  data[0]['energy (cm^-1)'][:uargs.num],
925
925
  data[0]['IR Intensity (km mol^-1)'][:uargs.num]
@@ -424,8 +424,8 @@ class AILFTOrbEnergyExtractor(extto.BetweenExtractor):
424
424
 
425
425
  class FrequencyExtractor(extto.BetweenExtractor):
426
426
  '''
427
- Extracts Vibrational mode energies, eigenvectors, and intensity \n
428
- information from output file
427
+ Extracts Vibrational mode energies, eigenvectors, intensities, \n
428
+ and irreps from output file
429
429
  '''
430
430
 
431
431
  # Regex Start Pattern
@@ -448,6 +448,7 @@ class FrequencyExtractor(extto.BetweenExtractor):
448
448
  - tx\n
449
449
  - ty\n
450
450
  - tz\n
451
+ - irrep\n
451
452
  and all values are numpy arrays.\n
452
453
  Dimensions are n_atoms*3, 1 for all arrays other than displacements.
453
454
  '''
@@ -477,37 +478,51 @@ class FrequencyExtractor(extto.BetweenExtractor):
477
478
  [float(val) for val in freq_pattern.findall(block)]
478
479
  )
479
480
 
481
+ # Check if symmetry is enabled by searching for
482
+ # "Point group" in block
483
+ if re.search(r'Point group', block):
484
+ symmetry = True
485
+ else:
486
+ symmetry = False
487
+
480
488
  n_atoms = len(wavenumbers) // 3
481
489
 
490
+ # Displacements section can be different depending on symmetry
491
+ if symmetry:
492
+ displacement_pattern = re.compile(
493
+ r'(?: +\d+){1,10}\s(?: +\d+\-[A-Za-z]+[0-9]*[A-Za-z]*){1,10}\s((?: +\d+ +(?: +-?\d\.\d{6}){1,10}\s)*)' # noqa
494
+ )
495
+ else:
496
+ displacement_pattern = re.compile(
497
+ r'(?: +\d+){1,6} +\s((?: +\d+ +(?: +-?\d\.\d{6}){1,6}\s)*)'
498
+ )
499
+
482
500
  # Extract Displacements
483
501
  disp_table = re.findall(
484
- r'((?: +\d+){1,6} +\s(?: +\d+ +(?: +-?\d\.\d{6}){1,6}\s)*)',
502
+ displacement_pattern,
485
503
  block
486
504
  )
487
505
 
488
506
  # and combine in a single dataframe
489
- master = pd.read_csv(
490
- StringIO(disp_table[0]),
491
- sep=r'\s{2,}',
492
- engine='python',
493
- index_col=0
494
- )
495
-
496
- for chunk in disp_table[1:]:
497
- _df = pd.read_csv(
498
- StringIO(chunk),
499
- sep=r'\s{2,}',
500
- engine='python',
501
- index_col=0
507
+ all_df = [
508
+ pd.read_csv(
509
+ StringIO(dt),
510
+ sep=r'\s+',
511
+ index_col=[0],
512
+ header=None,
513
+ skipinitialspace=True,
502
514
  )
503
- master = master.join(_df)
515
+ for dt in disp_table
516
+ ]
517
+ # Combine list of dataframe chunks into a single dataframe
518
+ combined_df = pd.concat(all_df, axis=1, join='outer')
504
519
 
505
520
  # convert to numpy array
506
- disp_table = master.to_numpy()
521
+ disp_array = combined_df.to_numpy()
507
522
  # and reshape
508
- disp_x = disp_table[0::3, :]
509
- disp_y = disp_table[1::3, :]
510
- disp_z = disp_table[2::3, :]
523
+ disp_x = disp_array[0::3, :]
524
+ disp_y = disp_array[1::3, :]
525
+ disp_z = disp_array[2::3, :]
511
526
  disp = np.zeros((n_atoms, n_atoms * 3, 3))
512
527
  disp[:, :, 0] = disp_x
513
528
  disp[:, :, 1] = disp_y
@@ -586,6 +601,25 @@ class FrequencyExtractor(extto.BetweenExtractor):
586
601
  # Convert to units of 1000 cm mol^-1
587
602
  eps = alin * 100
588
603
 
604
+ # Get irreducible representations
605
+ if symmetry:
606
+ irrep_pattern = re.compile(
607
+ r'(?: +\d+){1,10}\s((?: +\d+\-[A-Za-z]+[0-9]*[A-Za-z]*){1,10}\s)(?: +\d+ +(?: +-?\d\.\d{6}){1,10}\s)*' # noqa
608
+ )
609
+ irrep_blocks = re.findall(
610
+ irrep_pattern,
611
+ block
612
+ )
613
+ irreps = np.concatenate([
614
+ [
615
+ irrep
616
+ for irrep in iblock.replace('\n','').split()
617
+ ]
618
+ for iblock in irrep_blocks
619
+ ])
620
+ else:
621
+ irreps = np.array([''] * len(wavenumbers))
622
+
589
623
  data = {
590
624
  'energy (cm^-1)': wavenumbers,
591
625
  'displacements': disp,
@@ -594,7 +628,8 @@ class FrequencyExtractor(extto.BetweenExtractor):
594
628
  't2 (a.u.^2)': t2,
595
629
  'tx (a.u.)': tx,
596
630
  'ty (a.u.)': ty,
597
- 'tz (a.u.)': tz
631
+ 'tz (a.u.)': tz,
632
+ 'irrep': irreps
598
633
  }
599
634
 
600
635
  return data
@@ -1,12 +1,12 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: orto
3
- Version: 0.26.2
3
+ Version: 0.27.0
4
4
  Summary: A package to make life easier when performing Orca calculations.
5
- Home-page: https://gitlab.com/kragskow-group/orto
5
+ Home-page: https://orto.kragskow.group
6
6
  Author: Jon Kragskow
7
7
  Author-email: jgck20@bath.ac.uk
8
8
  Project-URL: Bug Tracker, https://gitlab.com/kragskow-group/orto/issues
9
- Project-URL: Documentation, https://www.kragskow.dev/orto/index.html
9
+ Project-URL: Documentation, https://orto.kragskow.group
10
10
  Classifier: Programming Language :: Python :: 3
11
11
  Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
12
12
  Classifier: Operating System :: OS Independent
@@ -8,7 +8,7 @@ Please see the `orto` documentation for more details.
8
8
 
9
9
  # DO NOT EDIT THIS NUMBER!
10
10
  # IT IS AUTOMATICALLY CHANGED BY python-semantic-release
11
- __version__ = '0.26.2'
11
+ __version__ = '0.27.0'
12
12
 
13
13
  setuptools.setup(
14
14
  name='orto',
@@ -18,10 +18,10 @@ setuptools.setup(
18
18
  description='A package to make life easier when performing Orca calculations.', # noqa
19
19
  long_description=long_description,
20
20
  long_description_content_type='text/markdown',
21
- url='https://gitlab.com/kragskow-group/orto',
21
+ url='https://orto.kragskow.group',
22
22
  project_urls={
23
23
  'Bug Tracker': 'https://gitlab.com/kragskow-group/orto/issues',
24
- 'Documentation': 'https://www.kragskow.dev/orto/index.html'
24
+ 'Documentation': 'https://orto.kragskow.group'
25
25
  },
26
26
  classifiers=[
27
27
  'Programming Language :: Python :: 3',
@@ -1 +0,0 @@
1
- __version__ = '0.26.2'
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes