Skip to content

Commit 5c068f3

Browse files
committed
chore: update all the inits
1 parent a9e8989 commit 5c068f3

File tree

3 files changed

+30
-71
lines changed

3 files changed

+30
-71
lines changed

src/diffpy/__init__.py

Lines changed: 7 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,14 @@
11
#!/usr/bin/env python
22
##############################################################################
33
#
4-
# diffpy by DANSE Diffraction group
5-
# Simon J. L. Billinge
6-
# (c) 2008 The Trustees of Columbia University
7-
# in the City of New York. All rights reserved.
4+
# (c) 2008-2025 The Trustees of Columbia University in the City of New York.
5+
# All rights reserved.
86
#
9-
# File coded by: Chris Farrow
7+
# File coded by: Chris Farrow and Billinge Group members and community contributors.
108
#
11-
# See AUTHORS.txt for a list of people who contributed.
12-
# See LICENSE_DANSE.txt for license information.
9+
# See GitHub contributions for a more detailed list of contributors.
10+
# https://github.com/diffpy/diffpy.srfit/graphs/contributors
11+
#
12+
# See LICENSE.rst for license information.
1313
#
1414
##############################################################################
15-
16-
"""diffpy - tools for structure analysis by diffraction.
17-
18-
Blank namespace package.
19-
"""
20-
21-
22-
from pkgutil import extend_path
23-
__path__ = extend_path(__path__, __name__)
24-
25-
26-
# End of file

src/diffpy/srfit/__init__.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
11
#!/usr/bin/env python
22
##############################################################################
33
#
4-
# diffpy.srfit by DANSE Diffraction group
5-
# Simon J. L. Billinge
6-
# (c) 2008 The Trustees of Columbia University
7-
# in the City of New York. All rights reserved.
4+
# (c) 2008-2025 The Trustees of Columbia University in the City of New York.
5+
# All rights reserved.
86
#
9-
# File coded by: Chris Farrow
7+
# File coded by: Christopher Farrow, Pavol Juhas, and members of the Billinge Group.
108
#
11-
# See AUTHORS.txt for a list of people who contributed.
12-
# See LICENSE_DANSE.txt for license information.
9+
# See GitHub contributions for a more detailed list of contributors.
10+
# https://github.com/diffpy/diffpy.srfit/graphs/contributors
11+
#
12+
# See LICENSE.rst for license information.
1313
#
1414
##############################################################################
15-
1615
"""Complex modeling framework for structure refinement and solution.
1716
1817
SrFit is a tool for coherently combining known information about a material to
@@ -31,9 +30,10 @@
3130
learn how to use and customize the various parts of SrFit.
3231
"""
3332

34-
__all__ = ["__version__"]
35-
3633
# package version
3734
from diffpy.srfit.version import __version__
3835

36+
# silence the pyflakes syntax checker
37+
assert __version__ or True
38+
3939
# End of file

src/diffpy/srfit/version.py

Lines changed: 13 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,25 @@
11
#!/usr/bin/env python
22
##############################################################################
33
#
4-
# diffpy.srfit by DANSE Diffraction group
5-
# Simon J. L. Billinge
6-
# (c) 2008 The Trustees of Columbia University
7-
# in the City of New York. All rights reserved.
4+
# (c) 2008-2025 The Trustees of Columbia University in the City of New York.
5+
# All rights reserved.
86
#
9-
# File coded by: Chris Farrow
7+
# File coded by: Christopher Farrow, Pavol Juhas, and members of the Billinge Group.
108
#
11-
# See AUTHORS.txt for a list of people who contributed.
12-
# See LICENSE_DANSE.txt for license information.
9+
# See GitHub contributions for a more detailed list of contributors.
10+
# https://github.com/diffpy/diffpy.srfit/graphs/contributors
11+
#
12+
# See LICENSE.rst for license information.
1313
#
1414
##############################################################################
15+
"""Definition of __version__."""
1516

16-
"""Definition of __version__, __date__, __timestamp__, __git_commit__.
17-
18-
Notes
19-
-----
20-
Variable `__gitsha__` is deprecated as of version 3.0.
21-
Use `__git_commit__` instead.
22-
"""
23-
24-
__all__ = ['__date__', '__git_commit__', '__timestamp__', '__version__']
25-
26-
import os.path
27-
28-
from pkg_resources import resource_filename
29-
30-
31-
# obtain version information from the version.cfg file
32-
cp = dict(version='', date='', commit='', timestamp='0')
33-
fcfg = resource_filename(__name__, 'version.cfg')
34-
if not os.path.isfile(fcfg): # pragma: no cover
35-
from warnings import warn
36-
warn('Package metadata not found, execute "./setup.py egg_info".')
37-
fcfg = os.devnull
38-
with open(fcfg) as fp:
39-
kwords = [[w.strip() for w in line.split(' = ', 1)]
40-
for line in fp if line[:1].isalpha() and ' = ' in line]
41-
assert all(w[0] in cp for w in kwords), "received unrecognized keyword"
42-
cp.update(kwords)
43-
44-
__version__ = cp['version']
45-
__date__ = cp['date']
46-
__git_commit__ = cp['commit']
47-
__timestamp__ = int(cp['timestamp'])
17+
# We do not use the other three variables, but can be added back if needed.
18+
# __all__ = ["__date__", "__git_commit__", "__timestamp__", "__version__"]
4819

49-
# TODO remove deprecated __gitsha__ in version 3.1.
50-
__gitsha__ = __git_commit__
20+
# obtain version information
21+
from importlib.metadata import version
5122

52-
del cp, fcfg, fp, kwords
23+
__version__ = version("diffpy.srfit")
5324

5425
# End of file

0 commit comments

Comments
 (0)