orto 1.11.2__tar.gz → 1.12.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.
- {orto-1.11.2 → orto-1.12.0}/PKG-INFO +1 -1
- orto-1.12.0/orto/__version__.py +1 -0
- {orto-1.11.2 → orto-1.12.0}/orto/cli.py +310 -79
- {orto-1.11.2 → orto-1.12.0}/orto/plotter.py +26 -4
- {orto-1.11.2 → orto-1.12.0}/orto.egg-info/PKG-INFO +1 -1
- {orto-1.11.2 → orto-1.12.0}/setup.py +1 -1
- orto-1.11.2/orto/__version__.py +0 -1
- {orto-1.11.2 → orto-1.12.0}/LICENSE +0 -0
- {orto-1.11.2 → orto-1.12.0}/README.md +0 -0
- {orto-1.11.2 → orto-1.12.0}/orto/__init__.py +0 -0
- {orto-1.11.2 → orto-1.12.0}/orto/constants.py +0 -0
- {orto-1.11.2 → orto-1.12.0}/orto/data.py +0 -0
- {orto-1.11.2 → orto-1.12.0}/orto/exceptions.py +0 -0
- {orto-1.11.2 → orto-1.12.0}/orto/extractor.py +0 -0
- {orto-1.11.2 → orto-1.12.0}/orto/input.py +0 -0
- {orto-1.11.2 → orto-1.12.0}/orto/job.py +0 -0
- {orto-1.11.2 → orto-1.12.0}/orto/utils.py +0 -0
- {orto-1.11.2 → orto-1.12.0}/orto.egg-info/SOURCES.txt +0 -0
- {orto-1.11.2 → orto-1.12.0}/orto.egg-info/dependency_links.txt +0 -0
- {orto-1.11.2 → orto-1.12.0}/orto.egg-info/entry_points.txt +0 -0
- {orto-1.11.2 → orto-1.12.0}/orto.egg-info/requires.txt +0 -0
- {orto-1.11.2 → orto-1.12.0}/orto.egg-info/top_level.txt +0 -0
- {orto-1.11.2 → orto-1.12.0}/pyproject.toml +0 -0
- {orto-1.11.2 → orto-1.12.0}/setup.cfg +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = '1.12.0'
|
|
@@ -537,9 +537,99 @@ def extract_gmatrix_func(uargs, save=True):
|
|
|
537
537
|
return
|
|
538
538
|
|
|
539
539
|
|
|
540
|
+
def gen_orbs_func(uargs):
|
|
541
|
+
'''
|
|
542
|
+
Wrapper for CLI gen orbs call
|
|
543
|
+
|
|
544
|
+
Parameters
|
|
545
|
+
----------
|
|
546
|
+
uargs: argparser object
|
|
547
|
+
User arguments
|
|
548
|
+
|
|
549
|
+
Returns
|
|
550
|
+
-------
|
|
551
|
+
None
|
|
552
|
+
'''
|
|
553
|
+
from subto.job import SlurmJob
|
|
554
|
+
|
|
555
|
+
# Check orca module
|
|
556
|
+
if len(uargs.orca_load):
|
|
557
|
+
orca_load_val = copy.copy(uargs.orca_load)
|
|
558
|
+
elif os.getenv('orto_orca_load'):
|
|
559
|
+
try:
|
|
560
|
+
if len(os.getenv('orto_orca_load')):
|
|
561
|
+
orca_load_val = os.getenv('orto_orca_load')
|
|
562
|
+
except ValueError:
|
|
563
|
+
ut.red_exit(
|
|
564
|
+
(
|
|
565
|
+
'Error in orto_orca_load environment variable'
|
|
566
|
+
)
|
|
567
|
+
)
|
|
568
|
+
else:
|
|
569
|
+
ut.red_exit(
|
|
570
|
+
(
|
|
571
|
+
'Missing orto_orca_load environment variable or '
|
|
572
|
+
'--orca_load argument'
|
|
573
|
+
)
|
|
574
|
+
)
|
|
575
|
+
|
|
576
|
+
# Create string of command numbers for orca plot to follow
|
|
577
|
+
command_nums = '1\\n1\\n4'
|
|
578
|
+
command_nums += f'\\n{uargs.n_pts:d}'
|
|
579
|
+
command_nums += '\\n5\\n7'
|
|
580
|
+
|
|
581
|
+
if uargs.beta:
|
|
582
|
+
command_nums += '\\n3\\n1'
|
|
583
|
+
|
|
584
|
+
for orbital_number in uargs.orb_numbers:
|
|
585
|
+
command_nums += '\\n2'
|
|
586
|
+
command_nums += f'\\n{orbital_number:d}'
|
|
587
|
+
command_nums += '\\n11'
|
|
588
|
+
command_nums += '\\n12\\n'
|
|
589
|
+
|
|
590
|
+
# Generate job file for orca_plot
|
|
591
|
+
orb_job = SlurmJob(
|
|
592
|
+
pathlib.Path(f'{uargs.gbw_file.stem}_orbital_job.sh')
|
|
593
|
+
)
|
|
594
|
+
|
|
595
|
+
# Create content of job
|
|
596
|
+
orb_job.content_block = ''
|
|
597
|
+
|
|
598
|
+
orb_job.content_block += '# Load orca module\n'
|
|
599
|
+
orb_job.content_block += f'module load {orca_load_val}\n'
|
|
600
|
+
orb_job.content_block += '# Run orca_plot to generate orbital cube file(s)\n' # noqa
|
|
601
|
+
orb_job.content_block += f'time mpirun -np {uargs.n_procs:d} $(which orca_plot_mpi) {uargs.gbw_file.name} -i aa <<< $\'{command_nums}\'\n\n' # noqa
|
|
602
|
+
|
|
603
|
+
# Set job name
|
|
604
|
+
orb_job.job_name = f'{uargs.gbw_file.stem}_orbitals'
|
|
605
|
+
|
|
606
|
+
orb_job.ntasks_per_node = str(uargs.n_procs)
|
|
607
|
+
orb_job.mem_per_cpu = str(uargs.memory)
|
|
608
|
+
|
|
609
|
+
orb_job.error = f'{uargs.gbw_file.stem}_orbitals.%j.e'
|
|
610
|
+
orb_job.output = f'{uargs.gbw_file.stem}_orbitals.%j.o'
|
|
611
|
+
|
|
612
|
+
# Write job script
|
|
613
|
+
# with submitter configuration options specified
|
|
614
|
+
orb_job.write_script(True)
|
|
615
|
+
|
|
616
|
+
# Submit to queue
|
|
617
|
+
if not uargs.no_sub:
|
|
618
|
+
subprocess.call(
|
|
619
|
+
'cd {}; {} "{}"; cd ../'.format(
|
|
620
|
+
uargs.gbw_file.parents[0],
|
|
621
|
+
orb_job.SUBMIT_COMMAND,
|
|
622
|
+
orb_job.file_path
|
|
623
|
+
),
|
|
624
|
+
shell=True
|
|
625
|
+
)
|
|
626
|
+
|
|
627
|
+
return
|
|
628
|
+
|
|
629
|
+
|
|
540
630
|
def gen_spden_func(uargs):
|
|
541
631
|
'''
|
|
542
|
-
Wrapper for CLI gen
|
|
632
|
+
Wrapper for CLI gen spin_density call
|
|
543
633
|
|
|
544
634
|
Parameters
|
|
545
635
|
----------
|
|
@@ -868,7 +958,6 @@ def plot_xes_func(uargs):
|
|
|
868
958
|
None
|
|
869
959
|
'''
|
|
870
960
|
import matplotlib.pyplot as plt
|
|
871
|
-
import matplotlib as mpl
|
|
872
961
|
from . import plotter
|
|
873
962
|
from . import extractor as oe
|
|
874
963
|
|
|
@@ -876,7 +965,8 @@ def plot_xes_func(uargs):
|
|
|
876
965
|
ut.check_font_envvar()
|
|
877
966
|
|
|
878
967
|
# Change matplotlib font size to be larger
|
|
879
|
-
|
|
968
|
+
plt.rcParams['font.size'] = 10
|
|
969
|
+
plt.rcParams['legend.fontsize'] = 9
|
|
880
970
|
|
|
881
971
|
version = oe.OrcaVersionExtractor.extract(uargs.output_file)
|
|
882
972
|
|
|
@@ -986,7 +1076,6 @@ def plot_xas_func(uargs):
|
|
|
986
1076
|
None
|
|
987
1077
|
'''
|
|
988
1078
|
import matplotlib.pyplot as plt
|
|
989
|
-
import matplotlib as mpl
|
|
990
1079
|
from . import plotter
|
|
991
1080
|
from . import extractor as oe
|
|
992
1081
|
|
|
@@ -994,7 +1083,8 @@ def plot_xas_func(uargs):
|
|
|
994
1083
|
ut.check_font_envvar()
|
|
995
1084
|
|
|
996
1085
|
# Change matplotlib font size to be larger
|
|
997
|
-
|
|
1086
|
+
plt.rcParams['font.size'] = 10
|
|
1087
|
+
plt.rcParams['legend.fontsize'] = 9
|
|
998
1088
|
|
|
999
1089
|
version = oe.OrcaVersionExtractor.extract(uargs.output_file)
|
|
1000
1090
|
|
|
@@ -1098,42 +1188,11 @@ def plot_abs_func(uargs, save_data_only=False):
|
|
|
1098
1188
|
-------
|
|
1099
1189
|
None
|
|
1100
1190
|
'''
|
|
1101
|
-
import matplotlib.pyplot as plt
|
|
1102
|
-
import matplotlib as mpl
|
|
1103
|
-
import matplotlib.colors as mcolors
|
|
1104
1191
|
from . import plotter
|
|
1105
1192
|
from . import extractor as oe
|
|
1106
1193
|
from . import data as d
|
|
1107
1194
|
|
|
1108
|
-
#
|
|
1109
|
-
mpl.rcParams.update({'font.size': 12})
|
|
1110
|
-
# Set user specified font name
|
|
1111
|
-
ut.check_font_envvar()
|
|
1112
|
-
|
|
1113
|
-
# Change matplotlib font size to be larger
|
|
1114
|
-
mpl.rcParams.update({'font.size': 12})
|
|
1115
|
-
|
|
1116
|
-
if len(uargs.output_file) == 1:
|
|
1117
|
-
colours = ['black']
|
|
1118
|
-
else:
|
|
1119
|
-
colours = list(mcolors.TABLEAU_COLORS.values())
|
|
1120
|
-
|
|
1121
|
-
fig, ax = plt.subplots(1, 1, figsize=(6, 4))
|
|
1122
|
-
oax = ax.twinx()
|
|
1123
|
-
|
|
1124
|
-
# Find unique name from multiple file names
|
|
1125
|
-
if len(uargs.output_file) > 1:
|
|
1126
|
-
if uargs.unique_names:
|
|
1127
|
-
base_names = [of.stem for of in uargs.output_file]
|
|
1128
|
-
unique_names = ut.find_unique_substring(base_names)
|
|
1129
|
-
else:
|
|
1130
|
-
unique_names = [of.stem for of in uargs.output_file]
|
|
1131
|
-
legend = True
|
|
1132
|
-
else:
|
|
1133
|
-
legend = False
|
|
1134
|
-
unique_names = ['']
|
|
1135
|
-
|
|
1136
|
-
# Handle x_shift argument
|
|
1195
|
+
# Process x_shift argument
|
|
1137
1196
|
if uargs.x_shift is None:
|
|
1138
1197
|
uargs.x_shift = [0.0 for _ in uargs.output_file]
|
|
1139
1198
|
elif len(uargs.x_shift) != len(uargs.output_file):
|
|
@@ -1141,6 +1200,10 @@ def plot_abs_func(uargs, save_data_only=False):
|
|
|
1141
1200
|
'Number of x_shift values must match number of output files'
|
|
1142
1201
|
)
|
|
1143
1202
|
|
|
1203
|
+
# Create dictionary to hold absorption data for plotting later
|
|
1204
|
+
spectra_dict = {}
|
|
1205
|
+
|
|
1206
|
+
# Extract data from each output file
|
|
1144
1207
|
for it, output_file in enumerate(uargs.output_file):
|
|
1145
1208
|
|
|
1146
1209
|
version = oe.OrcaVersionExtractor.extract(output_file)
|
|
@@ -1152,6 +1215,9 @@ def plot_abs_func(uargs, save_data_only=False):
|
|
|
1152
1215
|
)
|
|
1153
1216
|
version = [6, 0, 0]
|
|
1154
1217
|
|
|
1218
|
+
# Extract absorption data from file
|
|
1219
|
+
# using appropriate extractor for version
|
|
1220
|
+
# and intensity type
|
|
1155
1221
|
if version[0] < 6:
|
|
1156
1222
|
if uargs.intensities == 'electric':
|
|
1157
1223
|
all_datasets = oe.OldAbsorptionElectricDipoleExtractor.extract(
|
|
@@ -1177,6 +1243,9 @@ def plot_abs_func(uargs, save_data_only=False):
|
|
|
1177
1243
|
|
|
1178
1244
|
ut.cprint('Using intensities: {}'.format(uargs.intensities), 'cyan')
|
|
1179
1245
|
|
|
1246
|
+
# Create absorption data object
|
|
1247
|
+
# one per dataset extracted
|
|
1248
|
+
# (doubtful multiple datasets will be present, but just in case)
|
|
1180
1249
|
all_abs_data = [
|
|
1181
1250
|
d.AbsorptionData.from_extractor_dataset(
|
|
1182
1251
|
dataset,
|
|
@@ -1186,10 +1255,12 @@ def plot_abs_func(uargs, save_data_only=False):
|
|
|
1186
1255
|
for dataset in all_datasets
|
|
1187
1256
|
]
|
|
1188
1257
|
|
|
1258
|
+
# Check absorption data was found
|
|
1189
1259
|
if len(all_abs_data) == 0:
|
|
1190
1260
|
ut.red_exit(
|
|
1191
1261
|
f'No ABSORPTION data found in file {output_file}', 'red'
|
|
1192
1262
|
)
|
|
1263
|
+
# report if multiple absorption sections found
|
|
1193
1264
|
elif len(all_abs_data) > 1:
|
|
1194
1265
|
ut.cprint(
|
|
1195
1266
|
f'Found {len(all_abs_data)} ABSORPTION sections in '
|
|
@@ -1197,9 +1268,11 @@ def plot_abs_func(uargs, save_data_only=False):
|
|
|
1197
1268
|
f'Plotting final section ONLY',
|
|
1198
1269
|
'cyan'
|
|
1199
1270
|
)
|
|
1200
|
-
|
|
1271
|
+
# and only use final one
|
|
1272
|
+
# (again, doubtful multiple sections will be present, but just in case)
|
|
1201
1273
|
abs_data = all_abs_data[-1]
|
|
1202
1274
|
|
|
1275
|
+
# Determine x values for setting x limits of computed spectrum
|
|
1203
1276
|
if uargs.x_unit == 'wavenumber':
|
|
1204
1277
|
x_vals = abs_data.wavenumbers
|
|
1205
1278
|
min_factor = 0.8
|
|
@@ -1222,7 +1295,8 @@ def plot_abs_func(uargs, save_data_only=False):
|
|
|
1222
1295
|
max_factor = 1.0005
|
|
1223
1296
|
x_reversed = False
|
|
1224
1297
|
|
|
1225
|
-
# Set x_min
|
|
1298
|
+
# Set x_min
|
|
1299
|
+
# based on user arguments
|
|
1226
1300
|
if isinstance(uargs.x_lim[0], str):
|
|
1227
1301
|
if uargs.x_lim[0] == 'auto':
|
|
1228
1302
|
x_min = min(x_vals) * min_factor
|
|
@@ -1233,6 +1307,8 @@ def plot_abs_func(uargs, save_data_only=False):
|
|
|
1233
1307
|
else:
|
|
1234
1308
|
x_min = uargs.x_lim[0]
|
|
1235
1309
|
|
|
1310
|
+
# Set x_max
|
|
1311
|
+
# based on user arguments
|
|
1236
1312
|
if isinstance(uargs.x_lim[1], str):
|
|
1237
1313
|
if uargs.x_lim[1] == 'auto':
|
|
1238
1314
|
x_max = max(x_vals) * max_factor
|
|
@@ -1247,7 +1323,7 @@ def plot_abs_func(uargs, save_data_only=False):
|
|
|
1247
1323
|
if uargs.trim_transitions is not None:
|
|
1248
1324
|
abs_data.trim_to_n(uargs.trim_transitions)
|
|
1249
1325
|
|
|
1250
|
-
# Generate spectrum
|
|
1326
|
+
# Generate spectrum data
|
|
1251
1327
|
abs_data.generate_spectrum(
|
|
1252
1328
|
fwhm=uargs.linewidth,
|
|
1253
1329
|
lineshape=uargs.lineshape,
|
|
@@ -1255,12 +1331,12 @@ def plot_abs_func(uargs, save_data_only=False):
|
|
|
1255
1331
|
num_points=10000,
|
|
1256
1332
|
x_min=x_min,
|
|
1257
1333
|
x_max=x_max,
|
|
1258
|
-
comment=
|
|
1334
|
+
comment=output_file,
|
|
1259
1335
|
x_reversed=x_reversed
|
|
1260
1336
|
)
|
|
1261
1337
|
|
|
1338
|
+
# Save spectrum data to file
|
|
1262
1339
|
if save_data_only:
|
|
1263
|
-
# Save spectrum data to file
|
|
1264
1340
|
abs_data.save_spectrum_data(
|
|
1265
1341
|
f'absorption_spectrum_{output_file.stem}.csv',
|
|
1266
1342
|
comments='Data from {}\nfwhm={}, lineshape={}\nintensities={}'.format( # noqa
|
|
@@ -1286,33 +1362,98 @@ def plot_abs_func(uargs, save_data_only=False):
|
|
|
1286
1362
|
'cyan'
|
|
1287
1363
|
)
|
|
1288
1364
|
else:
|
|
1289
|
-
#
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
normalise=uargs.normalise,
|
|
1296
|
-
window_title='',
|
|
1297
|
-
fig=fig,
|
|
1298
|
-
ax=ax,
|
|
1299
|
-
oax=oax,
|
|
1300
|
-
show=False,
|
|
1301
|
-
save=False,
|
|
1302
|
-
x_lim=[x_min, x_max],
|
|
1303
|
-
y_lim=uargs.y_lim,
|
|
1304
|
-
x_shift=uargs.x_shift[it],
|
|
1305
|
-
legend=legend
|
|
1306
|
-
)
|
|
1365
|
+
# Add to dictionary of spectra for plotting later
|
|
1366
|
+
spectra_dict[output_file] = abs_data
|
|
1367
|
+
|
|
1368
|
+
# Exit if only saving data
|
|
1369
|
+
if save_data_only:
|
|
1370
|
+
return
|
|
1307
1371
|
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
plt.savefig(savename, dpi=500)
|
|
1312
|
-
ut.cprint(f'Saved image to {savename}', 'cyan')
|
|
1372
|
+
# Plot all spectra
|
|
1373
|
+
import matplotlib.pyplot as plt
|
|
1374
|
+
import matplotlib.colors as mcolors
|
|
1313
1375
|
|
|
1314
|
-
|
|
1315
|
-
|
|
1376
|
+
# Set font name and size
|
|
1377
|
+
ut.check_font_envvar()
|
|
1378
|
+
plt.rcParams['font.size'] = 10
|
|
1379
|
+
plt.rcParams['legend.fontsize'] = 9
|
|
1380
|
+
plt.rcParams['legend.loc'] = 'center right'
|
|
1381
|
+
|
|
1382
|
+
# Create list of colours for plotting
|
|
1383
|
+
if len(uargs.output_file) == 1:
|
|
1384
|
+
colours = ['black']
|
|
1385
|
+
else:
|
|
1386
|
+
colours = list(mcolors.TABLEAU_COLORS.values())
|
|
1387
|
+
|
|
1388
|
+
# Width of figure in inches
|
|
1389
|
+
# Make wider if multiple spectra to plot
|
|
1390
|
+
# to include legend
|
|
1391
|
+
if len(spectra_dict) > 1:
|
|
1392
|
+
width = 6.
|
|
1393
|
+
else:
|
|
1394
|
+
width = 4
|
|
1395
|
+
# width in cm
|
|
1396
|
+
width_cm = 2.54 * width
|
|
1397
|
+
|
|
1398
|
+
# Create figure and axis with
|
|
1399
|
+
# height based on golden ratio
|
|
1400
|
+
golden = (1 + np.sqrt(5))/2
|
|
1401
|
+
fig, ax = plt.subplots(
|
|
1402
|
+
1,
|
|
1403
|
+
1,
|
|
1404
|
+
num='Absorption Spectrum',
|
|
1405
|
+
figsize=(width, 4. / golden)
|
|
1406
|
+
)
|
|
1407
|
+
# Secondary axis for oscillator strength sticks
|
|
1408
|
+
oax = ax.twinx()
|
|
1409
|
+
|
|
1410
|
+
# Plot absorption spectrum for each file
|
|
1411
|
+
for it, (output_file, abs_data) in enumerate(spectra_dict.items()): # noqa
|
|
1412
|
+
|
|
1413
|
+
plotter.plot_absorption_spectrum(
|
|
1414
|
+
abs_data,
|
|
1415
|
+
linecolor=colours[it],
|
|
1416
|
+
stickcolour=colours[it],
|
|
1417
|
+
osc_style=uargs.osc_style,
|
|
1418
|
+
normalise=uargs.normalise,
|
|
1419
|
+
window_title='',
|
|
1420
|
+
fig=fig,
|
|
1421
|
+
ax=ax,
|
|
1422
|
+
oax=oax,
|
|
1423
|
+
show=False,
|
|
1424
|
+
save=False,
|
|
1425
|
+
x_lim=[x_min, x_max],
|
|
1426
|
+
y_lim=uargs.y_lim,
|
|
1427
|
+
x_shift=uargs.x_shift[it],
|
|
1428
|
+
legend=False
|
|
1429
|
+
)
|
|
1430
|
+
|
|
1431
|
+
if uargs.x_lim != ['auto', 'auto']:
|
|
1432
|
+
ax.set_xlim(float(uargs.x_lim[0]), float(uargs.x_lim[1]))
|
|
1433
|
+
|
|
1434
|
+
fig.tight_layout()
|
|
1435
|
+
|
|
1436
|
+
if len(spectra_dict) > 1:
|
|
1437
|
+
fig.subplots_adjust(right=3.3/6.)
|
|
1438
|
+
if uargs.legend is None:
|
|
1439
|
+
legend_labels = [
|
|
1440
|
+
f'{output_file.stem}' for output_file in spectra_dict.keys()
|
|
1441
|
+
]
|
|
1442
|
+
fig.legend(legend_labels, loc=7)
|
|
1443
|
+
else:
|
|
1444
|
+
fig.legend(uargs.legend, loc=7)
|
|
1445
|
+
|
|
1446
|
+
if _SAVE_CONV[uargs.plot]:
|
|
1447
|
+
savename = f'absorption_spectrum_{output_file.stem}.png'
|
|
1448
|
+
plt.savefig(savename, dpi=500)
|
|
1449
|
+
ut.cprint(f'Saved image to {savename}', 'cyan')
|
|
1450
|
+
ut.cprint(
|
|
1451
|
+
f'Use width={width:.1f} in. or {width_cm:.1f} cm',
|
|
1452
|
+
'cyan'
|
|
1453
|
+
)
|
|
1454
|
+
|
|
1455
|
+
if _SHOW_CONV[uargs.plot]:
|
|
1456
|
+
plt.show()
|
|
1316
1457
|
|
|
1317
1458
|
return
|
|
1318
1459
|
|
|
@@ -1330,7 +1471,7 @@ def plot_ir_func(uargs):
|
|
|
1330
1471
|
-------
|
|
1331
1472
|
None
|
|
1332
1473
|
'''
|
|
1333
|
-
import matplotlib as
|
|
1474
|
+
import matplotlib.pyplot as plt
|
|
1334
1475
|
from . import plotter
|
|
1335
1476
|
from . import extractor as oe
|
|
1336
1477
|
|
|
@@ -1338,7 +1479,8 @@ def plot_ir_func(uargs):
|
|
|
1338
1479
|
ut.check_font_envvar()
|
|
1339
1480
|
|
|
1340
1481
|
# Change matplotlib font size to be larger
|
|
1341
|
-
|
|
1482
|
+
plt.rcParams['font.size'] = 10
|
|
1483
|
+
plt.rcParams['legend.fontsize'] = 9
|
|
1342
1484
|
|
|
1343
1485
|
# Extract frequency information
|
|
1344
1486
|
data = oe.FrequencyExtractor.extract(uargs.output_file)
|
|
@@ -1725,12 +1867,14 @@ def plot_susc_func(uargs) -> None:
|
|
|
1725
1867
|
|
|
1726
1868
|
'''
|
|
1727
1869
|
import matplotlib.pyplot as plt
|
|
1728
|
-
import matplotlib as mpl
|
|
1729
1870
|
from . import plotter
|
|
1730
1871
|
from . import extractor as oe
|
|
1731
1872
|
|
|
1873
|
+
# Set user specified font name
|
|
1874
|
+
ut.check_font_envvar()
|
|
1732
1875
|
# Change matplotlib font size to be larger
|
|
1733
|
-
|
|
1876
|
+
plt.rcParams['font.size'] = 10
|
|
1877
|
+
plt.rcParams['legend.fontsize'] = 9
|
|
1734
1878
|
|
|
1735
1879
|
# Extract data from file
|
|
1736
1880
|
data = oe.SusceptibilityExtractor.extract(uargs.output_file)
|
|
@@ -1754,7 +1898,8 @@ def plot_susc_func(uargs) -> None:
|
|
|
1754
1898
|
exp_data = {'Temperature (K)': [], 'chi*T (cm3*K/mol)': []}
|
|
1755
1899
|
with open(uargs.exp_file, newline='') as csvfile:
|
|
1756
1900
|
reader = csv.DictReader(
|
|
1757
|
-
row for row in csvfile if not row.startswith('#')
|
|
1901
|
+
[row for row in csvfile if not row.startswith('#')],
|
|
1902
|
+
skipinitialspace=True
|
|
1758
1903
|
)
|
|
1759
1904
|
for row in reader:
|
|
1760
1905
|
exp_data['Temperature (K)'].append(
|
|
@@ -1836,12 +1981,14 @@ def plot_ailft_func(uargs) -> None:
|
|
|
1836
1981
|
None
|
|
1837
1982
|
'''
|
|
1838
1983
|
import matplotlib.pyplot as plt
|
|
1839
|
-
import matplotlib as mpl
|
|
1840
1984
|
from . import plotter
|
|
1841
1985
|
from . import extractor as oe
|
|
1842
1986
|
|
|
1987
|
+
# Set user specified font name
|
|
1988
|
+
ut.check_font_envvar()
|
|
1843
1989
|
# Change matplotlib font size to be larger
|
|
1844
|
-
|
|
1990
|
+
plt.rcParams['font.size'] = 10
|
|
1991
|
+
plt.rcParams['legend.fontsize'] = 9
|
|
1845
1992
|
|
|
1846
1993
|
# Create extractor
|
|
1847
1994
|
data = oe.AILFTOrbEnergyExtractor.extract(uargs.output_file)
|
|
@@ -2151,6 +2298,89 @@ def read_args(arg_list=None):
|
|
|
2151
2298
|
)
|
|
2152
2299
|
)
|
|
2153
2300
|
|
|
2301
|
+
gen_orbs = gen_parser.add_parser(
|
|
2302
|
+
'orbs',
|
|
2303
|
+
aliases=['orbitals', 'mos', 'mo'],
|
|
2304
|
+
description='Generate molecular orbital cube file(s) from gbw file', # noqa
|
|
2305
|
+
usage=ut.cstring(
|
|
2306
|
+
'orto gen orbs <gbw_file> <orbs> <n_procs> [options]',
|
|
2307
|
+
'cyan'
|
|
2308
|
+
),
|
|
2309
|
+
formatter_class=argparse.RawTextHelpFormatter
|
|
2310
|
+
)
|
|
2311
|
+
gen_orbs._positionals.title = 'Mandatory Arguments'
|
|
2312
|
+
gen_orbs.set_defaults(func=gen_orbs_func)
|
|
2313
|
+
|
|
2314
|
+
gen_orbs.add_argument(
|
|
2315
|
+
'gbw_file',
|
|
2316
|
+
type=pathlib.Path,
|
|
2317
|
+
help='Orca gbw file name'
|
|
2318
|
+
)
|
|
2319
|
+
|
|
2320
|
+
gen_orbs.add_argument(
|
|
2321
|
+
'orb_numbers',
|
|
2322
|
+
type=int,
|
|
2323
|
+
nargs='+',
|
|
2324
|
+
help=(
|
|
2325
|
+
'Orbital number(s) to generate cube file for'
|
|
2326
|
+
'(these are alpha spin by default)'
|
|
2327
|
+
)
|
|
2328
|
+
)
|
|
2329
|
+
|
|
2330
|
+
gen_orbs.add_argument(
|
|
2331
|
+
'n_procs',
|
|
2332
|
+
type=int,
|
|
2333
|
+
help='Number of processors/cores used in calculation',
|
|
2334
|
+
default=1
|
|
2335
|
+
)
|
|
2336
|
+
|
|
2337
|
+
gen_orbs.add_argument(
|
|
2338
|
+
'--n_pts',
|
|
2339
|
+
'-n',
|
|
2340
|
+
type=int,
|
|
2341
|
+
default=100,
|
|
2342
|
+
help=(
|
|
2343
|
+
'Number of points in each dimension of cube file\n'
|
|
2344
|
+
'Default: %(default)s'
|
|
2345
|
+
)
|
|
2346
|
+
)
|
|
2347
|
+
|
|
2348
|
+
gen_orbs.add_argument(
|
|
2349
|
+
'--memory',
|
|
2350
|
+
'-mem',
|
|
2351
|
+
type=int,
|
|
2352
|
+
default=500,
|
|
2353
|
+
help=(
|
|
2354
|
+
'Per-core Memory to use in MB\n'
|
|
2355
|
+
'Default: %(default)s'
|
|
2356
|
+
)
|
|
2357
|
+
)
|
|
2358
|
+
|
|
2359
|
+
gen_orbs.add_argument(
|
|
2360
|
+
'-om',
|
|
2361
|
+
'--orca_load',
|
|
2362
|
+
type=str,
|
|
2363
|
+
default='',
|
|
2364
|
+
help='Orca environment module (overrides ORTO_ORCA_LOAD envvar)'
|
|
2365
|
+
)
|
|
2366
|
+
|
|
2367
|
+
gen_orbs.add_argument(
|
|
2368
|
+
'--beta',
|
|
2369
|
+
action='store_true',
|
|
2370
|
+
help=(
|
|
2371
|
+
'Plot beta orbitals instead of alpha (for open shell calculations)'
|
|
2372
|
+
)
|
|
2373
|
+
)
|
|
2374
|
+
|
|
2375
|
+
gen_orbs.add_argument(
|
|
2376
|
+
'--no_sub',
|
|
2377
|
+
'-ns',
|
|
2378
|
+
action='store_true',
|
|
2379
|
+
help=(
|
|
2380
|
+
'Disables submission of job to queue'
|
|
2381
|
+
)
|
|
2382
|
+
)
|
|
2383
|
+
|
|
2154
2384
|
gen_spden = gen_parser.add_parser(
|
|
2155
2385
|
'spdens',
|
|
2156
2386
|
aliases=['spin_density', 'spden'],
|
|
@@ -2604,12 +2834,13 @@ def read_args(arg_list=None):
|
|
|
2604
2834
|
)
|
|
2605
2835
|
|
|
2606
2836
|
plot_abs.add_argument(
|
|
2607
|
-
'--
|
|
2608
|
-
|
|
2609
|
-
|
|
2837
|
+
'--legend',
|
|
2838
|
+
type=str,
|
|
2839
|
+
nargs='+',
|
|
2840
|
+
default=None,
|
|
2610
2841
|
help=(
|
|
2611
|
-
'
|
|
2612
|
-
'
|
|
2842
|
+
'Legend labels for each spectrum plotted\n'
|
|
2843
|
+
'If not provided, file names are used\n'
|
|
2613
2844
|
)
|
|
2614
2845
|
)
|
|
2615
2846
|
|
|
@@ -79,7 +79,18 @@ def plot_absorption_spectrum(abs_data: data.AbsorptionData,
|
|
|
79
79
|
raise ValueError('AbsorptionData object does not contain spectrum')
|
|
80
80
|
|
|
81
81
|
if fig is None or ax is None:
|
|
82
|
-
|
|
82
|
+
width = 4
|
|
83
|
+
width_cm = 10.4
|
|
84
|
+
golden = (1 + np.sqrt(5))/2
|
|
85
|
+
fig, ax = plt.subplots(
|
|
86
|
+
1,
|
|
87
|
+
1,
|
|
88
|
+
num=window_title,
|
|
89
|
+
figsize=(width, width / golden)
|
|
90
|
+
)
|
|
91
|
+
else:
|
|
92
|
+
width = fig.get_size_inches()[0]
|
|
93
|
+
width_cm = width * 2.54
|
|
83
94
|
|
|
84
95
|
if oax is None and osc_style == 'separate':
|
|
85
96
|
oax = ax.twinx()
|
|
@@ -143,18 +154,20 @@ def plot_absorption_spectrum(abs_data: data.AbsorptionData,
|
|
|
143
154
|
x_values,
|
|
144
155
|
_y_values,
|
|
145
156
|
color=linecolor,
|
|
157
|
+
lw=1.1,
|
|
146
158
|
label=abs_data.spectrum.comment
|
|
147
159
|
)
|
|
148
160
|
|
|
149
161
|
if osc_style == 'separate':
|
|
150
162
|
# Oscillator strength twin axis
|
|
151
|
-
oax.stem(
|
|
163
|
+
_, stemlines, _ = oax.stem(
|
|
152
164
|
stick_x_values,
|
|
153
165
|
_osc,
|
|
154
166
|
basefmt=' ',
|
|
155
167
|
markerfmt=' ',
|
|
156
168
|
linefmt=stickcolour
|
|
157
169
|
)
|
|
170
|
+
plt.setp(stemlines, 'linewidth', 1.1)
|
|
158
171
|
oax.yaxis.set_minor_locator(AutoMinorLocator())
|
|
159
172
|
if normalise:
|
|
160
173
|
oax.set_ylabel(r'Normalised $f_\mathregular{osc}$')
|
|
@@ -218,6 +231,10 @@ def plot_absorption_spectrum(abs_data: data.AbsorptionData,
|
|
|
218
231
|
f'\nSpectrum saved to\n {save_name}',
|
|
219
232
|
'cyan'
|
|
220
233
|
)
|
|
234
|
+
ut.cprint(
|
|
235
|
+
f'Use width={width:.1f} in. or {width_cm:.1f} cm',
|
|
236
|
+
'cyan'
|
|
237
|
+
)
|
|
221
238
|
|
|
222
239
|
if show:
|
|
223
240
|
plt.show()
|
|
@@ -261,13 +278,18 @@ def plot_chit(chit: ArrayLike, temps: ArrayLike, fields: ArrayLike = None,
|
|
|
261
278
|
Returns
|
|
262
279
|
-------
|
|
263
280
|
plt.Figure
|
|
264
|
-
Matplotlib Figure
|
|
281
|
+
Matplotlib Figure objectwidth
|
|
265
282
|
plt.Axes
|
|
266
283
|
Matplotlib Axis object for plot
|
|
267
284
|
''' # noqa
|
|
268
285
|
|
|
269
286
|
# Create figure and axes
|
|
270
|
-
fig, ax = plt.subplots(
|
|
287
|
+
fig, ax = plt.subplots(
|
|
288
|
+
1,
|
|
289
|
+
1,
|
|
290
|
+
figsize=(4 * (1 + np.sqrt(5))/2, 4),
|
|
291
|
+
num=window_title
|
|
292
|
+
)
|
|
271
293
|
|
|
272
294
|
if fields is None:
|
|
273
295
|
# Plot data as it is
|
orto-1.11.2/orto/__version__.py
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = '1.11.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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|