Skip to content

Commit 0d52dc5

Browse files
[pre-commit.ci] auto fixes from pre-commit hooks
1 parent fbcbe79 commit 0d52dc5

File tree

2 files changed

+36
-33
lines changed

2 files changed

+36
-33
lines changed

src/diffpy/labpdfproc/functions.py

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ def __init__(
4040
self._get_grid_points()
4141

4242
def _get_grid_points(self):
43-
"""Given a radius and a grid size, return a grid of points to uniformly
44-
sample that circle."""
43+
"""Given a radius and a grid size, return a grid of points to
44+
uniformly sample that circle."""
4545
xs = np.linspace(-self.radius, self.radius, self.npoints)
4646
ys = np.linspace(-self.radius, self.radius, self.npoints)
4747
self.grid = {
@@ -50,8 +50,8 @@ def _get_grid_points(self):
5050
self.total_points_in_grid = len(self.grid)
5151

5252
def _get_entry_exit_coordinates(self, coordinate, angle):
53-
"""Get the coordinates where the beam enters and leaves the circle for
54-
a given angle and grid point.
53+
"""Get the coordinates where the beam enters and leaves the
54+
circle for a given angle and grid point.
5555
5656
It is calculated in the following way:
5757
For the entry coordinate,
@@ -108,8 +108,9 @@ def _get_entry_exit_coordinates(self, coordinate, angle):
108108
return entry_point, exit_point
109109

110110
def _get_path_length(self, grid_point, angle):
111-
"""Return the path length of a horizontal line entering the circle at
112-
the same height to the grid point then exiting at angle.
111+
"""Return the path length of a horizontal line entering the
112+
circle at the same height to the grid point then exiting at
113+
angle.
113114
114115
Parameters
115116
----------
@@ -136,8 +137,8 @@ def _get_path_length(self, grid_point, angle):
136137
return total_distance, primary_distance, secondary_distance
137138

138139
def set_distances_at_angle(self, angle):
139-
"""Given an angle, set the distances from the grid points to the entry
140-
and exit coordinates.
140+
"""Given an angle, set the distances from the grid points to the
141+
entry and exit coordinates.
141142
142143
Parameters
143144
----------
@@ -170,8 +171,8 @@ def set_muls_at_angle(self, angle):
170171

171172

172173
def _cve_brute_force(input_pattern, mud):
173-
"""Compute cve for the given mud on a global grid using the brute-force
174-
method.
174+
"""Compute cve for the given mud on a global grid using the brute-
175+
force method.
175176
176177
Assume mu=mud/2, given that the same mu*D yields the same cve and
177178
D/2=1.
@@ -202,8 +203,8 @@ def _cve_brute_force(input_pattern, mud):
202203

203204

204205
def _cve_polynomial_interpolation(input_pattern, mud):
205-
"""Compute cve using polynomial interpolation method, default to brute-
206-
force computation if mu*D is out of the range (0.5 to 7)."""
206+
"""Compute cve using polynomial interpolation method, default to
207+
brute- force computation if mu*D is out of the range (0.5 to 7)."""
207208
if mud > 7 or mud < 0.5:
208209
warnings.warn(
209210
f"Input mu*D = {mud} is out of the acceptable range "
@@ -286,8 +287,8 @@ def compute_cve(
286287

287288

288289
def apply_corr(input_pattern, absorption_correction):
289-
"""Apply absorption correction to the given diffraction object with the
290-
correction diffraction object.
290+
"""Apply absorption correction to the given diffraction object with
291+
the correction diffraction object.
291292
292293
Parameters
293294
----------

src/diffpy/labpdfproc/tools.py

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,8 @@ def set_output_directory(args):
7979

8080

8181
def _expand_user_input(args):
82-
"""Expand the list of inputs by adding files from file lists and wildcards.
82+
"""Expand the list of inputs by adding files from file lists and
83+
wildcards.
8384
8485
Parameters
8586
----------
@@ -115,9 +116,9 @@ def _expand_user_input(args):
115116

116117

117118
def set_input_lists(args):
118-
"""Set input directory and files. It takes cli inputs, checks if they are
119-
files or directories and creates a list of files to be processed which is
120-
stored in the args Namespace.
119+
"""Set input directory and files. It takes cli inputs, checks if
120+
they are files or directories and creates a list of files to be
121+
processed which is stored in the args Namespace.
121122
122123
Parameters
123124
----------
@@ -278,8 +279,8 @@ def set_wavelength(args):
278279

279280

280281
def set_xtype(args):
281-
"""Set the xtype based on the given input arguments, raise an error if
282-
xtype is not one of {*XQUANTITIES, }.
282+
"""Set the xtype based on the given input arguments, raise an error
283+
if xtype is not one of {*XQUANTITIES, }.
283284
284285
Parameters
285286
----------
@@ -334,8 +335,8 @@ def _parse_theoretical_input(input_str):
334335

335336

336337
def _set_theoretical_mud_from_density(args):
337-
"""Theoretical estimation of mu*D from sample composition, energy, and
338-
sample mass density."""
338+
"""Theoretical estimation of mu*D from sample composition, energy,
339+
and sample mass density."""
339340
sample_composition, energy, sample_mass_density = _parse_theoretical_input(
340341
args.theoretical_from_density
341342
)
@@ -351,8 +352,8 @@ def _set_theoretical_mud_from_density(args):
351352

352353

353354
def _set_theoretical_mud_from_packing(args):
354-
"""Theoretical estimation of mu*D from sample composition, energy, and
355-
packing fraction."""
355+
"""Theoretical estimation of mu*D from sample composition, energy,
356+
and packing fraction."""
356357
sample_composition, energy, packing_fraction = _parse_theoretical_input(
357358
args.theoretical_from_packing
358359
)
@@ -404,8 +405,8 @@ def _load_key_value_pair(s):
404405

405406

406407
def load_user_metadata(args):
407-
"""Load user metadata into args, raise ValueError if it is in incorrect
408-
format.
408+
"""Load user metadata into args, raise ValueError if it is in
409+
incorrect format.
409410
410411
Parameters
411412
----------
@@ -445,8 +446,9 @@ def load_user_metadata(args):
445446

446447
def load_user_info(args):
447448
"""Load user info into args. If none is provided, call
448-
check_and_build_global_config function from diffpy.utils to prompt the user
449-
for inputs. Otherwise, call get_user_info with the provided arguments.
449+
check_and_build_global_config function from diffpy.utils to prompt
450+
the user for inputs. Otherwise, call get_user_info with the provided
451+
arguments.
450452
451453
Parameters
452454
----------
@@ -493,9 +495,9 @@ def load_package_info(args):
493495

494496

495497
def preprocessing_args(args):
496-
"""Perform preprocessing on the provided args. The process includes loading
497-
package and user information, setting input, output, wavelength, anode
498-
type, xtype, mu*D, and loading user metadata.
498+
"""Perform preprocessing on the provided args. The process includes
499+
loading package and user information, setting input, output,
500+
wavelength, anode type, xtype, mu*D, and loading user metadata.
499501
500502
Parameters
501503
----------
@@ -519,8 +521,8 @@ def preprocessing_args(args):
519521

520522

521523
def load_metadata(args, filepath):
522-
"""Load the relevant metadata from args to write into the header of the
523-
output files.
524+
"""Load the relevant metadata from args to write into the header of
525+
the output files.
524526
525527
Parameters
526528
----------

0 commit comments

Comments
 (0)