Skip to content

Commit 40c1de1

Browse files
committed
diffpy/__init__, srfit/__init__, tests/debug, run
1 parent c96d8b4 commit 40c1de1

File tree

4 files changed

+52
-67
lines changed

4 files changed

+52
-67
lines changed

Diff for: src/diffpy/__init__.py

+10-12
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,24 @@
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) 2024 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: 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
##############################################################################
1515

16-
"""diffpy - tools for structure analysis by diffraction.
17-
18-
Blank namespace package.
19-
"""
16+
"""Blank namespace package for module diffpy."""
2017

2118

2219
from pkgutil import extend_path
23-
__path__ = extend_path(__path__, __name__)
2420

21+
__path__ = extend_path(__path__, __name__)
2522

2623
# End of file
24+

Diff for: src/diffpy/srfit/__init__.py

+11-26
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,24 @@
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) 2024 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: 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
##############################################################################
1515

16-
"""Complex modeling framework for structure refinement and solution.
17-
18-
SrFit is a tool for coherently combining known information about a material to
19-
derive other properties, in particular material structure. SrFit allows the
20-
customization and creation of structure representations, profile calculators,
21-
constraints, restraints and file input parsers. The customized pieces can be
22-
glued together within SrFit to optimize a structure, or other physically
23-
relevant information from one or more experimental profiles. Other known
24-
information about the system of interest can be included with arbitrarily
25-
complex constraints and restraints. In this way, the end user creates a
26-
customized fitting application that suits the problem to the available
27-
information.
28-
29-
The subpackages herein define various pieces of the SrFit framework. Developers
30-
are encouraged to work through the examples described in the documentation to
31-
learn how to use and customize the various parts of SrFit.
32-
"""
33-
34-
__all__ = ["__version__"]
16+
"""SrFit - Structure refinement from diffraction data"""
3517

3618
# package version
3719
from diffpy.srfit.version import __version__
3820

21+
# silence the pyflakes syntax checker
22+
assert __version__ or True
23+
3924
# End of file

Diff for: src/diffpy/srfit/tests/debug.py

+11-9
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
#!/usr/bin/env python
22
##############################################################################
33
#
4-
# diffpy.srfit Complex Modeling Initiative
5-
# (c) 2016 Brookhaven Science Associates,
6-
# Brookhaven National Laboratory.
7-
# All rights reserved.
4+
# (c) 2024 The Trustees of Columbia University in the City of New York.
5+
# All rights reserved.
86
#
9-
# File coded by: Pavol Juhas
7+
# File coded by: Billinge Group members and community contributors.
108
#
11-
# See AUTHORS.txt for a list of people who contributed.
12-
# See LICENSE.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
##############################################################################
1515

@@ -22,10 +22,12 @@
2222
"""
2323

2424

25-
if __name__ == '__main__':
25+
if __name__ == "__main__":
2626
import sys
27+
2728
from diffpy.srfit.tests import testsuite
28-
pattern = sys.argv[1] if len(sys.argv) > 1 else ''
29+
30+
pattern = sys.argv[1] if len(sys.argv) > 1 else ""
2931
suite = testsuite(pattern)
3032
suite.debug()
3133

Diff for: src/diffpy/srfit/tests/run.py

+20-20
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,34 @@
11
#!/usr/bin/env python
22
##############################################################################
33
#
4-
# diffpy.srfit by DANSE Diffraction group
5-
# Simon J. L. Billinge
6-
# (c) 2010 The Trustees of Columbia University
7-
# in the City of New York. All rights reserved.
4+
# (c) 2024 The Trustees of Columbia University in the City of New York.
5+
# All rights reserved.
86
#
9-
# File coded by: Pavol Juhas
7+
# File coded by: 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-
1615
"""Convenience module for executing all unit tests with
17-
1816
python -m diffpy.srfit.tests.run
1917
"""
2018

19+
import sys
20+
21+
import pytest
2122

22-
if __name__ == '__main__':
23-
import sys
24-
# show warnings by default
25-
if not sys.warnoptions:
26-
import os, warnings
27-
warnings.simplefilter("default")
28-
# also affect subprocesses
29-
os.environ["PYTHONWARNINGS"] = "default"
30-
from diffpy.srfit.tests import test
31-
# produce zero exit code for a successful test
32-
sys.exit(not test().wasSuccessful())
23+
if __name__ == "__main__":
24+
# show output results from every test function
25+
args = ["-v"]
26+
# show the message output for skipped and expected failure tests
27+
if len(sys.argv) > 1:
28+
args.extend(sys.argv[1:])
29+
print("pytest arguments: {}".format(args))
30+
# call pytest and exit with the return code from pytest
31+
exit_res = pytest.main(args)
32+
sys.exit(exit_res)
3333

3434
# End of file

0 commit comments

Comments
 (0)