Skip to content

Commit 796e00a

Browse files
committed
precommit
2 parents 8c2be79 + e813667 commit 796e00a

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
@@ -76,7 +76,8 @@ def set_output_directory(args):
7676

7777

7878
def _expand_user_input(args):
79-
"""Expand the list of inputs by adding files from file lists and wildcards.
79+
"""Expand the list of inputs by adding files from file lists and
80+
wildcards.
8081
8182
Parameters
8283
----------
@@ -112,9 +113,9 @@ def _expand_user_input(args):
112113

113114

114115
def set_input_lists(args):
115-
"""Set input directory and files. It takes cli inputs, checks if they are
116-
files or directories and creates a list of files to be processed which is
117-
stored in the args Namespace.
116+
"""Set input directory and files. It takes cli inputs, checks if
117+
they are files or directories and creates a list of files to be
118+
processed which is stored in the args Namespace.
118119
119120
Parameters
120121
----------
@@ -293,8 +294,8 @@ def set_wavelength(args):
293294

294295

295296
def set_xtype(args):
296-
"""Set the xtype based on the given input arguments, raise an error if
297-
xtype is not one of {*XQUANTITIES, }.
297+
"""Set the xtype based on the given input arguments, raise an error
298+
if xtype is not one of {*XQUANTITIES, }.
298299
299300
Parameters
300301
----------
@@ -349,8 +350,8 @@ def _parse_theoretical_input(input_str):
349350

350351

351352
def _set_theoretical_mud_from_density(args):
352-
"""Theoretical estimation of mu*D from sample composition, energy, and
353-
sample mass density."""
353+
"""Theoretical estimation of mu*D from sample composition, energy,
354+
and sample mass density."""
354355
args = normalize_wavelength(args)
355356
if args.wavelength is None:
356357
args = load_wavelength_from_config_file(args)
@@ -368,8 +369,8 @@ def _set_theoretical_mud_from_density(args):
368369

369370

370371
def _set_theoretical_mud_from_packing(args):
371-
"""Theoretical estimation of mu*D from sample composition, energy, and
372-
packing fraction."""
372+
"""Theoretical estimation of mu*D from sample composition, energy,
373+
and packing fraction."""
373374
sample_composition, energy, packing_fraction = _parse_theoretical_input(
374375
args.theoretical_from_packing
375376
)
@@ -424,8 +425,8 @@ def _load_key_value_pair(s):
424425

425426

426427
def load_user_metadata(args):
427-
"""Load user metadata into args, raise ValueError if it is in incorrect
428-
format.
428+
"""Load user metadata into args, raise ValueError if it is in
429+
incorrect format.
429430
430431
Parameters
431432
----------
@@ -465,8 +466,9 @@ def load_user_metadata(args):
465466

466467
def load_user_info(args):
467468
"""Load user info into args. If none is provided, call
468-
check_and_build_global_config function from diffpy.utils to prompt the user
469-
for inputs. Otherwise, call get_user_info with the provided arguments.
469+
check_and_build_global_config function from diffpy.utils to prompt
470+
the user for inputs. Otherwise, call get_user_info with the provided
471+
arguments.
470472
471473
Parameters
472474
----------
@@ -513,9 +515,9 @@ def load_package_info(args):
513515

514516

515517
def preprocessing_args(args):
516-
"""Perform preprocessing on the provided args. The process includes loading
517-
package and user information, setting input, output, wavelength, anode
518-
type, xtype, mu*D, and loading user metadata.
518+
"""Perform preprocessing on the provided args. The process includes
519+
loading package and user information, setting input, output,
520+
wavelength, anode type, xtype, mu*D, and loading user metadata.
519521
520522
Parameters
521523
----------
@@ -541,8 +543,8 @@ def preprocessing_args(args):
541543

542544
# Update load_metadata to use 'input_directory' consistently:
543545
def load_metadata(args, filepath):
544-
"""Load the relevant metadata from args to write into the header of the
545-
output files.
546+
"""Load the relevant metadata from args to write into the header of
547+
the output files.
546548
547549
Parameters
548550
----------

0 commit comments

Comments
 (0)