Skip to content

obsolete functions in lib.distances #2072

@zemanj

Description

@zemanj

Problem description

There are three functions in lib.distances that were introduced in version 0.18.1 but became obsolete since PR #2048:

  • calc_distance()
  • calc_angle()
  • calc_dihedral()

These functions were intended for use with single coordinates (numpy arrays with shape (3,)) but are no longer needed since the functions calc_bonds(), calc_angles(), and calc_dihedrals() now also accept single coordinates as input (and, likewise, return a single distance / angle / dihedral in that case).

To be precise, we now have the following equivalences:

  • calc_distance(...) ↔️ calc_bonds(...)
  • calc_angle(...) ↔️ np.rad2deg(calc_angles(...))
  • calc_dihedral(...) ↔️ np.rad2deg(calc_dihedrals(...))

The obsolete functions are used in the following files:

  • analysis/hbonds/hbond_analysis.py
  • analysis/hbonds/wbridge_analysis.py
  • core/topologyobjects.py

Possible solutions

  1. Leave everything as is (but maybe update the docstrings).
  2. Mark the three functions as deprecated and replace their occurrences in the code according to the equivalent functions as listed above.
  3. Remove the functions and replace them (as in solution 2)

Personally, I'm not in favor of solution 1.
The most important question for me is whether 0.18.1 was an official release, or in other words: Can we choose solution 3 or do we need solution 2?

Current version of MDAnalysis
0.18.1-dev

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions