orto 1.11.1__tar.gz → 1.11.2__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,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: orto
3
- Version: 1.11.1
3
+ Version: 1.11.2
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
@@ -0,0 +1 @@
1
+ __version__ = '1.11.2'
@@ -929,6 +929,8 @@ def plot_xes_func(uargs):
929
929
  x_values = np.asarray(data['energy (cm^-1)'])
930
930
  elif uargs.x_unit == 'wavelength':
931
931
  x_values = 1E7 / np.asarray(data['energy (cm^-1)'])
932
+ elif uargs.x_unit == 'wavelength_rev':
933
+ x_values = 1E7 / np.asarray(data['energy (cm^-1)'])
932
934
  elif uargs.x_unit == 'energy':
933
935
  x_values = np.asarray(data['energy (ev)'])
934
936
 
@@ -1202,14 +1204,23 @@ def plot_abs_func(uargs, save_data_only=False):
1202
1204
  x_vals = abs_data.wavenumbers
1203
1205
  min_factor = 0.8
1204
1206
  max_factor = 1.1
1207
+ x_reversed = False
1205
1208
  elif uargs.x_unit == 'wavelength':
1206
1209
  x_vals = abs_data.wavelengths
1207
1210
  max_factor = 1.1
1208
1211
  min_factor = 0.8
1212
+ x_reversed = False
1213
+ elif uargs.x_unit == 'wavelength_rev':
1214
+ x_vals = abs_data.wavelengths
1215
+ max_factor = 1.1
1216
+ min_factor = 0.8
1217
+ x_reversed = True
1218
+ uargs.x_unit = 'wavelength'
1209
1219
  elif uargs.x_unit == 'energy':
1210
1220
  x_vals = abs_data.energies
1211
1221
  min_factor = 0.9995
1212
1222
  max_factor = 1.0005
1223
+ x_reversed = False
1213
1224
 
1214
1225
  # Set x_min and x_max
1215
1226
  if isinstance(uargs.x_lim[0], str):
@@ -1244,7 +1255,8 @@ def plot_abs_func(uargs, save_data_only=False):
1244
1255
  num_points=10000,
1245
1256
  x_min=x_min,
1246
1257
  x_max=x_max,
1247
- comment=unique_names[it]
1258
+ comment=unique_names[it],
1259
+ x_reversed=x_reversed
1248
1260
  )
1249
1261
 
1250
1262
  if save_data_only:
@@ -2540,9 +2552,9 @@ def read_args(arg_list=None):
2540
2552
  plot_abs.add_argument(
2541
2553
  '--x_unit',
2542
2554
  type=str,
2543
- choices=['energy', 'wavelength', 'wavenumber'],
2555
+ choices=['energy', 'wavelength', 'wavelength_rev', 'wavenumber'],
2544
2556
  default='energy',
2545
- help='x units to use for spectrum'
2557
+ help='x units to use for spectrum (rev = reversed axis direction)'
2546
2558
  )
2547
2559
 
2548
2560
  plot_abs.add_argument(
@@ -33,6 +33,9 @@ class AbsorptionSpectrum():
33
33
  Full width at half maximum used in spectrum generation
34
34
  comment: str, default=''
35
35
  Comment or metadata for the spectrum
36
+ x_reversed: bool, default False
37
+ Whether the x axis is reversed (e.g. for wavelength spectra)\n
38
+ By default, False - increasing x values from left to right
36
39
 
37
40
  Attributes
38
41
  ----------
@@ -61,7 +64,7 @@ class AbsorptionSpectrum():
61
64
  def __init__(self, x_grid: NDArray, x_unit: str, x_label: str,
62
65
  x_label_mathmode: str, y_unit: str, y_label: str,
63
66
  y_label_mathmode: str, y_values: NDArray, fwhm: float,
64
- comment: str = '') -> None:
67
+ comment: str = '', x_reversed: bool = False) -> None:
65
68
  self.x_grid = x_grid
66
69
  self.x_unit = x_unit
67
70
  self.x_label = x_label
@@ -72,30 +75,9 @@ class AbsorptionSpectrum():
72
75
  self.fwhm = fwhm
73
76
  self.y_values = y_values
74
77
  self.comment = comment
78
+ self.x_reversed = x_reversed
75
79
  return
76
80
 
77
- @classmethod
78
- def from_data(cls, x_grid: NDArray, y_values: NDArray,
79
- fwhm: float) -> 'AbsorptionSpectrum':
80
- '''
81
- Creates AbsorptionSpectrum object from data
82
-
83
- Parameters
84
- ----------
85
- x_grid: NDArray
86
- Grid of x values (energies, wavelengths, or wavenumbers)
87
- y_values: NDArray
88
- Absorption spectrum values at each point in x_grid
89
- fwhm: float
90
- Full width at half maximum used in spectrum generation
91
-
92
- Returns
93
- -------
94
- AbsorptionSpectrum
95
- Created AbsorptionSpectrum object
96
- '''
97
- return cls(x_grid, y_values, fwhm)
98
-
99
81
 
100
82
  class AbsorptionData():
101
83
  '''
@@ -282,7 +264,8 @@ class AbsorptionData():
282
264
  def generate_spectrum(self, fwhm: float, lineshape: str, x_min: float,
283
265
  x_max: float, num_points: int,
284
266
  x_type: str = 'energy',
285
- comment: str = '') -> AbsorptionSpectrum:
267
+ comment: str = '',
268
+ x_reversed: bool = False) -> AbsorptionSpectrum:
286
269
  '''
287
270
  Generates absorption spectrum using Gaussian broadening
288
271
 
@@ -306,6 +289,9 @@ class AbsorptionData():
306
289
  'wavenumber' (cm^-1)
307
290
  comment: str
308
291
  Comment to add to spectrum metadata
292
+ x_reversed: bool
293
+ Whether to reverse the x axis (e.g. for wavelength spectra)\n
294
+ By default, False - increasing x values from left to right
309
295
 
310
296
  Returns
311
297
  -------
@@ -387,7 +373,8 @@ class AbsorptionData():
387
373
  y_label_mathmode=y_label_mathmode,
388
374
  y_values=y_vals,
389
375
  fwhm=fwhm,
390
- comment=comment
376
+ comment=comment,
377
+ x_reversed=x_reversed
391
378
  )
392
379
 
393
380
  self.spectrum = spectrum
@@ -118,7 +118,6 @@ def plot_absorption_spectrum(abs_data: data.AbsorptionData,
118
118
  ax.set_ylabel(abs_data.spectrum.y_label_mathmode)
119
119
 
120
120
  if abs_data.spectrum.x_label.split()[0].lower() == 'wavelength':
121
- ax.invert_xaxis()
122
121
  stick_x_values = [
123
122
  wavelength + x_shift
124
123
  for wavelength in abs_data.wavelengths
@@ -134,6 +133,9 @@ def plot_absorption_spectrum(abs_data: data.AbsorptionData,
134
133
  for wavenumber in abs_data.wavenumbers
135
134
  ]
136
135
 
136
+ if abs_data.spectrum.x_reversed:
137
+ ax.invert_xaxis()
138
+
137
139
  x_values = abs_data.spectrum.x_grid + x_shift
138
140
 
139
141
  # Main spectrum
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: orto
3
- Version: 1.11.1
3
+ Version: 1.11.2
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
@@ -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__ = '1.11.1'
11
+ __version__ = '1.11.2'
12
12
 
13
13
  setuptools.setup(
14
14
  name='orto',
@@ -1 +0,0 @@
1
- __version__ = '1.11.1'
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