From e1aa7ada168895667d3b5437e8f652459736eb9d Mon Sep 17 00:00:00 2001
From: David Schaefer <david.schaefer@ufz.de>
Date: Tue, 17 Jan 2023 15:10:59 +0100
Subject: [PATCH] release preparation

---
 CHANGELOG.md                  | 10 +++++++++-
 saqc/funcs/flagtools.py       | 10 +++++++++-
 saqc/version.py               |  2 +-
 tests/funcs/test_functions.py |  7 ++++---
 4 files changed, 23 insertions(+), 6 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 4baa4b832..f7334504d 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -7,7 +7,14 @@ SPDX-License-Identifier: GPL-3.0-or-later
 # Changelog
 
 ## Unreleased
-[List of commits](https://git.ufz.de/rdm-software/saqc/-/compare/v2.2.1...develop)
+[List of commits](https://git.ufz.de/rdm-software/saqc/-/compare/v2.3.0...develop)
+### Added
+### Changed
+### Removed
+### Fixed
+
+## [2.3.0](https://git.ufz.de/rdm-software/saqc/-/tags/v2.3.0) - 2023-01-17
+[List of commits](https://git.ufz.de/rdm-software/saqc/-/compare/v2.2.1...v2.3.0)
 ### Added
 - add option to not overwrite existing flags to `concatFlags`
 - add option to pass existing axis object to `plot`
@@ -18,6 +25,7 @@ SPDX-License-Identifier: GPL-3.0-or-later
 - Renamed `TranslationScheme.backward` to `TranslationScheme.toExternal` 
 - Changed default value of the parameter `limit` for `SaQC.interpolateIndex` and `SaQC.interpolateInvalid` to ``None``
 - Changed default value of the parameter ``overwrite`` for ``concatFlags`` to ``False``
+- Deprecate ``transferFlags`` in favor of ``concatFlags``
 ### Removed
 - python 3.7 support
 ### Fixed
diff --git a/saqc/funcs/flagtools.py b/saqc/funcs/flagtools.py
index d253dc8ff..23341ec2b 100644
--- a/saqc/funcs/flagtools.py
+++ b/saqc/funcs/flagtools.py
@@ -396,7 +396,15 @@ class FlagtoolsMixin:
            0         -inf   -inf   -inf
            1        255.0  255.0  255.0
         """
-
+        import warnings
+
+        warnings.warn(
+            f"""The method 'transferFlags' is deprecated and
+            will be removed in version 2.5 of SaQC. Please use
+            'SaQC.concatFlags(field={field}, target={target}, method="match", squeeze=False)'
+            instead""",
+            DeprecationWarning
+        )
         return self.concatFlags(field, target=target, method="match", squeeze=False)
 
     @flagging()
diff --git a/saqc/version.py b/saqc/version.py
index 3fc917456..c6bcb9ba1 100644
--- a/saqc/version.py
+++ b/saqc/version.py
@@ -4,4 +4,4 @@
 #
 # SPDX-License-Identifier: GPL-3.0-or-later
 
-__version__ = "2.2.1"
+__version__ = "2.3"
diff --git a/tests/funcs/test_functions.py b/tests/funcs/test_functions.py
index 4ef82002a..53c13a6de 100644
--- a/tests/funcs/test_functions.py
+++ b/tests/funcs/test_functions.py
@@ -286,9 +286,10 @@ def test_transferFlags():
     data = pd.DataFrame({"a": [1, 2], "b": [1, 2], "c": [1, 2]})
     qc = saqc.SaQC(data)
     qc = qc.flagRange("a", max=1.5)
-    qc = qc.transferFlags(["a", "a"], ["b", "c"])
-    assert np.all(qc.flags["b"].values == np.array([UNFLAGGED, BAD]))
-    assert np.all(qc.flags["c"].values == np.array([UNFLAGGED, BAD]))
+    with pytest.deprecated_call():
+        qc = qc.transferFlags(["a", "a"], ["b", "c"])
+        assert np.all(qc.flags["b"].values == np.array([UNFLAGGED, BAD]))
+        assert np.all(qc.flags["c"].values == np.array([UNFLAGGED, BAD]))
 
 
 def test_flagJumps():
-- 
GitLab