Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add DepWarnings to X3DNA code and docs #4333

Merged
merged 5 commits into from
Nov 5, 2023
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion package/CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ The rules for this file:

-------------------------------------------------------------------------------
??/??/?? IAlibay, ianmkenney, PicoCentauri, pgbarletta, p-j-smith,
richardjgowers, lilyminium, ALescoulie
richardjgowers, lilyminium, ALescoulie, hmacdope

* 2.7.0

Expand Down Expand Up @@ -55,6 +55,7 @@ Changes
`analysis.nucleicacids.WatsonCrickDist.results.distances` (Issue #3720, PR #3735)

Deprecations
* X3DNA has been deprecated and will be removed in 3.0.0 (Issue #3788)
* coordinates.base.ConverterBase has been deprecated and will be removed in 3.0.0;
use converters.base.ConvertBase instead (Issue #3404)
* In `nucleicacids.WatsonCrickDist`, accepting lists of `Residue` objects was deprecated
Expand Down
14 changes: 14 additions & 0 deletions package/MDAnalysis/analysis/legacy/x3dna.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,10 @@ def mean_std_from_x3dnaPickle(profile):
stretch, stagger, buckle, propeller, opening, shift, slide, rise, tilt,
roll, twist]``.

.. deprecated:: 2.7.0
X3DNA will be removed in 3.0.0.
"""
warnings.warn("X3DNA module is deprecated and will be removed in MDAnalysis 3.0, see #3788", category=DeprecationWarning)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we have a decorator for this - please see

@deprecate(release="2.6.0", remove="3.0.0",
message=("This method has been moved to the MDAKit hole2-mdakit: "
"https://github.com/MDAnalysis/hole2-mdakit"))
for an example

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah ta.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RE: 1 if the code is not usable and we are removing it i don't really want to invest any energy in finding out why / how. Is it okay just to put the warnings in as is? Let me know wither way.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hmacdope - my point here is "what's the point in putting in a warning if it won't even work locally". If you can get the warnings locally then it's fine, otherwise I'd just add in the docstring changes and call it a day.

Copy link
Member Author

@hmacdope hmacdope Nov 5, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@IAlibay Okay you can get the warnings on before whatever is broken, at least it may warn the (possibly 0) people that have a niche setup that this works for this that it will be removed.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for testing this locally, that's probably good enough.

if profile.x3dna_param is False:
bp_shear, bp_stretch, bp_stagger, bp_rise, bp_shift, bp_slide, bp_buckle, bp_prop, bp_open, bp_tilt, bp_roll,\
bp_twist = [], [], [], [], [], [], [], [], [], [], [], []
Expand Down Expand Up @@ -247,6 +250,9 @@ class BaseX3DNA(object):

for each nucleic acid pair.

.. deprecated:: 2.7.0
X3DNA will be removed in 3.0.0.

.. _X3DNA: http://x3dna.org

"""
Expand Down Expand Up @@ -472,6 +478,9 @@ class X3DNA(BaseX3DNA):

.. versionadded:: 0.8

.. deprecated:: 2.7.0
X3DNA will be removed in 3.0.0.

.. _`X3DNA docs`: http://forum.x3dna.org/
"""

Expand Down Expand Up @@ -504,6 +513,7 @@ def __init__(self, filename, **kwargs):
--------
:class:`X3DNAtraj`
"""
warnings.warn("X3DNA module is deprecated and will be removed in MDAnalysis 3.0, see #3788", category=DeprecationWarning)
# list of temporary files, to be cleaned up on __del__
self.tempfiles = [
"auxiliary.par", "bestpairs.pdb", "bp_order.dat", "bp_helical.par", "cf_7methods.par",
Expand Down Expand Up @@ -717,6 +727,9 @@ class X3DNAtraj(BaseX3DNA):
universe and feed it to X3DNA. By default it sequentially creates a PDB for
each frame and runs X3DNA on the frame.


.. deprecated:: 2.7.0
X3DNA will be removed in 3.0.0.
"""

def __init__(self, universe, **kwargs):
Expand Down Expand Up @@ -753,6 +766,7 @@ def __init__(self, universe, **kwargs):
:class:`X3DNA`

"""
warnings.warn("X3DNA module is deprecated and will be removed in MDAnalysis 3.0, see #3788")
self.universe = universe
self.selection = kwargs.pop("selection", "nucleic")

Expand Down
Loading