Skip to content

Commit 149bc28

Browse files
committed
fix max line length error and docstring spacing
1 parent cc1f074 commit 149bc28

File tree

2 files changed

+38
-31
lines changed

2 files changed

+38
-31
lines changed

src/diffpy/pdfmorph/pdfmorph_io.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@ def single_morph_output(
4848
morph_file
4949
Name of the morphed PDF file. Required when printing to a non-terminal file.
5050
param xy_out: list
51-
List of the form [x_morph_out, y_morph_out]. x_morph_out is a List of r values and y_morph_out is a List of gr values.
51+
List of the form [x_morph_out, y_morph_out]. x_morph_out is a List of r values and
52+
y_morph_out is a List of gr values.
5253
verbose: bool
5354
Print additional details about the morph when True (default False).
5455
stdout_flag: bool

src/diffpy/pdfmorph/pdfmorphapp.py

Lines changed: 36 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@ def custom_error(self, msg):
6464
metavar="NAME",
6565
dest="slocation",
6666
help="""Save the manipulated PDF to a file named NAME. Use \'-\' for stdout.
67-
When --multiple is enabled, save each manipulated PDF as a file in a directory named NAME;
68-
you can specify names for each saved PDF file using --save-names-file.""",
67+
When --multiple is enabled, save each manipulated PDF as a file in a directory named NAME;
68+
you can specify names for each saved PDF file using --save-names-file.""",
6969
)
7070
parser.add_option(
7171
"-v",
@@ -87,31 +87,31 @@ def custom_error(self, msg):
8787
action="store_true",
8888
dest="addpearson",
8989
help="""Maximize agreement in the Pearson function as well as
90-
minimizing the residual.""",
90+
minimizing the residual.""",
9191
)
9292

9393
group = optparse.OptionGroup(
9494
parser,
9595
"Multiple Morphs",
9696
"""This program can morph a PDF against multiple targets in one command.
97-
See -s and Plot Options for how saving and plotting functionality changes when performing multiple morphs.""",
97+
See -s and Plot Options for how saving and plotting functionality changes when performing multiple morphs.""",
9898
)
9999
parser.add_option_group(group)
100100
group.add_option(
101101
"--multiple",
102102
dest="multiple",
103103
action="store_true",
104104
help=f"""Changes usage to \'{prog_short} [options] FILE DIRECTORY\'. FILE
105-
will be morphed with each file in DIRECTORY as target.
106-
Files in DIRECTORY are sorted by alphabetical order unless a field is
107-
specified by --sort-by.""",
105+
will be morphed with each file in DIRECTORY as target.
106+
Files in DIRECTORY are sorted by alphabetical order unless a field is
107+
specified by --sort-by.""",
108108
)
109109
group.add_option(
110110
"--sort-by",
111111
metavar="FIELD",
112112
dest="field",
113113
help="""Used with --multiple to sort files in DIRECTORY by FIELD from lowest to highest.
114-
FIELD must be included in the header of all the PDF files.""",
114+
FIELD must be included in the header of all the PDF files.""",
115115
)
116116
group.add_option(
117117
"--reverse",
@@ -124,39 +124,39 @@ def custom_error(self, msg):
124124
metavar="SERIALFILE",
125125
dest="serfile",
126126
help="""Look for FIELD in a serial file instead.
127-
Must specify name of serial file SERIALFILE.""",
127+
Must specify name of serial file SERIALFILE.""",
128128
)
129129
group.add_option(
130130
"--save-names-file",
131131
metavar="NAMESFILE",
132132
dest="snamesfile",
133133
help=f"""Used when both -s and --multiple are enabled.
134-
Specify names for each manipulated PDF when saving (see -s) using a serial file
135-
NAMESFILE. The format of NAMESFILE should be as follows: each target PDF
136-
is an entry in NAMESFILE. For each entry, there should be a key {__save_morph_as__}
137-
whose value specifies the name to save the manipulated PDF as.
134+
Specify names for each manipulated PDF when saving (see -s) using a serial file
135+
NAMESFILE. The format of NAMESFILE should be as follows: each target PDF
136+
is an entry in NAMESFILE. For each entry, there should be a key {__save_morph_as__}
137+
whose value specifies the name to save the manipulated PDF as.
138138
(See sample names files in the PDFmorph tutorial).""",
139139
)
140140
group.add_option(
141141
"--plot-parameter",
142142
metavar="PLOTPARAM",
143143
dest="plotparam",
144144
help="""Used when both plotting and --multiple are enabled.
145-
Choose a PLOTPARAM to plot for each morph (i.e. adding --pp=Pearson means the program
146-
will display a plot of the Pearson correlation coefficient for each morph-target pair).
147-
PLOTPARAM is not case sensitive, so both Pearson and pearson indicate the same parameter.
148-
When PLOTPARAM is not specified, Rw values for each morph-target pair will be plotted.
149-
PLOTPARAM will be displayed as the vertical axis label for the plot.""",
145+
Choose a PLOTPARAM to plot for each morph (i.e. adding --pp=Pearson means the program
146+
will display a plot of the Pearson correlation coefficient for each morph-target pair).
147+
PLOTPARAM is not case sensitive, so both Pearson and pearson indicate the same parameter.
148+
When PLOTPARAM is not specified, Rw values for each morph-target pair will be plotted.
149+
PLOTPARAM will be displayed as the vertical axis label for the plot.""",
150150
)
151151

152152
# Manipulations
153153
group = optparse.OptionGroup(
154154
parser,
155155
"Manipulations",
156156
"""These options select the manipulations that are to be applied to
157-
the PDF from FILE1. The passed values will be refined unless specifically
158-
excluded with the -a or -x options. If no option is specified, the PDFs from FILE1 and FILE2 will
159-
be plotted without any manipulations.""",
157+
the PDF from FILE1. The passed values will be refined unless specifically
158+
excluded with the -a or -x options. If no option is specified, the PDFs from FILE1 and FILE2 will
159+
be plotted without any manipulations.""",
160160
)
161161
parser.add_option_group(group)
162162
group.add_option(
@@ -173,7 +173,7 @@ def custom_error(self, msg):
173173
dest="exclude",
174174
metavar="MANIP",
175175
help="""Exclude a manipulation from refinement by name. This can
176-
appear multiple times.""",
176+
appear multiple times.""",
177177
)
178178
group.add_option("--scale", type="float", metavar="SCALE", help="Apply scale factor SCALE.")
179179
group.add_option(
@@ -193,7 +193,7 @@ def custom_error(self, msg):
193193
type="float",
194194
dest="baselineslope",
195195
help="""Slope of the baseline. This is used when applying the smear
196-
factor. It will be estimated if not provided.""",
196+
factor. It will be estimated if not provided.""",
197197
)
198198
group.add_option(
199199
"--qdamp",
@@ -206,36 +206,42 @@ def custom_error(self, msg):
206206
type="float",
207207
metavar="RADIUS",
208208
help="""Apply characteristic function of sphere with radius RADIUS.
209-
If PRADIUS is also specified, instead apply characteristic function of spheroid with equatorial radius RADIUS and polar radius PRADIUS.""",
209+
If PRADIUS is also specified, instead apply characteristic function of spheroid with equatorial
210+
radius RADIUS and polar radius PRADIUS.""",
210211
)
211212
group.add_option(
212213
"--pradius",
213214
type="float",
214215
metavar="PRADIUS",
215216
help="""Apply characteristic function of spheroid with equatorial
216-
radius RADIUS and polar radius PRADIUS. If only PRADIUS is specified, instead apply characteristic function of sphere with radius PRADIUS.""",
217+
radius RADIUS and polar radius PRADIUS. If only PRADIUS is specified, instead apply
218+
characteristic function of sphere with radius PRADIUS.""",
217219
)
218220
group.add_option(
219221
"--iradius",
220222
type="float",
221223
metavar="IRADIUS",
222-
help="""Apply inverse characteristic function of sphere with radius IRADIUS. If IPRADIUS is also specified, instead apply inverse characteristic function of spheroid with equatorial radius IRADIUS and polar radius IPRADIUS.""",
224+
help="""Apply inverse characteristic function of sphere with radius IRADIUS.
225+
If IPRADIUS is also specified, instead apply inverse characteristic function of spheroid
226+
with equatorial radius IRADIUS and polar radius IPRADIUS.""",
223227
)
224228
group.add_option(
225229
"--ipradius",
226230
type="float",
227231
metavar="IPRADIUS",
228-
help="""Apply inverse characteristic function of spheroid with equatorial radius IRADIUS and polar radius IPRADIUS. If only IPRADIUS is specified, instead apply inverse characteristic function of sphere with radius IPRADIUS.""",
232+
help="""Apply inverse characteristic function of spheroid with equatorial radius IRADIUS
233+
and polar radius IPRADIUS. If only IPRADIUS is specified, instead apply inverse characteristic
234+
function of sphere with radius IPRADIUS.""",
229235
)
230236

231237
# Plot Options
232238
group = optparse.OptionGroup(
233239
parser,
234240
"Plot Options",
235241
"""These options control plotting.
236-
The manipulated and target PDFs will be plotted against each other with a
237-
difference curve below. When --multiple is enabled, the value of a parameter (specified by
238-
--plot-parameter) will be plotted instead.""",
242+
The manipulated and target PDFs will be plotted against each other with a
243+
difference curve below. When --multiple is enabled, the value of a parameter (specified by
244+
--plot-parameter) will be plotted instead.""",
239245
)
240246
parser.add_option_group(group)
241247
group.add_option(

0 commit comments

Comments
 (0)