orto 1.0.0__py3-none-any.whl → 1.0.1__py3-none-any.whl

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.
orto/__version__.py CHANGED
@@ -1 +1 @@
1
- __version__ = '1.0.0'
1
+ __version__ = '1.0.1'
orto/cli.py CHANGED
@@ -1,23 +1,21 @@
1
1
  import argparse
2
2
  import xyz_py as xyzp
3
- import xyz_py.atomic as atomic
4
- import matplotlib.pyplot as plt
5
- import matplotlib as mpl
3
+ from xyz_py.atomic import elements as atomic_elements
6
4
  import sys
7
5
  import pathlib
8
6
  import os
9
7
  import copy
10
8
  import subprocess
11
- import pandas as pd
9
+ from pandas import read_csv
12
10
  import scipy.constants as constants
13
11
  import numpy as np
14
- import extto
15
- import docx
12
+ from extto import DataNotFoundError
16
13
  import re
17
- import mmap
18
- import shutil
14
+ from mmap import mmap, ACCESS_READ
15
+ from shutil import move as shutilmove
19
16
 
20
17
 
18
+ from docx import Document
21
19
  from docx.enum.text import WD_ALIGN_PARAGRAPH
22
20
  from docx.enum.table import WD_ALIGN_VERTICAL
23
21
  from docx.shared import Pt
@@ -28,17 +26,6 @@ from . import job
28
26
  from . import utils as ut
29
27
  from . import input as inp
30
28
 
31
- # Change matplotlib font size to be larger
32
- mpl.rcParams.update({'font.size': 12})
33
-
34
- # Set user specified font name
35
- if os.getenv('orto_fontname'):
36
- try:
37
- plt.rcParams['font.family'] = os.getenv('orto_fontname')
38
- except ValueError:
39
- ut.cprint('Error in orto_fontname environment variable', 'red')
40
- sys.exit(1)
41
-
42
29
  _SHOW_CONV = {
43
30
  'on': True,
44
31
  'save': False,
@@ -126,7 +113,7 @@ def extract_sf_energies_func(uargs):
126
113
  title = 'Spin-Free energies'
127
114
 
128
115
  # Create document
129
- doc = docx.Document()
116
+ doc = Document()
130
117
 
131
118
  doc.add_heading(title, 0)
132
119
 
@@ -261,7 +248,7 @@ def extract_gmatrix_func(uargs, save=True):
261
248
  title = titles[uargs.type]
262
249
 
263
250
  # Create document
264
- doc = docx.Document()
251
+ doc = Document()
265
252
 
266
253
  doc.add_heading(title, 0)
267
254
 
@@ -357,12 +344,12 @@ def gen_trunc_molden_func(uargs):
357
344
  # occurrences of 'Occup='
358
345
  _patt = re.compile(b'Sym=')
359
346
  with open(uargs.input_file, mode="r") as file_obj:
360
- with mmap.mmap(file_obj.fileno(), length=0, access=mmap.ACCESS_READ) as mmap_obj: # noqa
347
+ with mmap(file_obj.fileno(), length=0, access=ACCESS_READ) as mmap_obj:
361
348
  n_MO = len(_patt.findall(mmap_obj))
362
349
 
363
350
  _patt = re.compile(b'Occup= 0.000000')
364
351
  with open(uargs.input_file, mode="r") as file_obj:
365
- with mmap.mmap(file_obj.fileno(), length=0, access=mmap.ACCESS_READ) as mmap_obj: # noqa
352
+ with mmap(file_obj.fileno(), length=0, access=ACCESS_READ) as mmap_obj:
366
353
  n_virt = len(_patt.findall(mmap_obj))
367
354
 
368
355
  ut.cprint(
@@ -399,7 +386,7 @@ def gen_trunc_molden_func(uargs):
399
386
  # If no output file given
400
387
  if uargs.output_file == '.tmp.molden':
401
388
  # Copy new file to original name
402
- shutil.move(uargs.output_file, uargs.input_file)
389
+ shutilmove(uargs.output_file, uargs.input_file)
403
390
  uargs.output_file = uargs.input_file
404
391
 
405
392
  ut.cprint(f'New molden file written to {uargs.output_file}', 'cyan')
@@ -554,6 +541,19 @@ def plot_abs_func(uargs):
554
541
  -------
555
542
  None
556
543
  '''
544
+ import matplotlib.pyplot as plt
545
+ import matplotlib as mpl
546
+
547
+ # Set user specified font name
548
+ if os.getenv('orto_fontname'):
549
+ try:
550
+ plt.rcParams['font.family'] = os.getenv('orto_fontname')
551
+ except ValueError:
552
+ ut.cprint('Error in orto_fontname environment variable', 'red')
553
+ sys.exit(1)
554
+
555
+ # Change matplotlib font size to be larger
556
+ mpl.rcParams.update({'font.size': 12})
557
557
 
558
558
  version = oe.OrcaVersionExtractor.extract(uargs.output_file)
559
559
 
@@ -744,7 +744,7 @@ def extract_orbs_func(uargs, save=True) -> None:
744
744
  # Disable spin if not present in file
745
745
  if mult == 1:
746
746
  uargs.spin = None
747
- except extto.DataNotFoundError:
747
+ except DataNotFoundError:
748
748
  pass
749
749
 
750
750
  extractors = {
@@ -772,7 +772,7 @@ def extract_orbs_func(uargs, save=True) -> None:
772
772
  )
773
773
  uargs.flavour = name
774
774
  break
775
- except extto.DataNotFoundError:
775
+ except DataNotFoundError:
776
776
  failed += 1
777
777
  if failed == len(extractors):
778
778
  ut.red_exit(
@@ -783,7 +783,7 @@ def extract_orbs_func(uargs, save=True) -> None:
783
783
  data = extractors[uargs.flavour](
784
784
  uargs.output_file
785
785
  )
786
- except extto.DataNotFoundError as dne:
786
+ except DataNotFoundError as dne:
787
787
  ut.red_exit(str(dne))
788
788
 
789
789
  # Unpack data
@@ -955,7 +955,7 @@ def extract_pop_func(uargs, save=True) -> None:
955
955
  data = oe.MullikenPopulationExtractorDensities.extract(
956
956
  uargs.output_file
957
957
  )
958
- except extto.DataNotFoundError:
958
+ except DataNotFoundError:
959
959
  data = oe.MullikenPopulationExtractorPopulations.extract(
960
960
  uargs.output_file
961
961
  )
@@ -1018,6 +1018,11 @@ def plot_susc_func(uargs) -> None:
1018
1018
  None
1019
1019
 
1020
1020
  '''
1021
+ import matplotlib.pyplot as plt
1022
+ import matplotlib as mpl
1023
+
1024
+ # Change matplotlib font size to be larger
1025
+ mpl.rcParams.update({'font.size': 12})
1021
1026
 
1022
1027
  # Extract data from file
1023
1028
  data = oe.SusceptibilityExtractor.extract(uargs.output_file)
@@ -1039,7 +1044,7 @@ def plot_susc_func(uargs) -> None:
1039
1044
 
1040
1045
  # Load experimental data if provided
1041
1046
  if uargs.exp_file is not None:
1042
- exp_data = pd.read_csv(
1047
+ exp_data = read_csv(
1043
1048
  uargs.exp_file,
1044
1049
  comment='#',
1045
1050
  skipinitialspace=True
@@ -1113,6 +1118,11 @@ def plot_ailft_func(uargs) -> None:
1113
1118
  -------
1114
1119
  None
1115
1120
  '''
1121
+ import matplotlib.pyplot as plt
1122
+ import matplotlib as mpl
1123
+
1124
+ # Change matplotlib font size to be larger
1125
+ mpl.rcParams.update({'font.size': 12})
1116
1126
 
1117
1127
  # Create extractor
1118
1128
  data = oe.AILFTOrbEnergyExtractor.extract(uargs.output_file)
@@ -1940,7 +1950,7 @@ def read_args(arg_list=None):
1940
1950
  '-e',
1941
1951
  '--elements',
1942
1952
  type=str,
1943
- default=atomic.elements,
1953
+ default=atomic_elements,
1944
1954
  nargs='+',
1945
1955
  help='Only print contributions from specified element(s) e.g. Ni'
1946
1956
  )
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: orto
3
- Version: 1.0.0
3
+ Version: 1.0.1
4
4
  Summary: A package to make life easier when performing Orca calculations.
5
5
  Home-page: https://orto.kragskow.group
6
6
  Author: Jon Kragskow
@@ -1,13 +1,13 @@
1
1
  orto/__init__.py,sha256=iSR4TAfpJn1_mwTnnncgwmWBz3q_ImdmhnOORKcOvE0,63
2
- orto/__version__.py,sha256=RsZjRjMprNcDm97wqRRSk6rTLgTX8N0GyicZyZ8OsBQ,22
3
- orto/cli.py,sha256=4W6KgUjmdI8wYo3n5Dp74YgH8a4q7-IsxBf7fhWl6P4,59396
2
+ orto/__version__.py,sha256=3KXfAcA5rzzQXMtfwpHphgbJNZdA0XWaW96kdWVSZJw,22
3
+ orto/cli.py,sha256=xRcJw_65gQmpBsmruRe46r2gd7fBdLpoh9Z0oPLPcM8,59795
4
4
  orto/extractor.py,sha256=kJnVI_Zwz7yorbojWdgxN-NSspJIY9pKoDb1RD2dHUg,67488
5
5
  orto/input.py,sha256=UMYNPGeqOCNKvPYJVfVS2JU7Ost_xM1ZG28t5f9-Er0,7084
6
6
  orto/job.py,sha256=SM0nlc_bqhhPvfuuykhMvaUnkwC3Gp-6RvYw_a0TyGc,5855
7
7
  orto/plotter.py,sha256=ICrO03T_HGe-H1XKZ2qzsKYdPY44E0PKiXqIQQawd7I,15633
8
8
  orto/utils.py,sha256=gVfGplkfc6xGYgLMi_7I_yAdWG-QKRaqQdy9v5F4Mck,7279
9
- orto-1.0.0.dist-info/METADATA,sha256=P-6wCgp-dPyw8b8N0d8m4Et-C8MXJGBySV75lL9Y2JQ,1140
10
- orto-1.0.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
11
- orto-1.0.0.dist-info/entry_points.txt,sha256=HXenCglMp_03JkN34pK2phkjXK9CFcXTGHKv5QaVY8I,39
12
- orto-1.0.0.dist-info/top_level.txt,sha256=hQ-z28gTN_FZ2B5Kiwxr_9cUTcCoib9W5HjbkceDXw4,5
13
- orto-1.0.0.dist-info/RECORD,,
9
+ orto-1.0.1.dist-info/METADATA,sha256=tkPj-dCGN-DhaYdlyGkXVysH-4STdCAf4kPr-hXYbfU,1140
10
+ orto-1.0.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
11
+ orto-1.0.1.dist-info/entry_points.txt,sha256=HXenCglMp_03JkN34pK2phkjXK9CFcXTGHKv5QaVY8I,39
12
+ orto-1.0.1.dist-info/top_level.txt,sha256=hQ-z28gTN_FZ2B5Kiwxr_9cUTcCoib9W5HjbkceDXw4,5
13
+ orto-1.0.1.dist-info/RECORD,,
File without changes