From 1c7eae6f2800baddcb0c39d85bae68d754922e1e Mon Sep 17 00:00:00 2001 From: Alison Wu Date: Fri, 8 Nov 2024 21:25:17 -0500 Subject: [PATCH 1/4] remove relative path imports --- src/diffpy/utils/parsers/__init__.py | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/diffpy/utils/parsers/__init__.py b/src/diffpy/utils/parsers/__init__.py index a2104181..cd95dd63 100644 --- a/src/diffpy/utils/parsers/__init__.py +++ b/src/diffpy/utils/parsers/__init__.py @@ -16,12 +16,4 @@ """Various utilities related to data parsing and manipulation. """ -from .loaddata import loadData -from .resample import resample -from .serialization import deserialize_data, serialize_data - -# silence the pyflakes syntax checker -assert loadData or resample or True -assert serialize_data or deserialize_data or True - # End of file From 165ffb8f0d2fbee0c9d27fc0c38bfbc33c523d73 Mon Sep 17 00:00:00 2001 From: Alison Wu Date: Fri, 8 Nov 2024 21:25:41 -0500 Subject: [PATCH 2/4] moved resample out of parsers --- src/diffpy/utils/{parsers/resample.py => resampler.py} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename src/diffpy/utils/{parsers/resample.py => resampler.py} (100%) diff --git a/src/diffpy/utils/parsers/resample.py b/src/diffpy/utils/resampler.py similarity index 100% rename from src/diffpy/utils/parsers/resample.py rename to src/diffpy/utils/resampler.py From 11a340141c4f3977d6317e4febe88228833eb9cf Mon Sep 17 00:00:00 2001 From: Alison Wu Date: Fri, 8 Nov 2024 21:26:06 -0500 Subject: [PATCH 3/4] edited tests based on fixed file and function names --- tests/test_loaddata.py | 2 +- tests/test_resample.py | 2 +- tests/test_serialization.py | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/test_loaddata.py b/tests/test_loaddata.py index 2ca2fa07..3d775c74 100644 --- a/tests/test_loaddata.py +++ b/tests/test_loaddata.py @@ -8,7 +8,7 @@ import numpy import pytest -from diffpy.utils.parsers import loadData +from diffpy.utils.parsers.loaddata import loadData ############################################################################## diff --git a/tests/test_resample.py b/tests/test_resample.py index fa9c7e70..deddcca2 100644 --- a/tests/test_resample.py +++ b/tests/test_resample.py @@ -1,7 +1,7 @@ import numpy as np import pytest -from diffpy.utils.parsers.resample import wsinterp +from diffpy.utils.resampler import wsinterp def test_wsinterp(): diff --git a/tests/test_serialization.py b/tests/test_serialization.py index 51921e01..fc3696bf 100644 --- a/tests/test_serialization.py +++ b/tests/test_serialization.py @@ -3,8 +3,9 @@ import numpy import pytest -from diffpy.utils.parsers import deserialize_data, loadData, serialize_data from diffpy.utils.parsers.custom_exceptions import ImproperSizeError, UnsupportedTypeError +from diffpy.utils.parsers.loaddata import loadData +from diffpy.utils.parsers.serialization import deserialize_data, serialize_data tests_dir = os.path.dirname(os.path.abspath(locals().get("__file__", "file.py"))) From ccecf1074d3b95076706ae604d21f0e9737e6a3c Mon Sep 17 00:00:00 2001 From: Alison Wu Date: Fri, 8 Nov 2024 21:26:28 -0500 Subject: [PATCH 4/4] add news item --- news/resampler-relocation.rst | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 news/resampler-relocation.rst diff --git a/news/resampler-relocation.rst b/news/resampler-relocation.rst new file mode 100644 index 00000000..220fc2f5 --- /dev/null +++ b/news/resampler-relocation.rst @@ -0,0 +1,23 @@ +**Added:** + +* + +**Changed:** + +* Moved resampler out of parsers, new path is diffpy.utils.resampler + +**Deprecated:** + +* + +**Removed:** + +* Relative imports in parser's __init__.py + +**Fixed:** + +* + +**Security:** + +*