orto 1.1.0__tar.gz → 1.2.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,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: orto
3
- Version: 1.1.0
3
+ Version: 1.2.0
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
@@ -15,7 +15,7 @@ Description-Content-Type: text/markdown
15
15
  Requires-Dist: numpy>=2.1.2
16
16
  Requires-Dist: xyz_py>=5.13.1
17
17
  Requires-Dist: matplotlib>=3.9.2
18
- Requires-Dist: extto>=1.0.0
18
+ Requires-Dist: extto>=1.0.1
19
19
  Requires-Dist: pandas>=2.2.3
20
20
  Requires-Dist: subto>=0.1.1
21
21
  Requires-Dist: python-docx>=1.1.2
@@ -0,0 +1 @@
1
+ __version__ = '1.2.0'
@@ -857,9 +857,22 @@ def extract_orbs_func(uargs, save=True) -> None:
857
857
  dtype=int
858
858
  )
859
859
  ])
860
+ elif uargs.num is not None:
861
+ keep = uargs.num
860
862
  else:
861
863
  keep = range(len(contributions))
862
864
 
865
+ # Remove orbital indices which do not exist
866
+ keep = [val for val in keep if val < len(contributions)]
867
+
868
+ if not len(keep):
869
+ ut.red_exit(
870
+ (
871
+ r'Selected orbital indices do not exist!'
872
+ f'\nNORBS = {len(contributions):d}'
873
+ )
874
+ )
875
+
863
876
  contributions = contributions.loc[:, keep]
864
877
 
865
878
  # Remove contributions from unwanted orbitals
@@ -2080,13 +2093,37 @@ def read_args(arg_list=None):
2080
2093
  )
2081
2094
  )
2082
2095
 
2096
+ def gte_zero(x):
2097
+ '''
2098
+ Custom type for argparse to ensure that the input
2099
+ \nis greater than or equal to zero
2100
+ '''
2101
+ value = int(x)
2102
+ if value < 0:
2103
+ raise argparse.ArgumentTypeError(
2104
+ f'{x} is not a valid index (must be >= 0)'
2105
+ )
2106
+ return value
2107
+
2108
+ orb_group.add_argument(
2109
+ '-n',
2110
+ '--num',
2111
+ nargs='+',
2112
+ type=gte_zero,
2113
+ metavar='NUMBER',
2114
+ default=None,
2115
+ help=(
2116
+ 'Print specified orbitals using index starting from 0\n'
2117
+ '(same as Orca)\n'
2118
+ )
2119
+ )
2120
+
2083
2121
  orb_group.add_argument(
2084
2122
  '-hl',
2085
2123
  '--homo_lumo',
2086
2124
  nargs='?',
2087
2125
  type=int,
2088
2126
  metavar='NUMBER',
2089
- const=0,
2090
2127
  default=None,
2091
2128
  help=(
2092
2129
  'Print specified number of orbitals either side of HOMO and LUMO'
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: orto
3
- Version: 1.1.0
3
+ Version: 1.2.0
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
@@ -15,7 +15,7 @@ Description-Content-Type: text/markdown
15
15
  Requires-Dist: numpy>=2.1.2
16
16
  Requires-Dist: xyz_py>=5.13.1
17
17
  Requires-Dist: matplotlib>=3.9.2
18
- Requires-Dist: extto>=1.0.0
18
+ Requires-Dist: extto>=1.0.1
19
19
  Requires-Dist: pandas>=2.2.3
20
20
  Requires-Dist: subto>=0.1.1
21
21
  Requires-Dist: python-docx>=1.1.2
@@ -1,7 +1,7 @@
1
1
  numpy>=2.1.2
2
2
  xyz_py>=5.13.1
3
3
  matplotlib>=3.9.2
4
- extto>=1.0.0
4
+ extto>=1.0.1
5
5
  pandas>=2.2.3
6
6
  subto>=0.1.1
7
7
  python-docx>=1.1.2
@@ -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.1.0'
11
+ __version__ = '1.2.0'
12
12
 
13
13
  setuptools.setup(
14
14
  name='orto',
@@ -35,7 +35,7 @@ setuptools.setup(
35
35
  'numpy>=2.1.2',
36
36
  'xyz_py>=5.13.1',
37
37
  'matplotlib>=3.9.2',
38
- 'extto>=1.0.0',
38
+ 'extto>=1.0.1',
39
39
  'pandas>=2.2.3',
40
40
  'subto>=0.1.1',
41
41
  'python-docx>=1.1.2'
@@ -1 +0,0 @@
1
- __version__ = '1.1.0'
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