Skip to content

Commit 8f349f3

Browse files
fix indentation in help messages
1 parent 266ee9c commit 8f349f3

File tree

1 file changed

+57
-38
lines changed

1 file changed

+57
-38
lines changed

src/diffpy/labpdfproc/labpdfprocapp.py

Lines changed: 57 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -13,58 +13,69 @@ def get_args(override_cli_inputs=None):
1313
p.add_argument(
1414
"input",
1515
nargs="+",
16-
help="The filename(s) or folder(s) of the datafile(s) to load. "
17-
"Required.\nSupply a space-separated list of files or directories."
18-
"Long lists can be supplied, one per line, in a file with name "
19-
"file_list.txt. If one or more directory is provided, all valid "
20-
"data-files in that directory will be processed. Examples of valid "
21-
"inputs are 'file.xy', 'data/file.xy', 'file.xy, data/file.xy', "
22-
"'.' (load everything in the current directory), 'data' (load"
23-
"everything in the folder ./data), 'data/file_list.txt' (load"
24-
" the list of files contained in the text-file called "
25-
"file_list.txt that can be found in the folder ./data), "
26-
"'./*.chi', 'data/*.chi' (load all files with extension .chi in the "
27-
"folder ./data).",
16+
help=(
17+
"The filename(s) or folder(s) of the datafile(s) to load. "
18+
"Required.\nSupply a space-separated list of files or directories. "
19+
"Long lists can be supplied, one per line, in a file with name "
20+
"file_list.txt. If one or more directory is provided, all valid "
21+
"data-files in that directory will be processed. Examples of valid "
22+
"inputs are 'file.xy', 'data/file.xy', 'file.xy, data/file.xy', "
23+
"'.' (load everything in the current directory), 'data' (load "
24+
"everything in the folder ./data), 'data/file_list.txt' (load "
25+
"the list of files contained in the text-file called "
26+
"file_list.txt that can be found in the folder ./data), "
27+
"'./*.chi', 'data/*.chi' (load all files with extension .chi in the "
28+
"folder ./data)."
29+
),
2830
)
2931
p.add_argument(
3032
"-a",
3133
"--anode-type",
32-
help=f"The type of the x-ray source. Allowed values are "
33-
f"{*[known_sources], }. Either specify a known x-ray source or specify wavelength.",
34+
help=(
35+
f"The type of the x-ray source. Allowed values are "
36+
f"{*[known_sources], }. Either specify a known x-ray source or specify wavelength."
37+
),
3438
default="Mo",
3539
)
3640
p.add_argument(
3741
"-w",
3842
"--wavelength",
39-
help="X-ray source wavelength in angstroms. Not needed if the anode-type "
40-
"is specified. This wavelength will override the anode wavelength if both are specified.",
43+
help=(
44+
"X-ray source wavelength in angstroms. Not needed if the anode-type "
45+
"is specified. This wavelength will override the anode wavelength if both are specified."
46+
),
4147
default=None,
4248
type=float,
4349
)
4450
p.add_argument(
4551
"-o",
4652
"--output-directory",
47-
help="The name of the output directory. If not specified "
48-
"then corrected files will be written to the current directory."
49-
"If the specified directory doesn't exist it will be created.",
53+
help=(
54+
"The name of the output directory. If not specified "
55+
"then corrected files will be written to the current directory. "
56+
"If the specified directory doesn't exist it will be created."
57+
),
5058
default=None,
5159
)
5260
p.add_argument(
5361
"-x",
5462
"--xtype",
55-
help=f"The quantity on the independent variable axis. Allowed "
56-
f"values: {*XQUANTITIES, }. If not specified then two-theta "
57-
f"is assumed for the independent variable. Only implemented for "
58-
f"tth currently.",
63+
help=(
64+
f"The quantity on the independent variable axis. Allowed "
65+
f"values: {*XQUANTITIES, }. If not specified then two-theta "
66+
f"is assumed for the independent variable. Only implemented for "
67+
f"tth currently."
68+
),
5969
default="tth",
6070
)
6171
p.add_argument(
6272
"-c",
6373
"--output-correction",
6474
action="store_true",
65-
help="The absorption correction will be output to a file if this "
66-
"flag is set. Default is that it is not output.",
67-
default="tth",
75+
help=(
76+
"The absorption correction will be output to a file if this "
77+
"flag is set. Default is that it is not output."
78+
),
6879
)
6980
p.add_argument(
7081
"-f",
@@ -75,34 +86,42 @@ def get_args(override_cli_inputs=None):
7586
p.add_argument(
7687
"-m",
7788
"--method",
78-
help=f"The method for computing absorption correction. Allowed methods: {*CVE_METHODS, }. "
79-
f"Default method is polynomial interpolation if not specified. ",
89+
help=(
90+
f"The method for computing absorption correction. Allowed methods: {*CVE_METHODS, }. "
91+
f"Default method is polynomial interpolation if not specified. "
92+
),
8093
default="polynomial_interpolation",
8194
)
8295
p.add_argument(
8396
"-u",
8497
"--user-metadata",
8598
metavar="KEY=VALUE",
8699
nargs="+",
87-
help="Specify key-value pairs to be loaded into metadata using the format key=value. "
88-
"Separate pairs with whitespace, and ensure no whitespaces before or after the = sign. "
89-
"Avoid using = in keys. If multiple = signs are present, only the first separates the key and value. "
90-
"If a key or value contains whitespace, enclose it in quotes. "
91-
"For example, facility='NSLS II', 'facility=NSLS II', beamline=28ID-2, "
92-
"'beamline'='28ID-2', 'favorite color'=blue, are all valid key=value items. ",
100+
help=(
101+
"Specify key-value pairs to be loaded into metadata using the format key=value. "
102+
"Separate pairs with whitespace, and ensure no whitespaces before or after the = sign. "
103+
"Avoid using = in keys. If multiple = signs are present, only the first separates the key and value. "
104+
"If a key or value contains whitespace, enclose it in quotes. "
105+
"For example, facility='NSLS II', 'facility=NSLS II', beamline=28ID-2, "
106+
"'beamline'='28ID-2', 'favorite color'=blue, are all valid key=value items. "
107+
),
93108
)
94109
p.add_argument(
95110
"-n",
96111
"--username",
97-
help="Username will be loaded from config files. Specify here "
98-
"only if you want to override that behavior at runtime. ",
112+
help=(
113+
"Username will be loaded from config files. Specify here "
114+
"only if you want to override that behavior at runtime. "
115+
),
99116
default=None,
100117
)
101118
p.add_argument(
102119
"-e",
103120
"--email",
104-
help="Email will be loaded from config files. Specify here "
105-
"only if you want to override that behavior at runtime. ",
121+
help=(
122+
"Email will be loaded from config files. Specify here "
123+
"only if you want to override that behavior at runtime. "
124+
),
106125
default=None,
107126
)
108127
args = p.parse_args(override_cli_inputs)

0 commit comments

Comments
 (0)