qrotor 4.2.2__tar.gz → 4.3.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.

Potentially problematic release.


This version of qrotor might be problematic. Click here for more details.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: qrotor
3
- Version: 4.2.2
3
+ Version: 4.3.0
4
4
  Summary: QRotor
5
5
  Author: Pablo Gila-Herranz
6
6
  Author-email: pgila001@ikasle.ehu.eus
@@ -11,5 +11,5 @@ https://semver.org/
11
11
  ---
12
12
  """
13
13
 
14
- __version__ = "v4.2.2"
14
+ __version__ = "v4.3.0"
15
15
 
@@ -49,7 +49,7 @@ from copy import deepcopy
49
49
  from scipy.interpolate import CubicSpline
50
50
  import aton.alias as alias
51
51
  import aton.file as file
52
- import aton.api.qe as qe
52
+ import aton.api.pwx as pwx
53
53
  from ._version import __version__
54
54
 
55
55
 
@@ -196,8 +196,8 @@ def from_qe(
196
196
  energy:str='meV',
197
197
  comment:str=None,
198
198
  ) -> System:
199
- """Compiles a rotational potential CSV file from Quantum ESPRESSO outputs,
200
- created with `qrotor.rotate.structure_qe()`.
199
+ """Compiles a rotational potential CSV file from Quantum ESPRESSO pw.x outputs,
200
+ created with `qrotor.rotate.input_qe()`.
201
201
  Returns a `System` object with the new potential values.
202
202
 
203
203
  The angle in degrees is extracted from the output filenames,
@@ -227,7 +227,7 @@ def from_qe(
227
227
  # Set header
228
228
  potential_data = f'## {comment}\n' if comment else f'## {folder_name}\n'
229
229
  potential_data += '# Rotational potential dataset\n'
230
- potential_data += f'# Calculated with QE using QRotor {__version__}\n'
230
+ potential_data += f'# Calculated with QE pw.x using QRotor {__version__}\n'
231
231
  potential_data += '# https://pablogila.github.io/qrotor\n'
232
232
  potential_data += '#\n'
233
233
  if energy.lower() in alias.units['eV']:
@@ -249,7 +249,7 @@ def from_qe(
249
249
  file_path = file.get(filepath=file_path, include='.out', return_anyway=True)
250
250
  if not file_path: # Not an output file, skip it
251
251
  continue
252
- content = qe.read_out(file_path)
252
+ content = pwx.read_out(file_path)
253
253
  if not content['Success']: # Ignore unsuccessful calculations
254
254
  print(f'x {filename}')
255
255
  counter_errors += 1
@@ -9,7 +9,7 @@ Works with Quantum ESPRESSO input files.
9
9
 
10
10
  | | |
11
11
  | --- | --- |
12
- | `structure_qe()` | Rotate specific atoms from a Quantum ESPRESSO input file |
12
+ | `input_qe()` | Rotate specific atoms from a Quantum ESPRESSO input file |
13
13
  | `rotate_coords()` | Rotate a specific list of coordinates |
14
14
 
15
15
  ---
@@ -26,7 +26,7 @@ import aton.txt.extract as extract
26
26
  import aton.txt.edit as edit
27
27
 
28
28
 
29
- def structure_qe(
29
+ def input_qe(
30
30
  filepath:str,
31
31
  positions:list,
32
32
  angle:float,
@@ -66,13 +66,13 @@ def structure_qe(
66
66
  lines = []
67
67
  full_positions = []
68
68
  for position in positions:
69
- line = api.qe.get_atom(filepath, position, precision)
69
+ line = api.pwx.get_atom(filepath, position, precision)
70
70
  lines.append(line)
71
71
  pos = extract.coords(line)
72
72
  if len(pos) > 3: # Keep only the first three coordinates
73
73
  pos = pos[:3]
74
74
  # Convert to cartesian
75
- pos_cartesian = api.qe.to_cartesian(filepath, pos)
75
+ pos_cartesian = api.pwx.to_cartesian(filepath, pos)
76
76
  full_positions.append(pos_cartesian)
77
77
  print(f'Found atom: "{line}"')
78
78
  # Set the angles to rotate
@@ -92,7 +92,7 @@ def structure_qe(
92
92
  rotated_positions_cartesian = rotate_coords(full_positions, angle, use_centroid, show_axis)
93
93
  rotated_positions = []
94
94
  for coord in rotated_positions_cartesian:
95
- pos = api.qe.from_cartesian(filepath, coord)
95
+ pos = api.pwx.from_cartesian(filepath, coord)
96
96
  rotated_positions.append(pos)
97
97
  _save_qe(filepath, output, lines, rotated_positions)
98
98
  outputs.append(output)
@@ -184,7 +184,7 @@ def _save_qe(
184
184
  additional_positions = positions[-2:]
185
185
  for pos in additional_positions:
186
186
  pos.insert(0, 'He')
187
- api.qe.add_atom(output, pos)
187
+ api.pwx.add_atom(output, pos)
188
188
  elif len(lines) != len(positions):
189
189
  raise ValueError(f"What?! len(lines)={len(lines)} and len(positions)={len(positions)}")
190
190
  # Add angle to calculation prefix
@@ -192,11 +192,11 @@ def _save_qe(
192
192
  splits = output_name.split('_')
193
193
  angle_str = splits[-1].replace('.in', '')
194
194
  prefix = ''
195
- content = api.qe.read_in(output)
195
+ content = api.pwx.read_in(output)
196
196
  if 'prefix' in content.keys():
197
197
  prefix = content['prefix']
198
198
  prefix = prefix.strip("'")
199
199
  prefix = "'" + prefix + angle_str + "'"
200
- api.qe.set_value(output, 'prefix', prefix)
200
+ api.pwx.set_value(output, 'prefix', prefix)
201
201
  return output
202
202
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: qrotor
3
- Version: 4.2.2
3
+ Version: 4.3.0
4
4
  Summary: QRotor
5
5
  Author: Pablo Gila-Herranz
6
6
  Author-email: pgila001@ikasle.ehu.eus
@@ -15,7 +15,6 @@ qrotor.egg-info/SOURCES.txt
15
15
  qrotor.egg-info/dependency_links.txt
16
16
  qrotor.egg-info/requires.txt
17
17
  qrotor.egg-info/top_level.txt
18
- tests/__init__.py
19
18
  tests/test_constants.py
20
19
  tests/test_potential.py
21
20
  tests/test_rotate.py
@@ -1,2 +1 @@
1
1
  qrotor
2
- tests
@@ -17,9 +17,9 @@ def test_rotate():
17
17
  '0.118 0.816 0.277',
18
18
  ]
19
19
  # 120 degrees (it should remain the same)
20
- qr.rotate.structure_qe(filepath=structure, positions=CH3, angle=120, precision=2)
20
+ qr.rotate.input_qe(filepath=structure, positions=CH3, angle=120, precision=2)
21
21
  for coord in CH3:
22
- rotated_coord = api.qe.get_atom(filepath=structure_120, position=coord, precision=2)
22
+ rotated_coord = api.pwx.get_atom(filepath=structure_120, position=coord, precision=2)
23
23
  rotated_coord = extract.coords(rotated_coord)
24
24
  coord = extract.coords(coord)
25
25
  rotated_coord_rounded = []
@@ -37,9 +37,9 @@ def test_rotate():
37
37
  '0.095062781582172 0.488975944606740 0.115053787468686',
38
38
  '0.128156574395412 0.205890189020629 0.680672454316303',
39
39
  ]
40
- qr.rotate.structure_qe(filepath=structure, positions=CH3, angle=60, precision=2)
40
+ qr.rotate.input_qe(filepath=structure, positions=CH3, angle=60, precision=2)
41
41
  for coord in ideal:
42
- rotated_coord = api.qe.get_atom(filepath=structure_60, position=coord, precision=3)
42
+ rotated_coord = api.pwx.get_atom(filepath=structure_60, position=coord, precision=3)
43
43
  rotated_coord = extract.coords(rotated_coord)
44
44
  coord = extract.coords(coord)
45
45
  rotated_coord_rounded = []
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