Skip to content

universe.<segment id> does not issue a deprecation warning #1478

@jbarnoud

Description

@jbarnoud

Expected behaviour

When using a segment instant selector from a Universe instance, a deprecation warning is issued. Indeed, instant selectors are deprecated and #1403 introduced deprecation warnings for them.

Actual behaviour

No deprecation warning is issued.

Segment instant selector are added directly to the universes name space here: https://github.com/MDAnalysis/mdanalysis/blob/develop/package/MDAnalysis/core/universe.py#L345. Without a proxy, accessing the segments cannot issue the warning.

This is already acknowledge in a comment: https://github.com/MDAnalysis/mdanalysis/blob/develop/package/MDAnalysis/core/universe.py#L322. However, this is the most documented way to use instant selectors.

Code to reproduce the behaviour

import MDAnalysis as mda
from MDAnalysisTests.datafiles import PSF, DCD

u = mda.Universe(PSF, DCD)
u.s4AKE

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions