From 213948c3b633620ab25cad503bcd70c7a833ce17 Mon Sep 17 00:00:00 2001 From: yucongalicechen Date: Thu, 31 Oct 2024 15:00:28 -0400 Subject: [PATCH 1/3] remove wavelength from loading metadata --- src/diffpy/labpdfproc/tools.py | 2 +- tests/test_tools.py | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/diffpy/labpdfproc/tools.py b/src/diffpy/labpdfproc/tools.py index a4301ed..4658808 100644 --- a/src/diffpy/labpdfproc/tools.py +++ b/src/diffpy/labpdfproc/tools.py @@ -6,7 +6,7 @@ WAVELENGTHS = {"Mo": 0.71, "Ag": 0.59, "Cu": 1.54} known_sources = [key for key in WAVELENGTHS.keys()] -METADATA_KEYS_TO_EXCLUDE = ["output_correction", "force_overwrite", "input", "input_paths"] +METADATA_KEYS_TO_EXCLUDE = ["output_correction", "force_overwrite", "input", "input_paths", "wavelength"] def set_output_directory(args): diff --git a/tests/test_tools.py b/tests/test_tools.py index 67773e4..afb7bee 100644 --- a/tests/test_tools.py +++ b/tests/test_tools.py @@ -336,7 +336,6 @@ def test_load_metadata(mocker, user_filesystem): "mud": 2.5, "input_directory": str(filepath), "anode_type": "Mo", - "wavelength": 0.71, "output_directory": str(Path.cwd().resolve()), "xtype": "tth", "method": "polynomial_interpolation", From 4adafd3db938a23ad36578c613ef2f7d1cd1494d Mon Sep 17 00:00:00 2001 From: yucongalicechen Date: Thu, 31 Oct 2024 15:10:56 -0400 Subject: [PATCH 2/3] add news --- news/output-wavelength.rst | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 news/output-wavelength.rst diff --git a/news/output-wavelength.rst b/news/output-wavelength.rst new file mode 100644 index 0000000..7522d38 --- /dev/null +++ b/news/output-wavelength.rst @@ -0,0 +1,23 @@ +**Added:** + +* + +**Changed:** + +* + +**Deprecated:** + +* + +**Removed:** + +* + +**Fixed:** + +* duplicated wavelength information in output files + +**Security:** + +* From ef0f62abe3b5d2b13f89580ba703c2346d5a29f7 Mon Sep 17 00:00:00 2001 From: yucongalicechen Date: Fri, 1 Nov 2024 07:20:45 -0400 Subject: [PATCH 3/3] add comment explaining the reason for excluding wavelength from metadata --- src/diffpy/labpdfproc/tools.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/diffpy/labpdfproc/tools.py b/src/diffpy/labpdfproc/tools.py index 4658808..f5f31da 100644 --- a/src/diffpy/labpdfproc/tools.py +++ b/src/diffpy/labpdfproc/tools.py @@ -6,6 +6,9 @@ WAVELENGTHS = {"Mo": 0.71, "Ag": 0.59, "Cu": 1.54} known_sources = [key for key in WAVELENGTHS.keys()] + +# Exclude wavelength from metadata to prevent duplication, +# as the dump function in diffpy.utils writes it explicitly. METADATA_KEYS_TO_EXCLUDE = ["output_correction", "force_overwrite", "input", "input_paths", "wavelength"]