File tree Expand file tree Collapse file tree 2 files changed +48
-1
lines changed
Expand file tree Collapse file tree 2 files changed +48
-1
lines changed Original file line number Diff line number Diff line change 1+ **Added: **
2+
3+ * Add deprecation warning for ``diffpy.Structure `` import.
4+
5+ **Changed: **
6+
7+ * <news item>
8+
9+ **Deprecated: **
10+
11+ * <news item>
12+
13+ **Removed: **
14+
15+ * <news item>
16+
17+ **Fixed: **
18+
19+ * <news item>
20+
21+ **Security: **
22+
23+ * <news item>
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+
52+
53+ # @deprecated
54+ # custom deprecator for diffpy.Structure module
55+ class DeprecatedStructureModule :
56+ """Proxy for backward compatibility of diffpy.Structure."""
57+
58+ def __getattr__ (self , name ):
59+ import warnings
60+
61+ warnings .warn (
62+ "Module 'diffpy.Structure' is deprecated and will be removed in version 4.0. "
63+ "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