File tree Expand file tree Collapse file tree 1 file changed +25
-1
lines changed
Expand file tree Collapse file tree 1 file changed +25
-1
lines changed Original file line number Diff line number Diff line change 3333 * SymmetryError
3434"""
3535
36- # Interface definitions ------------------------------------------------------
3736
37+ import sys
38+
39+ import diffpy .structure as _structure
3840from diffpy .structure .atom import Atom
3941from diffpy .structure .lattice import Lattice
4042from diffpy .structure .parsers import getParser
4547# package version
4648from diffpy .structure .version import __version__
4749
50+ # Deprecations -------------------------------------------------------
51+ # Only use the backport for module shims
52+
53+
54+ # @deprecated
55+ # custom deprecator for diffpy.Structure module
56+ class DeprecatedStructureModule :
57+ """Proxy for backward compatibility of diffpy.Structure."""
58+
59+ def __getattr__ (self , name ):
60+ import warnings
61+
62+ warnings .warn (
63+ "Module 'diffpy.Structure' is deprecated. Use 'diffpy.structure' instead." ,
64+ DeprecationWarning ,
65+ stacklevel = 2 ,
66+ )
67+ return getattr (_structure , name )
68+
69+
70+ sys .modules ["diffpy.Structure" ] = DeprecatedStructureModule ()
71+
4872# top level routines
4973
5074
You can’t perform that action at this time.
0 commit comments