Skip to content

Commit fc68ff7

Browse files
committed
changed _corrected to -mud-corrected
1 parent cc422c7 commit fc68ff7

6 files changed

Lines changed: 29 additions & 6 deletions

File tree

docs/source/examples/labpdfprocapp-example.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ For example,
7979
labpdfproc mud zro2_mo.xy 2.5 -w 0.71303
8080
labpdfproc mud zro2_mo.xy 2.5 -w Mo
8181
82-
This will then save the corrected file in the same directory as the input file with the name ``zro2_mo_corrected.chi``.
82+
This will then save the corrected file in the same directory as the input file with the name ``zro2_mo-mud-corrected.chi``.
8383

8484
To save the correction file, specify the ``-c`` or ``--output-correction`` flag,
8585

news/check-saved-files.rst

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
**Added:**
2+
3+
* <news item>
4+
5+
**Changed:**
6+
7+
* Changed output file behavior to raise an error early if the saved file exists.
8+
9+
**Deprecated:**
10+
11+
* <news item>
12+
13+
**Removed:**
14+
15+
* <news item>
16+
17+
**Fixed:**
18+
19+
* <news item>
20+
21+
**Security:**
22+
23+
* <news item>

src/diffpy/labpdfproc/labpdfprocapp.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ def _add_credit_args(parser, use_gui=False):
131131

132132

133133
def _save_corrected(corrected, input_path, args):
134-
outfile = args.output_directory / (input_path.stem + "_corrected.chi")
134+
outfile = args.output_directory / (input_path.stem + "-mud-corrected.chi")
135135
corrected.metadata = corrected.metadata or {}
136136
corrected.dump(str(outfile), xtype=args.xtype)
137137
print(f"Saved corrected data to {outfile}")

src/diffpy/labpdfproc/tools.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -533,7 +533,7 @@ def _check_saved_file_exists(args):
533533
and output directory."""
534534
existing_files = []
535535
for path in args.input_paths:
536-
outfile = args.output_directory / (path.stem + "_corrected.chi")
536+
outfile = args.output_directory / (path.stem + "-mud-corrected.chi")
537537
if outfile.exists() and not args.force:
538538
existing_files.append(outfile)
539539
if args.output_correction:

tests/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def user_filesystem(tmp_path):
6060
f.write("good_data.xy \n")
6161
f.write(f"{str(input_dir.resolve() / 'good_data.txt')}\n")
6262

63-
with open(output_dir / "good_data_corrected.chi", "w") as f:
63+
with open(output_dir / "good_data-mud-corrected.chi", "w") as f:
6464
f.write(chi_data)
6565
with open(output_dir / "good_data_cve.chi", "w") as f:
6666
f.write(chi_data)

tests/test_tools.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -851,11 +851,11 @@ def test_load_metadata(mocker, user_filesystem, inputs, expected):
851851

852852
def test_preprocess_args_bad(user_filesystem):
853853
# Case: user tries to run absorption correction, but the output
854-
# filenames already for *_corrected.chi and *_cve.chi exists.
854+
# filenames already for *-mud-corrected.chi and *_cve.chi exists.
855855
# expected: preprocess_args catches this early and raises an Error
856856
input_data_file = str(user_filesystem / "good_data.chi")
857857
existing_corrected_file = str(
858-
user_filesystem / "output_dir" / "good_data_corrected.chi"
858+
user_filesystem / "output_dir" / "good_data-mud-corrected.chi"
859859
)
860860
existing_corrected_cve_file = str(
861861
user_filesystem / "output_dir" / "good_data_cve.chi"

0 commit comments

Comments
 (0)