From 28a7daeef6ff57979ec08de62777528219976df7 Mon Sep 17 00:00:00 2001
From: peterjc
Date: Thu, 9 Sep 2010 18:50:58 +0100
Subject: [PATCH] Deprecate Bio.utils, Bio.PropertyManager and Bio.Encodings
(see mailing list)
---
Bio/Alphabet/IUPAC.py | 4 ++++
Bio/Encodings/IUPACEncoding.py | 8 ++++++++
Bio/Encodings/__init__.py | 10 ++++++----
Bio/PropertyManager.py | 9 +++++----
Bio/utils.py | 19 +++++++++++--------
DEPRECATED | 7 ++++---
6 files changed, 38 insertions(+), 19 deletions(-)
diff --git a/Bio/Alphabet/IUPAC.py b/Bio/Alphabet/IUPAC.py
index bf5a1e7debe..6b2ed4191c4 100644
--- a/Bio/Alphabet/IUPAC.py
+++ b/Bio/Alphabet/IUPAC.py
@@ -97,6 +97,10 @@ class IUPACUnambiguousRNA(IUPACAmbiguousRNA):
# # W == wyosine
+# ====================================================================
+# TODO - Remove all the following code using now deprecated modules
+# Bio.PropertyManager, Bio.Encoding (all used by Bio.utils)
+#
# We need to load the property resolution information, but we need to
# wait until after the systems have been loaded. (There's a nasty loop
# where, eg, translation objects need an alphabet, which need to be
diff --git a/Bio/Encodings/IUPACEncoding.py b/Bio/Encodings/IUPACEncoding.py
index fedc6f70ebd..a9964248cab 100644
--- a/Bio/Encodings/IUPACEncoding.py
+++ b/Bio/Encodings/IUPACEncoding.py
@@ -1,3 +1,11 @@
+"""Properties once used for transcription and translation (DEPRECATED).
+
+This module is deprecated, and is expected to be removed in the next release.
+If you use this module, please contact the Biopython developers via the
+mailing lists.
+"""
+#NOTE - Adding a deprecation warning would affect Bio.Alphabet.IUPAC
+
# Set up the IUPAC alphabet properties
diff --git a/Bio/Encodings/__init__.py b/Bio/Encodings/__init__.py
index fdfd7421f74..7a369133207 100644
--- a/Bio/Encodings/__init__.py
+++ b/Bio/Encodings/__init__.py
@@ -1,7 +1,9 @@
# This is a Python module.
-"""Properties for functionality such as transcription and translation (OBSOLETE).
+"""Properties once used for transcription and translation (DEPRECATED).
-This module is obsolete, and is likely to be deprecated in a future version
-of Biopython, and to be removed after that. If you use this module, please
-contact the Biopython developers at biopython-dev@biopython.org.
+This module is deprecated, and is expected to be removed in the next release.
+If you use this module, please contact the Biopython developers via the
+mailing lists.
"""
+
+#NOTE - Adding a deprecation warning would affect Bio.Alphabet.IUPAC
diff --git a/Bio/PropertyManager.py b/Bio/PropertyManager.py
index 881e5e8ee28..cf7678fd19e 100644
--- a/Bio/PropertyManager.py
+++ b/Bio/PropertyManager.py
@@ -1,9 +1,10 @@
-"""Stores properties associated with the class of an object (OBSOLETE).
+"""Stores properties associated with the class of an object (DEPRECATED).
-This module is obsolete, and is likely to be deprecated in a future version
-of Biopython, and to be removed after that. If you use this module, please
-contact the Biopython developers at biopython-dev@biopython.org.
+This module is deprecated, and is expected to be removed in the next release.
+If you use this module, please contact the Biopython developers via the
+mailing lists.
"""
+#NOTE - Adding a deprecation warning would affect Bio.Alphabet.IUPAC
# Would it be nice to have support for more than one resolver per
diff --git a/Bio/utils.py b/Bio/utils.py
index 7ed60d20c1e..630d0d77705 100644
--- a/Bio/utils.py
+++ b/Bio/utils.py
@@ -4,13 +4,16 @@
# license. Please see the LICENSE file that should have been included
# as part of this package.
-"""Miscellaneous functions for dealing with sequences (OBSOLETE).
+"""Miscellaneous functions for dealing with sequences (DEPRECATED).
-This module is obsolete, and is likely to be deprecated in a future version
-of Biopython, and to be removed after that. If you use this module, please
-contact the Biopython developers at biopython-dev@biopython.org.
+This module is deprecated, and is expected to be removed in the next release.
+If you use this module, please contact the Biopython developers via the
+mailing lists.
"""
+import warnings
+warnings.warn("Bio.utils has been deprecated, and we intend to remove it in "
+ "the next release of Biopython.", DeprecationWarning)
import Seq
@@ -23,10 +26,10 @@ def ungap(seq):
#TODO - Fix this? It currently assumes the outmost AlphabetEncoder
#is for the gap. Consider HasStopCodon(Gapped(Protein())) as a test case.
import warnings
- warnings.warn("Bio.utils.ungap() has been deprecated, and we"
- " intend to remove it in a future release of Biopython."
- " Instead, please use the ungap method of the Seq object "
- " (added in Biopython 1.53).",
+ warnings.warn("Bio.utils has been deprecated, and we intend to remove it "
+ "in the next release of Biopython. Instead of function "
+ "Bio.utils.ungap please use the ungap method of the Seq "
+ "object (added in Biopython 1.53).",
DeprecationWarning)
gap = seq.gap_char
letters = []
diff --git a/DEPRECATED b/DEPRECATED
index ebb1eba8652..4e437befbb1 100644
--- a/DEPRECATED
+++ b/DEPRECATED
@@ -18,11 +18,11 @@ An explicit warning was added to setup.py for Biopython 1.55.
Bio.Encodings
=============
-Declared obsolete in Release 1.55.
+Explicitly declared obsolete in Release 1.55, and deprecated in Release 1.56.
Bio.PropertyManager
===================
-Declared obsolete in Biopython 1.55.
+Explicitly declared obsolete in Release 1.55, and deprecated in Release 1.56.
Bio.InterPro
============
@@ -423,7 +423,8 @@ Bio.utils
Functions 'translate', 'translate_to_stop', 'back_translate', 'transcribe',
and 'back_transcribe' were deprecated in Release 1.49, and removed in Release
1.53. Function 'ungap' was deprecated in Release 1.53. Use Bio.Seq instead.
-The whole of Bio.utils was declared obsolete in Release 1.55.
+The whole of Bio.utils was declared obsolete in Release 1.55, and deprecated
+in Biopython 1.56.
Bio.Motif
=========