Skip to content

Commit 33abd2c

Browse files
committed
Deprecate loadCrystal. Fixes #14
1 parent 94985d9 commit 33abd2c

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

src/pyobjcryst/__init__.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
See the modules' documentation for specific changes.
5050
"""
5151

52+
import warnings
5253
# Let's put this on the package level
5354
from pyobjcryst.general import ObjCrystException
5455

@@ -84,13 +85,18 @@
8485
def loadCrystal(filename):
8586
"""Load pyobjcryst Crystal object from a CIF file.
8687
87-
filename -- CIF file to be loaded
88+
:param filename: CIF file to be loaded.
8889
89-
Return a new Crystal object.
90+
:return: a new Crystal object.
9091
91-
See pyobjcryst.crystal.CreateCrystalFromCIF for additional
92-
options for constructing Crystal object from CIF data.
92+
..deprecated:: 2.2.4
93+
Use pyobjcryst.crystal.create_crystal_from_cif() instead,
94+
which has more options when importing a CIF, including
95+
using an URL instead of a file.
9396
"""
97+
warnings.warn("loadCrystal is deprecated. Please use "
98+
"pyobjcryst.crystal.create_crystal_from_cif() instead",
99+
DeprecationWarning)
94100
from pyobjcryst.crystal import CreateCrystalFromCIF
95101
with open(filename, 'rb') as fp:
96102
rv = CreateCrystalFromCIF(fp)

0 commit comments

Comments
 (0)