Repository: biopython/biopython

Issue:
Deprecations in SeqFeature
Is there a schedule to add the deprecation warning as per:

https://github.com/biopython/biopython/blob/870f623005ed1b95df877f618cbb12a815bd5696/Bio/SeqFeature.py#L158-L175


Discussion:
Now? I was thinking this having looked at the code recently on one of your pull requests.
Great! Help wanted and good first issue?!
Tagged, although a first timer may need a bit more guidance...
hey is this issue open for work?

Yes - are you clear on what we have in mind here, or do you need more guidance before tackling this with a PR?
I think i have somewhat. could you please clarify whether my thoughts are correct or not?
i am thinking here just like there is a custom message while raise of typeerror when the condition `sub_features is not none:` similarly we have to raise depreciation warnings for location_operator, strand, ref, ref_db 
The four lines ``# TODO - Deprecation warning`` in the quoted text should replaced with something like:

```python
warnings.warn(
    "Using the XXX argument is deprecated, and will be removed in a future release. "
    "Please use YYY instead.", DeprecationWarning
)
```

(This code change should be formatted using the tool ``black``, see our CONTRIBUTING file for details)

You will also need to add ``import warnings`` to the top of the file next to the other standard library imports.
Great and i have past experience of working with black and warnings in microaoft graspologic so i shall submit the PR by tonight 
@peterjc what is the replacement for the depreciated functions

There are no functions being deprecated, only arguments to the ``__init__`` method. See the docstring which says:

```
        Note that the strand, ref and ref_db arguments to the SeqFeature are
        now obsolete and will be deprecated in a future release (which will
        give warning messages) and later removed. Set them via the location
        object instead.

        Note that location_operator and sub_features arguments can no longer
        be used, instead do this via the CompoundLocation object.
```

That will need updating too.
sure i got it all what i needed @peterjc 

Resolving patch:
diff --git a/Bio/SeqFeature.py b/Bio/SeqFeature.py
--- a/Bio/SeqFeature.py
+++ b/Bio/SeqFeature.py
@@ -52,7 +52,9 @@
 
 """
 import functools
+import warnings
 
+from Bio import BiopythonDeprecationWarning
 from Bio.Seq import MutableSeq
 from Bio.Seq import reverse_complement
 from Bio.Seq import Seq
@@ -136,8 +138,7 @@ def __init__(
         FeatureLocation must be specified via the appropriate position objects.
 
         Note that the strand, ref and ref_db arguments to the SeqFeature are
-        now obsolete and will be deprecated in a future release (which will
-        give warning messages) and later removed. Set them via the location
+        now deprecated and will later be removed. Set them via the location
         object instead.
 
         Note that location_operator and sub_features arguments can no longer
@@ -154,10 +155,18 @@ def __init__(
         self.location = location
         self.type = type
         if location_operator:
-            # TODO - Deprecation warning
+            warnings.warn(
+                "Using the location_operator argument is deprecated, and will be removed in a future release. "
+                "Please do this via the CompoundLocation object instead.",
+                BiopythonDeprecationWarning,
+            )
             self.location_operator = location_operator
         if strand is not None:
-            # TODO - Deprecation warning
+            warnings.warn(
+                "Using the strand argument is deprecated, and will be removed in a future release. "
+                "Please set it via the location object instead.",
+                BiopythonDeprecationWarning,
+            )
             self.strand = strand
         self.id = id
         self.qualifiers = {}
@@ -166,10 +175,18 @@ def __init__(
         if sub_features is not None:
             raise TypeError("Rather than sub_features, use a CompoundFeatureLocation")
         if ref is not None:
-            # TODO - Deprecation warning
+            warnings.warn(
+                "Using the ref argument is deprecated, and will be removed in a future release. "
+                "Please set it via the location object instead.",
+                BiopythonDeprecationWarning,
+            )
             self.ref = ref
         if ref_db is not None:
-            # TODO - Deprecation warning
+            warnings.warn(
+                "Using the ref_db argument is deprecated, and will be removed in a future release. "
+                "Please set it via the location object instead.",
+                BiopythonDeprecationWarning,
+            )
             self.ref_db = ref_db
 
     def _get_strand(self):


Test patch: