orto 1.7.1__tar.gz → 1.8.1__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.7.1
3
+ Version: 1.8.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
@@ -0,0 +1 @@
1
+ __version__ = '1.8.1'
@@ -820,8 +820,11 @@ def plot_abs_func(uargs, save_data_only=False):
820
820
 
821
821
  # Find unique name from multiple file names
822
822
  if len(uargs.output_file) > 1:
823
- base_names = [of.stem for of in uargs.output_file]
824
- unique_names = ut.find_unique_substring(base_names)
823
+ if uargs.unique_names:
824
+ base_names = [of.stem for of in uargs.output_file]
825
+ unique_names = ut.find_unique_substring(base_names)
826
+ else:
827
+ unique_names = [of.stem for of in uargs.output_file]
825
828
  legend = True
826
829
  else:
827
830
  legend = False
@@ -928,6 +931,10 @@ def plot_abs_func(uargs, save_data_only=False):
928
931
  else:
929
932
  x_max = uargs.xlim[1]
930
933
 
934
+ # Trim transitions to a specific number of states if requested
935
+ if uargs.trim_transitions is not None:
936
+ abs_data.trim_to_n(uargs.trim_transitions)
937
+
931
938
  # Generate spectrum
932
939
  abs_data.generate_spectrum(
933
940
  fwhm=uargs.linewidth,
@@ -2016,6 +2023,28 @@ def read_args(arg_list=None):
2016
2023
  )
2017
2024
  )
2018
2025
 
2026
+ gen_abs.add_argument(
2027
+ '--unique_names',
2028
+ action='store_true',
2029
+ default=False,
2030
+ help=(
2031
+ 'Attempt to shorten file names in plot legend\n'
2032
+ 'Default: %(default)s'
2033
+ )
2034
+ )
2035
+
2036
+ gen_abs.add_argument(
2037
+ '--trim_transitions',
2038
+ '-tt',
2039
+ type=int,
2040
+ default=None,
2041
+ help=(
2042
+ 'Trim to first n transitions\n'
2043
+ 'where n is an integer\n'
2044
+ 'Default: %(default)s'
2045
+ )
2046
+ )
2047
+
2019
2048
  plot_subprog = all_subparsers.add_parser(
2020
2049
  'plot',
2021
2050
  description='Plot data from orca file',
@@ -2159,6 +2188,28 @@ def read_args(arg_list=None):
2159
2188
  )
2160
2189
  )
2161
2190
 
2191
+ plot_abs.add_argument(
2192
+ '--unique_names',
2193
+ action='store_true',
2194
+ default=False,
2195
+ help=(
2196
+ 'Attempt to shorten file names in plot legend\n'
2197
+ 'Default: %(default)s'
2198
+ )
2199
+ )
2200
+
2201
+ plot_abs.add_argument(
2202
+ '--trim_transitions',
2203
+ '-tt',
2204
+ type=int,
2205
+ default=None,
2206
+ help=(
2207
+ 'Trim to first n transitions\n'
2208
+ 'where n is an integer\n'
2209
+ 'Default: %(default)s'
2210
+ )
2211
+ )
2212
+
2162
2213
  plot_xes = plot_parser.add_parser(
2163
2214
  'xes',
2164
2215
  description='Plots XES from CI calculation output',
@@ -181,6 +181,27 @@ class AbsorptionData():
181
181
  self._spectrum = spectrum
182
182
  return
183
183
 
184
+ def trim_to_n(self, n_transitions: int) -> None:
185
+ '''
186
+ Trims data to given number of transitions
187
+
188
+ Parameters
189
+ ----------
190
+ n_transitions: int
191
+ Number of transitions to keep from the start of the data
192
+
193
+ Returns
194
+ -------
195
+ None
196
+ '''
197
+
198
+ self.energies = self.energies[:n_transitions]
199
+ self.osc_strengths = self.osc_strengths[:n_transitions]
200
+
201
+ self.spectrum = None
202
+
203
+ return
204
+
184
205
  @classmethod
185
206
  def from_extractor(cls, extractor: oe.AbsorptionExtractor,
186
207
  remove_zero_osc: float = 1E-4) -> list['AbsorptionData']: # noqa
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: orto
3
- Version: 1.7.1
3
+ Version: 1.8.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
@@ -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.7.1'
11
+ __version__ = '1.8.1'
12
12
 
13
13
  setuptools.setup(
14
14
  name='orto',
@@ -1 +0,0 @@
1
- __version__ = '1.7.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
File without changes