diffpy.utils 0.6.0rc0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. diffpy_utils-0.6.0rc0/AUTHORS.rst +10 -0
  2. diffpy_utils-0.6.0rc0/LICENSE.rst +141 -0
  3. diffpy_utils-0.6.0rc0/LICENSE_DANSE.txt +41 -0
  4. diffpy_utils-0.6.0rc0/MANIFEST.in +12 -0
  5. diffpy_utils-0.6.0rc0/PKG-INFO +174 -0
  6. diffpy_utils-0.6.0rc0/README.rst +142 -0
  7. diffpy_utils-0.6.0rc0/pyproject.toml +80 -0
  8. diffpy_utils-0.6.0rc0/requirements/build.txt +0 -0
  9. diffpy_utils-0.6.0rc0/requirements/conda.txt +3 -0
  10. diffpy_utils-0.6.0rc0/requirements/docs.txt +4 -0
  11. diffpy_utils-0.6.0rc0/requirements/pip.txt +3 -0
  12. diffpy_utils-0.6.0rc0/requirements/test.txt +9 -0
  13. diffpy_utils-0.6.0rc0/setup.cfg +4 -0
  14. diffpy_utils-0.6.0rc0/src/diffpy/__init__.py +29 -0
  15. diffpy_utils-0.6.0rc0/src/diffpy/utils/__init__.py +21 -0
  16. diffpy_utils-0.6.0rc0/src/diffpy/utils/diffraction_objects.py +590 -0
  17. diffpy_utils-0.6.0rc0/src/diffpy/utils/parsers/__init__.py +15 -0
  18. diffpy_utils-0.6.0rc0/src/diffpy/utils/parsers/custom_exceptions.py +55 -0
  19. diffpy_utils-0.6.0rc0/src/diffpy/utils/parsers/loaddata.py +335 -0
  20. diffpy_utils-0.6.0rc0/src/diffpy/utils/parsers/serialization.py +204 -0
  21. diffpy_utils-0.6.0rc0/src/diffpy/utils/resampler.py +181 -0
  22. diffpy_utils-0.6.0rc0/src/diffpy/utils/tools.py +347 -0
  23. diffpy_utils-0.6.0rc0/src/diffpy/utils/transforms.py +213 -0
  24. diffpy_utils-0.6.0rc0/src/diffpy/utils/validators.py +47 -0
  25. diffpy_utils-0.6.0rc0/src/diffpy/utils/version.py +23 -0
  26. diffpy_utils-0.6.0rc0/src/diffpy/utils/wx/__init__.py +15 -0
  27. diffpy_utils-0.6.0rc0/src/diffpy/utils/wx/gridutils.py +166 -0
  28. diffpy_utils-0.6.0rc0/src/diffpy.utils.egg-info/PKG-INFO +174 -0
  29. diffpy_utils-0.6.0rc0/src/diffpy.utils.egg-info/SOURCES.txt +50 -0
  30. diffpy_utils-0.6.0rc0/src/diffpy.utils.egg-info/dependency_links.txt +1 -0
  31. diffpy_utils-0.6.0rc0/src/diffpy.utils.egg-info/requires.txt +3 -0
  32. diffpy_utils-0.6.0rc0/src/diffpy.utils.egg-info/top_level.txt +1 -0
  33. diffpy_utils-0.6.0rc0/tests/conftest.py +89 -0
  34. diffpy_utils-0.6.0rc0/tests/test_diffraction_objects.py +890 -0
  35. diffpy_utils-0.6.0rc0/tests/test_loaddata.py +80 -0
  36. diffpy_utils-0.6.0rc0/tests/test_resample.py +52 -0
  37. diffpy_utils-0.6.0rc0/tests/test_serialization.py +108 -0
  38. diffpy_utils-0.6.0rc0/tests/test_tools.py +215 -0
  39. diffpy_utils-0.6.0rc0/tests/test_transforms.py +261 -0
  40. diffpy_utils-0.6.0rc0/tests/test_validators.py +27 -0
  41. diffpy_utils-0.6.0rc0/tests/test_version.py +10 -0
  42. diffpy_utils-0.6.0rc0/tests/testdata/dbload/e1.gr +9 -0
  43. diffpy_utils-0.6.0rc0/tests/testdata/dbload/e2.gr +9 -0
  44. diffpy_utils-0.6.0rc0/tests/testdata/dbload/e3.gr +9 -0
  45. diffpy_utils-0.6.0rc0/tests/testdata/generated_db.json +26 -0
  46. diffpy_utils-0.6.0rc0/tests/testdata/generatewarnings.txt +11 -0
  47. diffpy_utils-0.6.0rc0/tests/testdata/loaddata01.txt +5 -0
  48. diffpy_utils-0.6.0rc0/tests/testdata/loaddatawithheaders.txt +10032 -0
  49. diffpy_utils-0.6.0rc0/tests/testdata/loadfile.txt +25 -0
  50. diffpy_utils-0.6.0rc0/tests/testdata/strumining.json +17 -0
  51. diffpy_utils-0.6.0rc0/tests/testdata/targetjson.json +26 -0
  52. diffpy_utils-0.6.0rc0/tests/testdata/wrong.type +1 -0
@@ -0,0 +1,10 @@
1
+ Authors
2
+ =======
3
+
4
+ Billinge Group and community contributors.
5
+
6
+ Contributors
7
+ ------------
8
+
9
+ For a list of contributors, visit
10
+ https://github.com/diffpy/diffpy.utils/graphs/contributors
@@ -0,0 +1,141 @@
1
+ OPEN SOURCE LICENSE AGREEMENT
2
+ =============================
3
+
4
+ Copyright (c) 1989, 1991 Free Software Foundation, Inc.
5
+
6
+ Copyright (c) 2006, The Regents of the University of California through Lawrence Berkeley National Laboratory
7
+
8
+ Copyright (c) 2006-2007, Board of Trustees of Michigan State University
9
+
10
+ Copyright (c) 2008-2012, The Trustees of Columbia University in the City of New York
11
+
12
+ Copyright (c) 2009-2011, University of Tennessee
13
+
14
+ Copyright (c) 2014, Australian Synchrotron Research Program Inc., ("ASRP")
15
+
16
+ Copyright (c) 2014-2019, Brookhaven Science Associates, Brookhaven National Laboratory
17
+
18
+ Copyright (c) 2019-2024, The Trustees of Columbia University in the City of New York.
19
+ All rights reserved.
20
+
21
+ The "DiffPy-CMI" is distributed subject to the following license conditions:
22
+
23
+ .. code-block:: text
24
+
25
+ SOFTWARE LICENSE AGREEMENT
26
+
27
+ Software: DiffPy-CMI
28
+
29
+
30
+ (1) The "Software", below, refers to the aforementioned DiffPy-CMI (in either
31
+ source code, or binary form and accompanying documentation).
32
+
33
+ Part of the software was derived from the DANSE, ObjCryst++ (with permission),
34
+ PyCifRW, Python periodictable, CCTBX, and SasView open source projects, of
35
+ which the original Copyrights are contained in each individual file.
36
+
37
+ Each licensee is addressed as "you" or "Licensee."
38
+
39
+
40
+ (2) The copyright holders shown above and their third-party Licensors hereby
41
+ grant licensee a royalty-free nonexclusive license, subject to the limitations
42
+ stated herein and U.S. Government license rights.
43
+
44
+
45
+ (3) You may modify and make a copy or copies of the software for use within
46
+ your organization, if you meet the following conditions:
47
+
48
+ (a) Copies in source code must include the copyright notice and this
49
+ software license agreement.
50
+
51
+ (b) Copies in binary form must include the copyright notice and this
52
+ Software License Agreement in the documentation and/or other materials
53
+ provided with the copy.
54
+
55
+
56
+ (4) You may modify a copy or copies of the Software or any portion of it, thus
57
+ forming a work based on the Software, and distribute copies of such work
58
+ outside your organization, if you meet all of the following conditions:
59
+
60
+ (a) Copies in source code must include the copyright notice and this
61
+ Software License Agreement;
62
+
63
+ (b) Copies in binary form must include the copyright notice and this
64
+ Software License Agreement in the documentation and/or other materials
65
+ provided with the copy;
66
+
67
+ (c) Modified copies and works based on the Software must carry prominent
68
+ notices stating that you changed specified portions of the Software.
69
+
70
+ (d) Neither the name of Brookhaven Science Associates or Brookhaven
71
+ National Laboratory nor the names of its contributors may be used to
72
+ endorse or promote products derived from this software without specific
73
+ written permission.
74
+
75
+
76
+ (5) Portions of the Software resulted from work developed under a U.S.
77
+ Government contract and are subject to the following license:
78
+ The Government is granted for itself and others acting on its behalf a
79
+ paid-up, nonexclusive, irrevocable worldwide license in this computer software
80
+ to reproduce, prepare derivative works, and perform publicly and display
81
+ publicly.
82
+
83
+
84
+ (6) WARRANTY DISCLAIMER. THE SOFTWARE IS SUPPLIED "AS IS" WITHOUT
85
+ WARRANTY OF ANY KIND. THE COPYRIGHT HOLDERS, THEIR THIRD PARTY
86
+ LICENSORS, THE UNITED STATES, THE UNITED STATES DEPARTMENT OF ENERGY, AND
87
+ THEIR EMPLOYEES: (1) DISCLAIM ANY WARRANTIES, EXPRESS OR IMPLIED, INCLUDING
88
+ BUT NOT LIMITED TO ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
89
+ PARTICULAR PURPOSE, TITLE OR NON-INFRINGEMENT, (2) DO NOT ASSUME ANY LEGAL
90
+ LIABILITY OR RESPONSIBILITY FOR THE ACCURACY, COMPLETENESS, OR USEFULNESS OF
91
+ THE SOFTWARE, (3) DO NOT REPRESENT THAT USE OF THE SOFTWARE WOULD NOT INFRINGE
92
+ PRIVATELY OWNED RIGHTS, (4) DO NOT WARRANT THAT THE SOFTWARE WILL FUNCTION
93
+ UNINTERRUPTED, THAT IT IS ERROR-FREE OR THAT ANY ERRORS WILL BE CORRECTED.
94
+
95
+
96
+ (7) LIMITATION OF LIABILITY. IN NO EVENT WILL THE COPYRIGHT HOLDERS, THEIR
97
+ THIRD PARTY LICENSORS, THE UNITED STATES, THE UNITED STATES DEPARTMENT OF
98
+ ENERGY, OR THEIR EMPLOYEES: BE LIABLE FOR ANY INDIRECT, INCIDENTAL,
99
+ CONSEQUENTIAL, SPECIAL OR PUNITIVE DAMAGES OF ANY KIND OR NATURE, INCLUDING
100
+ BUT NOT LIMITED TO LOSS OF PROFITS OR LOSS OF DATA, FOR ANY REASON WHATSOEVER,
101
+ WHETHER SUCH LIABILITY IS ASSERTED ON THE BASIS OF CONTRACT, TORT (INCLUDING
102
+ NEGLIGENCE OR STRICT LIABILITY), OR OTHERWISE, EVEN IF ANY OF SAID PARTIES HAS
103
+ BEEN WARNED OF THE POSSIBILITY OF SUCH LOSS OR DAMAGES.
104
+
105
+
106
+ Brookhaven National Laboratory Notice
107
+ =====================================
108
+
109
+ Acknowledgment of sponsorship
110
+ -----------------------------
111
+
112
+ This software was produced by the Brookhaven National Laboratory, under
113
+ Contract DE-AC02-98CH10886 with the Department of Energy.
114
+
115
+
116
+ Government disclaimer of liability
117
+ ----------------------------------
118
+
119
+ Neither the United States nor the United States Department of Energy, nor
120
+ any of their employees, makes any warranty, express or implied, or assumes
121
+ any legal liability or responsibility for the accuracy, completeness, or
122
+ usefulness of any data, apparatus, product, or process disclosed, or
123
+ represents that its use would not infringe privately owned rights.
124
+
125
+
126
+ Brookhaven disclaimer of liability
127
+ ----------------------------------
128
+
129
+ Brookhaven National Laboratory makes no representations or warranties,
130
+ express or implied, nor assumes any liability for the use of this software.
131
+
132
+
133
+ Maintenance of notice
134
+ ---------------------
135
+
136
+ In the interest of clarity regarding the origin and status of this
137
+ software, Brookhaven National Laboratory requests that any recipient of it
138
+ maintain this notice affixed to any distribution by the recipient that
139
+ contains a copy or derivative of this software.
140
+
141
+ END OF LICENSE
@@ -0,0 +1,41 @@
1
+ This program is part of the DiffPy and DANSE open-source projects
2
+ and is available subject to the conditions and terms laid out below.
3
+
4
+ Copyright 2006-2007, Board of Trustees of Michigan State University,
5
+ Copyright 2008-2012, The Trustees of Columbia University in the
6
+ city of New York. (Copyright holder indicated in each source file).
7
+
8
+ For more information please visit the project web-page:
9
+ http://www.diffpy.org/
10
+ or email Prof. Simon Billinge at sb2896@columbia.edu
11
+
12
+ Redistribution and use in source and binary forms, with or without
13
+ modification, are permitted provided that the following conditions
14
+ are met:
15
+
16
+ * Redistributions of source code must retain the above copyright
17
+ notice, this list of conditions and the following disclaimer.
18
+
19
+ * Redistributions in binary form must reproduce the above copyright
20
+ notice, this list of conditions and the following disclaimer in the
21
+ documentation and/or other materials provided with the distribution.
22
+
23
+ * Neither the name of the copyright holder nor the names of its
24
+ contributors may be used to endorse or promote products derived from
25
+ this software without specific prior written permission.
26
+
27
+ THIS SOFTWARE IS PROVIDED BY COPYRIGHT HOLDER "AS IS". COPYRIGHT HOLDER
28
+ EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES AND CONDITIONS, EITHER
29
+ EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
30
+ WARRANTIES OF MERCHANTABILITY, TITLE, FITNESS, ADEQUACY OR SUITABILITY
31
+ FOR A PARTICULAR PURPOSE, AND ANY WARRANTIES OF FREEDOM FROM
32
+ INFRINGEMENT OF ANY DOMESTIC OR FOREIGN PATENT, COPYRIGHTS, TRADE
33
+ SECRETS OR OTHER PROPRIETARY RIGHTS OF ANY PARTY. IN NO EVENT SHALL
34
+ COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR ANY DIRECT, INDIRECT,
35
+ INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
36
+ NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
37
+ USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
38
+ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
39
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
40
+ THIS SOFTWARE OR RELATING TO THIS AGREEMENT, EVEN IF ADVISED OF THE
41
+ POSSIBILITY OF SUCH DAMAGE.
@@ -0,0 +1,12 @@
1
+ graft src
2
+ graft tests
3
+ graft requirements
4
+
5
+ include AUTHORS.rst LICENSE*.rst README.rst
6
+
7
+ # Exclude all bytecode files and __pycache__ directories
8
+ global-exclude *.py[cod] # Exclude all .pyc, .pyo, and .pyd files.
9
+ global-exclude .DS_Store # Exclude Mac filesystem artifacts.
10
+ global-exclude __pycache__ # Exclude Python cache directories.
11
+ global-exclude .git* # Exclude git files and directories.
12
+ global-exclude .idea # Exclude PyCharm project settings.
@@ -0,0 +1,174 @@
1
+ Metadata-Version: 2.1
2
+ Name: diffpy.utils
3
+ Version: 0.6.0rc0
4
+ Summary: Shared utilities for diffpy packages
5
+ Author-email: "Simon J.L. Billinge group" <simon.billinge@gmail.com>
6
+ Maintainer-email: "Simon J.L. Billinge group" <simon.billinge@gmail.com>
7
+ Project-URL: Homepage, https://github.com/diffpy/diffpy.utils/
8
+ Project-URL: Issues, https://github.com/diffpy/diffpy.utils/issues/
9
+ Keywords: text data parsers,wx grid,diffraction objects
10
+ Classifier: Development Status :: 5 - Production/Stable
11
+ Classifier: Environment :: Console
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: Intended Audience :: Science/Research
14
+ Classifier: License :: Free To Use But Restricted
15
+ Classifier: Operating System :: MacOS :: MacOS X
16
+ Classifier: Operating System :: Microsoft :: Windows
17
+ Classifier: Operating System :: POSIX
18
+ Classifier: Operating System :: Unix
19
+ Classifier: Programming Language :: Python :: 3.11
20
+ Classifier: Programming Language :: Python :: 3.12
21
+ Classifier: Programming Language :: Python :: 3.13
22
+ Classifier: Topic :: Scientific/Engineering :: Physics
23
+ Classifier: Topic :: Scientific/Engineering :: Chemistry
24
+ Requires-Python: <3.14,>=3.11
25
+ Description-Content-Type: text/x-rst
26
+ License-File: LICENSE.rst
27
+ License-File: LICENSE_DANSE.txt
28
+ License-File: AUTHORS.rst
29
+ Requires-Dist: numpy
30
+ Requires-Dist: xraydb
31
+ Requires-Dist: scipy
32
+
33
+ |Icon| |title|_
34
+ ===============
35
+
36
+ .. |title| replace:: diffpy.utils
37
+ .. _title: https://diffpy.github.io/diffpy.utils
38
+
39
+ .. |Icon| image:: https://avatars.githubusercontent.com/diffpy
40
+ :target: https://diffpy.github.io/diffpy.utils
41
+ :height: 100px
42
+
43
+ |PyPi| |Forge| |PythonVersion| |PR|
44
+
45
+ |CI| |Codecov| |Black| |Tracking|
46
+
47
+ .. |Black| image:: https://img.shields.io/badge/code_style-black-black
48
+ :target: https://github.com/psf/black
49
+
50
+ .. |CI| image:: https://github.com/diffpy/diffpy.utils/actions/workflows/matrix-and-codecov-on-merge-to-main.yml/badge.svg
51
+ :target: https://github.com/diffpy/diffpy.utils/actions/workflows/matrix-and-codecov-on-merge-to-main.yml
52
+
53
+ .. |Codecov| image:: https://codecov.io/gh/diffpy/diffpy.utils/branch/main/graph/badge.svg
54
+ :target: https://codecov.io/gh/diffpy/diffpy.utils
55
+
56
+ .. |Forge| image:: https://img.shields.io/conda/vn/conda-forge/diffpy.utils
57
+ :target: https://anaconda.org/conda-forge/diffpy.utils
58
+
59
+ .. |PR| image:: https://img.shields.io/badge/PR-Welcome-29ab47ff
60
+
61
+ .. |PyPi| image:: https://img.shields.io/pypi/v/diffpy.utils
62
+ :target: https://pypi.org/project/diffpy.utils/
63
+
64
+ .. |PythonVersion| image:: https://img.shields.io/pypi/pyversions/diffpy.utils
65
+ :target: https://pypi.org/project/diffpy.utils/
66
+
67
+ .. |Tracking| image:: https://img.shields.io/badge/issue_tracking-github-blue
68
+ :target: https://github.com/diffpy/diffpy.utils/issues
69
+
70
+ diffpy.utils Package
71
+ ========================================================================
72
+
73
+ General purpose shared utilities for the diffpy libraries.
74
+
75
+ The diffpy.utils package provides functions for extracting array data from
76
+ variously formatted text files, an interpolation function based on the
77
+ Whittaker-Shannon formula that can be used to resample a PDF or other profile
78
+ function over a new grid, `DiffractionObject` for conveniently manipulating
79
+ diffraction data, and some wx GUI utilities used by the PDFgui
80
+ program.
81
+
82
+ Citation
83
+ --------
84
+
85
+ If you use this program for a scientific research that leads
86
+ to publication, we ask that you acknowledge use of the program
87
+ by citing the following paper in your publication:
88
+
89
+ P. Juhás, C. L. Farrow, X. Yang, K. R. Knox and S. J. L. Billinge,
90
+ `Complex modeling: a strategy and software program for combining
91
+ multiple information sources to solve ill posed structure and
92
+ nanostructure inverse problems
93
+ <http://dx.doi.org/10.1107/S2053273315014473>`__,
94
+ *Acta Crystallogr. A* **71**, 562-568 (2015).
95
+
96
+ Documentation
97
+ -------------
98
+
99
+ Documentation may be found at, https://diffpy.github.io/diffpy.utils
100
+
101
+ Installation
102
+ ------------
103
+
104
+ The preferred method is to use `Miniconda Python
105
+ <https://docs.conda.io/projects/miniconda/en/latest/miniconda-install.html>`_
106
+ and install from the "conda-forge" channel of Conda packages.
107
+
108
+ To add "conda-forge" to the conda channels, run the following in a terminal. ::
109
+
110
+ conda config --add channels conda-forge
111
+
112
+ We want to install our packages in a suitable conda environment.
113
+ The following creates and activates a new environment named ``diffpy.utils_env`` ::
114
+
115
+ conda create -n diffpy.utils_env diffpy.utils
116
+ conda activate diffpy.utils_env
117
+
118
+ To confirm that the installation was successful, type ::
119
+
120
+ python -c "import diffpy.utils; print(diffpy.utils.__version__)"
121
+
122
+ The output should print the latest version displayed on the badges above.
123
+
124
+ If the above does not work, you can use ``pip`` to download and install the latest release from
125
+ `Python Package Index <https://pypi.python.org>`_.
126
+ To install using ``pip`` into your ``diffpy.utils_env`` environment, type ::
127
+
128
+ pip install diffpy.utils
129
+
130
+ If you prefer to install from sources, after installing the dependencies, obtain the source archive from
131
+ `GitHub <https://github.com/diffpy/diffpy.utils/>`_. Once installed, ``cd`` into your ``diffpy.utils`` directory
132
+ and run the following ::
133
+
134
+ pip install .
135
+
136
+ Getting Started
137
+ ---------------
138
+
139
+ You may consult our `online documentation <https://diffpy.github.io/diffpy.utils>`_ for tutorials and API references.
140
+
141
+ Support and Contribute
142
+ ----------------------
143
+
144
+ `Diffpy user group <https://groups.google.com/g/diffpy-users>`_ is the discussion forum for general questions and discussions about the use of diffpy.utils. Please join the diffpy.utils users community by joining the Google group. The diffpy.utils project welcomes your expertise and enthusiasm!
145
+
146
+ If you see a bug or want to request a feature, please `report it as an issue <https://github.com/diffpy/diffpy.utils/issues>`_ and/or `submit a fix as a PR <https://github.com/diffpy/diffpy.utils/pulls>`_. You can also post it to the `Diffpy user group <https://groups.google.com/g/diffpy-users>`_.
147
+
148
+ Feel free to fork the project and contribute. To install diffpy.utils
149
+ in a development mode, with its sources being directly used by Python
150
+ rather than copied to a package directory, use the following in the root
151
+ directory ::
152
+
153
+ pip install -e .
154
+
155
+ To ensure code quality and to prevent accidental commits into the default branch, please set up the use of our pre-commit
156
+ hooks.
157
+
158
+ 1. Install pre-commit in your working environment by running ``conda install pre-commit``.
159
+
160
+ 2. Initialize pre-commit (one time only) ``pre-commit install``.
161
+
162
+ Thereafter your code will be linted by black and isort and checked against flake8 before you can commit.
163
+ If it fails by black or isort, just rerun and it should pass (black and isort will modify the files so should
164
+ pass after they are modified). If the flake8 test fails please see the error messages and fix them manually before
165
+ trying to commit again.
166
+
167
+ Improvements and fixes are always appreciated.
168
+
169
+ Before contributing, please read our `Code of Conduct <https://github.com/diffpy/diffpy.utils/blob/main/CODE_OF_CONDUCT.rst>`_.
170
+
171
+ Contact
172
+ -------
173
+
174
+ For more information on diffpy.utils please visit the project `web-page <https://diffpy.github.io/>`_ or email Prof. Simon Billinge at sb2896@columbia.edu.
@@ -0,0 +1,142 @@
1
+ |Icon| |title|_
2
+ ===============
3
+
4
+ .. |title| replace:: diffpy.utils
5
+ .. _title: https://diffpy.github.io/diffpy.utils
6
+
7
+ .. |Icon| image:: https://avatars.githubusercontent.com/diffpy
8
+ :target: https://diffpy.github.io/diffpy.utils
9
+ :height: 100px
10
+
11
+ |PyPi| |Forge| |PythonVersion| |PR|
12
+
13
+ |CI| |Codecov| |Black| |Tracking|
14
+
15
+ .. |Black| image:: https://img.shields.io/badge/code_style-black-black
16
+ :target: https://github.com/psf/black
17
+
18
+ .. |CI| image:: https://github.com/diffpy/diffpy.utils/actions/workflows/matrix-and-codecov-on-merge-to-main.yml/badge.svg
19
+ :target: https://github.com/diffpy/diffpy.utils/actions/workflows/matrix-and-codecov-on-merge-to-main.yml
20
+
21
+ .. |Codecov| image:: https://codecov.io/gh/diffpy/diffpy.utils/branch/main/graph/badge.svg
22
+ :target: https://codecov.io/gh/diffpy/diffpy.utils
23
+
24
+ .. |Forge| image:: https://img.shields.io/conda/vn/conda-forge/diffpy.utils
25
+ :target: https://anaconda.org/conda-forge/diffpy.utils
26
+
27
+ .. |PR| image:: https://img.shields.io/badge/PR-Welcome-29ab47ff
28
+
29
+ .. |PyPi| image:: https://img.shields.io/pypi/v/diffpy.utils
30
+ :target: https://pypi.org/project/diffpy.utils/
31
+
32
+ .. |PythonVersion| image:: https://img.shields.io/pypi/pyversions/diffpy.utils
33
+ :target: https://pypi.org/project/diffpy.utils/
34
+
35
+ .. |Tracking| image:: https://img.shields.io/badge/issue_tracking-github-blue
36
+ :target: https://github.com/diffpy/diffpy.utils/issues
37
+
38
+ diffpy.utils Package
39
+ ========================================================================
40
+
41
+ General purpose shared utilities for the diffpy libraries.
42
+
43
+ The diffpy.utils package provides functions for extracting array data from
44
+ variously formatted text files, an interpolation function based on the
45
+ Whittaker-Shannon formula that can be used to resample a PDF or other profile
46
+ function over a new grid, `DiffractionObject` for conveniently manipulating
47
+ diffraction data, and some wx GUI utilities used by the PDFgui
48
+ program.
49
+
50
+ Citation
51
+ --------
52
+
53
+ If you use this program for a scientific research that leads
54
+ to publication, we ask that you acknowledge use of the program
55
+ by citing the following paper in your publication:
56
+
57
+ P. Juhás, C. L. Farrow, X. Yang, K. R. Knox and S. J. L. Billinge,
58
+ `Complex modeling: a strategy and software program for combining
59
+ multiple information sources to solve ill posed structure and
60
+ nanostructure inverse problems
61
+ <http://dx.doi.org/10.1107/S2053273315014473>`__,
62
+ *Acta Crystallogr. A* **71**, 562-568 (2015).
63
+
64
+ Documentation
65
+ -------------
66
+
67
+ Documentation may be found at, https://diffpy.github.io/diffpy.utils
68
+
69
+ Installation
70
+ ------------
71
+
72
+ The preferred method is to use `Miniconda Python
73
+ <https://docs.conda.io/projects/miniconda/en/latest/miniconda-install.html>`_
74
+ and install from the "conda-forge" channel of Conda packages.
75
+
76
+ To add "conda-forge" to the conda channels, run the following in a terminal. ::
77
+
78
+ conda config --add channels conda-forge
79
+
80
+ We want to install our packages in a suitable conda environment.
81
+ The following creates and activates a new environment named ``diffpy.utils_env`` ::
82
+
83
+ conda create -n diffpy.utils_env diffpy.utils
84
+ conda activate diffpy.utils_env
85
+
86
+ To confirm that the installation was successful, type ::
87
+
88
+ python -c "import diffpy.utils; print(diffpy.utils.__version__)"
89
+
90
+ The output should print the latest version displayed on the badges above.
91
+
92
+ If the above does not work, you can use ``pip`` to download and install the latest release from
93
+ `Python Package Index <https://pypi.python.org>`_.
94
+ To install using ``pip`` into your ``diffpy.utils_env`` environment, type ::
95
+
96
+ pip install diffpy.utils
97
+
98
+ If you prefer to install from sources, after installing the dependencies, obtain the source archive from
99
+ `GitHub <https://github.com/diffpy/diffpy.utils/>`_. Once installed, ``cd`` into your ``diffpy.utils`` directory
100
+ and run the following ::
101
+
102
+ pip install .
103
+
104
+ Getting Started
105
+ ---------------
106
+
107
+ You may consult our `online documentation <https://diffpy.github.io/diffpy.utils>`_ for tutorials and API references.
108
+
109
+ Support and Contribute
110
+ ----------------------
111
+
112
+ `Diffpy user group <https://groups.google.com/g/diffpy-users>`_ is the discussion forum for general questions and discussions about the use of diffpy.utils. Please join the diffpy.utils users community by joining the Google group. The diffpy.utils project welcomes your expertise and enthusiasm!
113
+
114
+ If you see a bug or want to request a feature, please `report it as an issue <https://github.com/diffpy/diffpy.utils/issues>`_ and/or `submit a fix as a PR <https://github.com/diffpy/diffpy.utils/pulls>`_. You can also post it to the `Diffpy user group <https://groups.google.com/g/diffpy-users>`_.
115
+
116
+ Feel free to fork the project and contribute. To install diffpy.utils
117
+ in a development mode, with its sources being directly used by Python
118
+ rather than copied to a package directory, use the following in the root
119
+ directory ::
120
+
121
+ pip install -e .
122
+
123
+ To ensure code quality and to prevent accidental commits into the default branch, please set up the use of our pre-commit
124
+ hooks.
125
+
126
+ 1. Install pre-commit in your working environment by running ``conda install pre-commit``.
127
+
128
+ 2. Initialize pre-commit (one time only) ``pre-commit install``.
129
+
130
+ Thereafter your code will be linted by black and isort and checked against flake8 before you can commit.
131
+ If it fails by black or isort, just rerun and it should pass (black and isort will modify the files so should
132
+ pass after they are modified). If the flake8 test fails please see the error messages and fix them manually before
133
+ trying to commit again.
134
+
135
+ Improvements and fixes are always appreciated.
136
+
137
+ Before contributing, please read our `Code of Conduct <https://github.com/diffpy/diffpy.utils/blob/main/CODE_OF_CONDUCT.rst>`_.
138
+
139
+ Contact
140
+ -------
141
+
142
+ For more information on diffpy.utils please visit the project `web-page <https://diffpy.github.io/>`_ or email Prof. Simon Billinge at sb2896@columbia.edu.
@@ -0,0 +1,80 @@
1
+ [build-system]
2
+ requires = ["setuptools>=62.0", "setuptools-git-versioning>=2.0"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "diffpy.utils"
7
+ dynamic=['version', 'dependencies']
8
+ authors = [
9
+ { name="Simon J.L. Billinge group", email="simon.billinge@gmail.com" },
10
+ ]
11
+ maintainers = [
12
+ { name="Simon J.L. Billinge group", email="simon.billinge@gmail.com" },
13
+ ]
14
+ description = "Shared utilities for diffpy packages"
15
+ keywords = ["text data parsers", "wx grid", "diffraction objects"]
16
+ readme = "README.rst"
17
+ requires-python = ">=3.11, <3.14"
18
+ classifiers = [
19
+ 'Development Status :: 5 - Production/Stable',
20
+ 'Environment :: Console',
21
+ 'Intended Audience :: Developers',
22
+ 'Intended Audience :: Science/Research',
23
+ 'License :: Free To Use But Restricted',
24
+ 'Operating System :: MacOS :: MacOS X',
25
+ 'Operating System :: Microsoft :: Windows',
26
+ 'Operating System :: POSIX',
27
+ 'Operating System :: Unix',
28
+ 'Programming Language :: Python :: 3.11',
29
+ 'Programming Language :: Python :: 3.12',
30
+ 'Programming Language :: Python :: 3.13',
31
+ 'Topic :: Scientific/Engineering :: Physics',
32
+ 'Topic :: Scientific/Engineering :: Chemistry',
33
+ ]
34
+
35
+ [project.urls]
36
+ Homepage = "https://github.com/diffpy/diffpy.utils/"
37
+ Issues = "https://github.com/diffpy/diffpy.utils/issues/"
38
+
39
+ [tool.setuptools-git-versioning]
40
+ enabled = true
41
+ template = "{tag}"
42
+ dev_template = "{tag}"
43
+ dirty_template = "{tag}"
44
+
45
+ [tool.setuptools.packages.find]
46
+ where = ["src"] # list of folders that contain the packages (["."] by default)
47
+ include = ["*"] # package names should match these glob patterns (["*"] by default)
48
+ exclude = [] # exclude packages matching these glob patterns (empty by default)
49
+ namespaces = false # to disable scanning PEP 420 namespaces (true by default)
50
+
51
+ [tool.setuptools.dynamic]
52
+ dependencies = {file = ["requirements/pip.txt"]}
53
+
54
+ [tool.codespell]
55
+ exclude-file = ".codespell/ignore_lines.txt"
56
+ ignore-words = ".codespell/ignore_words.txt"
57
+ skip = "*.cif,*.dat"
58
+
59
+ [tool.black]
60
+ line-length = 115
61
+ include = '\.pyi?$'
62
+ exclude = '''
63
+ /(
64
+ \.git
65
+ | \.hg
66
+ | \.mypy_cache
67
+ | \.tox
68
+ | \.venv
69
+ | \.rst
70
+ | \.txt
71
+ | _build
72
+ | buck-out
73
+ | build
74
+ | dist
75
+
76
+ # The following are specific to Black, you probably don't want those.
77
+ | blib2to3
78
+ | tests/data
79
+ )/
80
+ '''
File without changes
@@ -0,0 +1,3 @@
1
+ numpy
2
+ xraydb
3
+ scipy
@@ -0,0 +1,4 @@
1
+ sphinx
2
+ sphinx_rtd_theme
3
+ doctr
4
+ m2r
@@ -0,0 +1,3 @@
1
+ numpy
2
+ xraydb
3
+ scipy
@@ -0,0 +1,9 @@
1
+ flake8
2
+ pytest
3
+ codecov
4
+ coverage
5
+ pytest-env
6
+ pytest-mock
7
+ pytest-cov
8
+ freezegun
9
+ DeepDiff
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,29 @@
1
+ #!/usr/bin/env python
2
+ ##############################################################################
3
+ #
4
+ # diffpy 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.
8
+ # (c) 2024 The Trustees of Columbia University in the City of New York.
9
+ # All rights reserved.
10
+ #
11
+ # File coded by: Billinge Group members and community contributors.
12
+ #
13
+ # See GitHub contributions for a more detailed list of contributors.
14
+ # https://github.com/diffpy/diffpy.utils/graphs/contributors
15
+ #
16
+ # See LICENSE.rst for license information.
17
+ #
18
+ ##############################################################################
19
+ """diffpy - tools for structure analysis by diffraction.
20
+
21
+ Blank namespace package.
22
+ """
23
+
24
+
25
+ from pkgutil import extend_path
26
+
27
+ __path__ = extend_path(__path__, __name__)
28
+
29
+ # End of file