diffpy.fourigui 0.2.0rc3__tar.gz → 0.3.0__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.
- {diffpy_fourigui-0.2.0rc3 → diffpy_fourigui-0.3.0}/AUTHORS.rst +1 -1
- {diffpy_fourigui-0.2.0rc3 → diffpy_fourigui-0.3.0}/LICENSE.rst +2 -2
- {diffpy_fourigui-0.2.0rc3/src/diffpy.fourigui.egg-info → diffpy_fourigui-0.3.0}/PKG-INFO +35 -15
- {diffpy_fourigui-0.2.0rc3 → diffpy_fourigui-0.3.0}/README.rst +26 -7
- {diffpy_fourigui-0.2.0rc3 → diffpy_fourigui-0.3.0}/pyproject.toml +15 -10
- {diffpy_fourigui-0.2.0rc3 → diffpy_fourigui-0.3.0}/requirements/docs.txt +2 -1
- {diffpy_fourigui-0.2.0rc3 → diffpy_fourigui-0.3.0}/src/diffpy/__init__.py +2 -10
- {diffpy_fourigui-0.2.0rc3 → diffpy_fourigui-0.3.0}/src/diffpy/fourigui/__init__.py +5 -5
- {diffpy_fourigui-0.2.0rc3 → diffpy_fourigui-0.3.0}/src/diffpy/fourigui/fourigui.py +127 -73
- diffpy_fourigui-0.3.0/src/diffpy/fourigui/fourigui_app.py +33 -0
- {diffpy_fourigui-0.2.0rc3 → diffpy_fourigui-0.3.0}/src/diffpy/fourigui/version.py +9 -8
- {diffpy_fourigui-0.2.0rc3 → diffpy_fourigui-0.3.0/src/diffpy.fourigui.egg-info}/PKG-INFO +35 -15
- {diffpy_fourigui-0.2.0rc3 → diffpy_fourigui-0.3.0}/src/diffpy.fourigui.egg-info/SOURCES.txt +9 -9
- {diffpy_fourigui-0.2.0rc3 → diffpy_fourigui-0.3.0}/tests/integration_test.py +30 -8
- {diffpy_fourigui-0.2.0rc3 → diffpy_fourigui-0.3.0}/tests/test_fourigui.py +27 -12
- {diffpy_fourigui-0.2.0rc3 → diffpy_fourigui-0.3.0}/tests/test_version.py +4 -4
- {diffpy_fourigui-0.2.0rc3 → diffpy_fourigui-0.3.0}/tests/testdata/make_testdata.py +4 -4
- diffpy_fourigui-0.2.0rc3/requirements/build.txt +0 -0
- {diffpy_fourigui-0.2.0rc3 → diffpy_fourigui-0.3.0}/MANIFEST.in +0 -0
- {diffpy_fourigui-0.2.0rc3 → diffpy_fourigui-0.3.0}/requirements/conda.txt +0 -0
- {diffpy_fourigui-0.2.0rc3 → diffpy_fourigui-0.3.0}/requirements/pip.txt +0 -0
- /diffpy_fourigui-0.2.0rc3/requirements/test.txt → /diffpy_fourigui-0.3.0/requirements/tests.txt +0 -0
- {diffpy_fourigui-0.2.0rc3 → diffpy_fourigui-0.3.0}/setup.cfg +0 -0
- {diffpy_fourigui-0.2.0rc3 → diffpy_fourigui-0.3.0}/src/diffpy.fourigui.egg-info/dependency_links.txt +0 -0
- {diffpy_fourigui-0.2.0rc3 → diffpy_fourigui-0.3.0}/src/diffpy.fourigui.egg-info/entry_points.txt +0 -0
- {diffpy_fourigui-0.2.0rc3 → diffpy_fourigui-0.3.0}/src/diffpy.fourigui.egg-info/requires.txt +0 -0
- {diffpy_fourigui-0.2.0rc3 → diffpy_fourigui-0.3.0}/src/diffpy.fourigui.egg-info/top_level.txt +0 -0
- {diffpy_fourigui-0.2.0rc3 → diffpy_fourigui-0.3.0}/tests/conftest.py +0 -0
- {diffpy_fourigui-0.2.0rc3 → diffpy_fourigui-0.3.0}/tests/testdata/__init__.py +0 -0
- {diffpy_fourigui-0.2.0rc3 → diffpy_fourigui-0.3.0}/tests/testdata/dummydata.h5 +0 -0
- /diffpy_fourigui-0.2.0rc3/tests/testdata/gofr_.h5 → /diffpy_fourigui-0.3.0/tests/testdata/gofr-.h5 +0 -0
- /diffpy_fourigui-0.2.0rc3/tests/testdata/gofr_cut.h5 → /diffpy_fourigui-0.3.0/tests/testdata/gofr-cut.h5 +0 -0
- /diffpy_fourigui-0.2.0rc3/tests/testdata/gofr_from_sofq_cut_10to40px.h5 → /diffpy_fourigui-0.3.0/tests/testdata/gofr-from-sofq-cut-10to40px.h5 +0 -0
- /diffpy_fourigui-0.2.0rc3/tests/testdata/gofr_from_sofq_cut_15to35px.h5 → /diffpy_fourigui-0.3.0/tests/testdata/gofr-from-sofq-cut-15to35px.h5 +0 -0
- {diffpy_fourigui-0.2.0rc3 → diffpy_fourigui-0.3.0}/tests/testdata/gofr.h5 +0 -0
- /diffpy_fourigui-0.2.0rc3/tests/testdata/sofq_cut_10to40px.h5 → /diffpy_fourigui-0.3.0/tests/testdata/sofq-cut-10to40px.h5 +0 -0
- /diffpy_fourigui-0.2.0rc3/tests/testdata/sofq_cut_15to35px.h5 → /diffpy_fourigui-0.3.0/tests/testdata/sofq-cut-15to35px.h5 +0 -0
- {diffpy_fourigui-0.2.0rc3 → diffpy_fourigui-0.3.0}/tests/testdata/sofq.h5 +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
BSD 3-Clause License
|
|
2
2
|
|
|
3
|
-
Copyright (c)
|
|
4
|
-
|
|
3
|
+
Copyright (c) 2022-2025, The Trustees of Columbia University in the City of New York.
|
|
4
|
+
Copyright (c) 2026-present, The Contributors to the diffpy.fourigui project.
|
|
5
5
|
All rights reserved.
|
|
6
6
|
|
|
7
7
|
Redistribution and use in source and binary forms, with or without
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: diffpy.fourigui
|
|
3
|
-
Version: 0.
|
|
4
|
-
Summary: Tool for visualizing 3D diffraction and PDF
|
|
5
|
-
Author-email:
|
|
6
|
-
Maintainer-email:
|
|
3
|
+
Version: 0.3.0
|
|
4
|
+
Summary: Tool for visualizing 3D diffraction and PDF images.
|
|
5
|
+
Author-email: Simon Billinge <sbillinge@ucsb.edu>
|
|
6
|
+
Maintainer-email: Simon Billinge <sbillinge@ucsb.edu>
|
|
7
7
|
Project-URL: Homepage, https://github.com/diffpy/diffpy.fourigui/
|
|
8
8
|
Project-URL: Issues, https://github.com/diffpy/diffpy.fourigui/issues/
|
|
9
|
-
Keywords: diffraction,
|
|
9
|
+
Keywords: diffraction,PDF,pair distribution function,gui
|
|
10
10
|
Classifier: Development Status :: 5 - Production/Stable
|
|
11
11
|
Classifier: Environment :: Console
|
|
12
12
|
Classifier: Intended Audience :: Developers
|
|
@@ -16,12 +16,12 @@ Classifier: Operating System :: MacOS :: MacOS X
|
|
|
16
16
|
Classifier: Operating System :: Microsoft :: Windows
|
|
17
17
|
Classifier: Operating System :: POSIX
|
|
18
18
|
Classifier: Operating System :: Unix
|
|
19
|
-
Classifier: Programming Language :: Python :: 3.11
|
|
20
19
|
Classifier: Programming Language :: Python :: 3.12
|
|
21
20
|
Classifier: Programming Language :: Python :: 3.13
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
22
22
|
Classifier: Topic :: Scientific/Engineering :: Physics
|
|
23
23
|
Classifier: Topic :: Scientific/Engineering :: Chemistry
|
|
24
|
-
Requires-Python: <3.
|
|
24
|
+
Requires-Python: <3.15,>=3.12
|
|
25
25
|
Description-Content-Type: text/x-rst
|
|
26
26
|
License-File: LICENSE.rst
|
|
27
27
|
License-File: AUTHORS.rst
|
|
@@ -29,6 +29,7 @@ Requires-Dist: h5py
|
|
|
29
29
|
Requires-Dist: tk
|
|
30
30
|
Requires-Dist: matplotlib
|
|
31
31
|
Requires-Dist: numpy
|
|
32
|
+
Dynamic: license-file
|
|
32
33
|
|
|
33
34
|
|Icon| |title|_
|
|
34
35
|
===============
|
|
@@ -40,15 +41,15 @@ Requires-Dist: numpy
|
|
|
40
41
|
:target: https://diffpy.github.io/diffpy.fourigui
|
|
41
42
|
:height: 100px
|
|
42
43
|
|
|
43
|
-
|
|
|
44
|
+
|PyPI| |Forge| |PythonVersion| |PR|
|
|
44
45
|
|
|
45
46
|
|CI| |Codecov| |Black| |Tracking|
|
|
46
47
|
|
|
47
48
|
.. |Black| image:: https://img.shields.io/badge/code_style-black-black
|
|
48
49
|
:target: https://github.com/psf/black
|
|
49
50
|
|
|
50
|
-
.. |CI| image:: https://github.com/diffpy/diffpy.fourigui/actions/workflows/matrix-and-codecov
|
|
51
|
-
:target: https://github.com/diffpy/diffpy.fourigui/actions/workflows/matrix-and-codecov
|
|
51
|
+
.. |CI| image:: https://github.com/diffpy/diffpy.fourigui/actions/workflows/matrix-and-codecov.yml/badge.svg
|
|
52
|
+
:target: https://github.com/diffpy/diffpy.fourigui/actions/workflows/matrix-and-codecov.yml
|
|
52
53
|
|
|
53
54
|
.. |Codecov| image:: https://codecov.io/gh/diffpy/diffpy.fourigui/branch/main/graph/badge.svg
|
|
54
55
|
:target: https://codecov.io/gh/diffpy/diffpy.fourigui
|
|
@@ -57,8 +58,9 @@ Requires-Dist: numpy
|
|
|
57
58
|
:target: https://anaconda.org/conda-forge/diffpy.fourigui
|
|
58
59
|
|
|
59
60
|
.. |PR| image:: https://img.shields.io/badge/PR-Welcome-29ab47ff
|
|
61
|
+
:target: https://github.com/diffpy/diffpy.fourigui/pulls
|
|
60
62
|
|
|
61
|
-
.. |
|
|
63
|
+
.. |PyPI| image:: https://img.shields.io/pypi/v/diffpy.fourigui
|
|
62
64
|
:target: https://pypi.org/project/diffpy.fourigui/
|
|
63
65
|
|
|
64
66
|
.. |PythonVersion| image:: https://img.shields.io/pypi/pyversions/diffpy.fourigui
|
|
@@ -67,7 +69,7 @@ Requires-Dist: numpy
|
|
|
67
69
|
.. |Tracking| image:: https://img.shields.io/badge/issue_tracking-github-blue
|
|
68
70
|
:target: https://github.com/diffpy/diffpy.fourigui/issues
|
|
69
71
|
|
|
70
|
-
Tool for visualizing 3D diffraction and PDF
|
|
72
|
+
Tool for visualizing 3D diffraction and PDF images.
|
|
71
73
|
|
|
72
74
|
Diffpy.fourigui is a tool to visualize and process 3D data sets written with the Python programming language.
|
|
73
75
|
Diffpy.fourigui always displays one slice perpendicular to one axis and allows scrolling through the 3D data set along
|
|
@@ -123,6 +125,19 @@ and run the following ::
|
|
|
123
125
|
|
|
124
126
|
pip install .
|
|
125
127
|
|
|
128
|
+
This package also provides command-line utilities. To check the software has been installed correctly, type ::
|
|
129
|
+
|
|
130
|
+
diffpy.fourigui --version
|
|
131
|
+
|
|
132
|
+
You can also type the following command to verify the installation. ::
|
|
133
|
+
|
|
134
|
+
python -c "import diffpy.fourigui; print(diffpy.fourigui.__version__)"
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
To view the basic usage and available commands, type ::
|
|
138
|
+
|
|
139
|
+
diffpy.fourigui -h
|
|
140
|
+
|
|
126
141
|
Getting Started
|
|
127
142
|
---------------
|
|
128
143
|
|
|
@@ -156,9 +171,14 @@ trying to commit again.
|
|
|
156
171
|
|
|
157
172
|
Improvements and fixes are always appreciated.
|
|
158
173
|
|
|
159
|
-
Before contributing, please read our `Code of Conduct <https://github.com/diffpy/diffpy.fourigui/blob/main/
|
|
174
|
+
Before contributing, please read our `Code of Conduct <https://github.com/diffpy/diffpy.fourigui/blob/main/CODE-OF-CONDUCT.rst>`_.
|
|
160
175
|
|
|
161
176
|
Contact
|
|
162
177
|
-------
|
|
163
178
|
|
|
164
|
-
For more information on diffpy.fourigui please visit the project `web-page <https://diffpy.github.io/>`_ or email
|
|
179
|
+
For more information on diffpy.fourigui please visit the project `web-page <https://diffpy.github.io/>`_ or email the maintainers ``Simon Billinge(sbillinge@ucsb.edu)``.
|
|
180
|
+
|
|
181
|
+
Acknowledgements
|
|
182
|
+
----------------
|
|
183
|
+
|
|
184
|
+
``diffpy.fourigui`` is built and maintained with `scikit-package <https://scikit-package.github.io/scikit-package/>`_.
|
|
@@ -8,15 +8,15 @@
|
|
|
8
8
|
:target: https://diffpy.github.io/diffpy.fourigui
|
|
9
9
|
:height: 100px
|
|
10
10
|
|
|
11
|
-
|
|
|
11
|
+
|PyPI| |Forge| |PythonVersion| |PR|
|
|
12
12
|
|
|
13
13
|
|CI| |Codecov| |Black| |Tracking|
|
|
14
14
|
|
|
15
15
|
.. |Black| image:: https://img.shields.io/badge/code_style-black-black
|
|
16
16
|
:target: https://github.com/psf/black
|
|
17
17
|
|
|
18
|
-
.. |CI| image:: https://github.com/diffpy/diffpy.fourigui/actions/workflows/matrix-and-codecov
|
|
19
|
-
:target: https://github.com/diffpy/diffpy.fourigui/actions/workflows/matrix-and-codecov
|
|
18
|
+
.. |CI| image:: https://github.com/diffpy/diffpy.fourigui/actions/workflows/matrix-and-codecov.yml/badge.svg
|
|
19
|
+
:target: https://github.com/diffpy/diffpy.fourigui/actions/workflows/matrix-and-codecov.yml
|
|
20
20
|
|
|
21
21
|
.. |Codecov| image:: https://codecov.io/gh/diffpy/diffpy.fourigui/branch/main/graph/badge.svg
|
|
22
22
|
:target: https://codecov.io/gh/diffpy/diffpy.fourigui
|
|
@@ -25,8 +25,9 @@
|
|
|
25
25
|
:target: https://anaconda.org/conda-forge/diffpy.fourigui
|
|
26
26
|
|
|
27
27
|
.. |PR| image:: https://img.shields.io/badge/PR-Welcome-29ab47ff
|
|
28
|
+
:target: https://github.com/diffpy/diffpy.fourigui/pulls
|
|
28
29
|
|
|
29
|
-
.. |
|
|
30
|
+
.. |PyPI| image:: https://img.shields.io/pypi/v/diffpy.fourigui
|
|
30
31
|
:target: https://pypi.org/project/diffpy.fourigui/
|
|
31
32
|
|
|
32
33
|
.. |PythonVersion| image:: https://img.shields.io/pypi/pyversions/diffpy.fourigui
|
|
@@ -35,7 +36,7 @@
|
|
|
35
36
|
.. |Tracking| image:: https://img.shields.io/badge/issue_tracking-github-blue
|
|
36
37
|
:target: https://github.com/diffpy/diffpy.fourigui/issues
|
|
37
38
|
|
|
38
|
-
Tool for visualizing 3D diffraction and PDF
|
|
39
|
+
Tool for visualizing 3D diffraction and PDF images.
|
|
39
40
|
|
|
40
41
|
Diffpy.fourigui is a tool to visualize and process 3D data sets written with the Python programming language.
|
|
41
42
|
Diffpy.fourigui always displays one slice perpendicular to one axis and allows scrolling through the 3D data set along
|
|
@@ -91,6 +92,19 @@ and run the following ::
|
|
|
91
92
|
|
|
92
93
|
pip install .
|
|
93
94
|
|
|
95
|
+
This package also provides command-line utilities. To check the software has been installed correctly, type ::
|
|
96
|
+
|
|
97
|
+
diffpy.fourigui --version
|
|
98
|
+
|
|
99
|
+
You can also type the following command to verify the installation. ::
|
|
100
|
+
|
|
101
|
+
python -c "import diffpy.fourigui; print(diffpy.fourigui.__version__)"
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
To view the basic usage and available commands, type ::
|
|
105
|
+
|
|
106
|
+
diffpy.fourigui -h
|
|
107
|
+
|
|
94
108
|
Getting Started
|
|
95
109
|
---------------
|
|
96
110
|
|
|
@@ -124,9 +138,14 @@ trying to commit again.
|
|
|
124
138
|
|
|
125
139
|
Improvements and fixes are always appreciated.
|
|
126
140
|
|
|
127
|
-
Before contributing, please read our `Code of Conduct <https://github.com/diffpy/diffpy.fourigui/blob/main/
|
|
141
|
+
Before contributing, please read our `Code of Conduct <https://github.com/diffpy/diffpy.fourigui/blob/main/CODE-OF-CONDUCT.rst>`_.
|
|
128
142
|
|
|
129
143
|
Contact
|
|
130
144
|
-------
|
|
131
145
|
|
|
132
|
-
For more information on diffpy.fourigui please visit the project `web-page <https://diffpy.github.io/>`_ or email
|
|
146
|
+
For more information on diffpy.fourigui please visit the project `web-page <https://diffpy.github.io/>`_ or email the maintainers ``Simon Billinge(sbillinge@ucsb.edu)``.
|
|
147
|
+
|
|
148
|
+
Acknowledgements
|
|
149
|
+
----------------
|
|
150
|
+
|
|
151
|
+
``diffpy.fourigui`` is built and maintained with `scikit-package <https://scikit-package.github.io/scikit-package/>`_.
|
|
@@ -6,15 +6,15 @@ build-backend = "setuptools.build_meta"
|
|
|
6
6
|
name = "diffpy.fourigui"
|
|
7
7
|
dynamic=['version', 'dependencies']
|
|
8
8
|
authors = [
|
|
9
|
-
{
|
|
9
|
+
{name='Simon Billinge', email='sbillinge@ucsb.edu'},
|
|
10
10
|
]
|
|
11
11
|
maintainers = [
|
|
12
|
-
{
|
|
12
|
+
{name='Simon Billinge', email='sbillinge@ucsb.edu'},
|
|
13
13
|
]
|
|
14
|
-
description = "Tool for visualizing 3D diffraction and PDF
|
|
15
|
-
keywords = ['diffraction', '
|
|
14
|
+
description = "Tool for visualizing 3D diffraction and PDF images."
|
|
15
|
+
keywords = ['diffraction', 'PDF', 'pair distribution function', 'gui']
|
|
16
16
|
readme = "README.rst"
|
|
17
|
-
requires-python = ">=3.
|
|
17
|
+
requires-python = ">=3.12, <3.15"
|
|
18
18
|
classifiers = [
|
|
19
19
|
'Development Status :: 5 - Production/Stable',
|
|
20
20
|
'Environment :: Console',
|
|
@@ -25,16 +25,13 @@ classifiers = [
|
|
|
25
25
|
'Operating System :: Microsoft :: Windows',
|
|
26
26
|
'Operating System :: POSIX',
|
|
27
27
|
'Operating System :: Unix',
|
|
28
|
-
'Programming Language :: Python :: 3.11',
|
|
29
28
|
'Programming Language :: Python :: 3.12',
|
|
30
29
|
'Programming Language :: Python :: 3.13',
|
|
30
|
+
'Programming Language :: Python :: 3.14',
|
|
31
31
|
'Topic :: Scientific/Engineering :: Physics',
|
|
32
32
|
'Topic :: Scientific/Engineering :: Chemistry',
|
|
33
33
|
]
|
|
34
34
|
|
|
35
|
-
[project.scripts]
|
|
36
|
-
fourigui = "diffpy.fourigui.fourigui:main"
|
|
37
|
-
|
|
38
35
|
[project.urls]
|
|
39
36
|
Homepage = "https://github.com/diffpy/diffpy.fourigui/"
|
|
40
37
|
Issues = "https://github.com/diffpy/diffpy.fourigui/issues/"
|
|
@@ -51,6 +48,9 @@ include = ["*"] # package names should match these glob patterns (["*"] by defa
|
|
|
51
48
|
exclude = [] # exclude packages matching these glob patterns (empty by default)
|
|
52
49
|
namespaces = false # to disable scanning PEP 420 namespaces (true by default)
|
|
53
50
|
|
|
51
|
+
[project.scripts]
|
|
52
|
+
fourigui = "diffpy.fourigui.fourigui:main"
|
|
53
|
+
|
|
54
54
|
[tool.setuptools.dynamic]
|
|
55
55
|
dependencies = {file = ["requirements/pip.txt"]}
|
|
56
56
|
|
|
@@ -59,8 +59,13 @@ exclude-file = ".codespell/ignore_lines.txt"
|
|
|
59
59
|
ignore-words = ".codespell/ignore_words.txt"
|
|
60
60
|
skip = "*.cif,*.dat"
|
|
61
61
|
|
|
62
|
+
[tool.docformatter]
|
|
63
|
+
recursive = true
|
|
64
|
+
wrap-summaries = 72
|
|
65
|
+
wrap-descriptions = 72
|
|
66
|
+
|
|
62
67
|
[tool.black]
|
|
63
|
-
line-length =
|
|
68
|
+
line-length = 79
|
|
64
69
|
include = '\.pyi?$'
|
|
65
70
|
exclude = '''
|
|
66
71
|
/(
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env python
|
|
2
2
|
##############################################################################
|
|
3
3
|
#
|
|
4
|
-
# (c)
|
|
4
|
+
# (c) 2022-2025 The Trustees of Columbia University in the City of New York.
|
|
5
|
+
# (c) 2026 - present, diffpy.fourigui contributors
|
|
5
6
|
# All rights reserved.
|
|
6
7
|
#
|
|
7
8
|
# File coded by: Billinge Group members and community contributors.
|
|
@@ -12,12 +13,3 @@
|
|
|
12
13
|
# See LICENSE.rst for license information.
|
|
13
14
|
#
|
|
14
15
|
##############################################################################
|
|
15
|
-
|
|
16
|
-
"""Blank namespace package for module diffpy."""
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
from pkgutil import extend_path
|
|
20
|
-
|
|
21
|
-
__path__ = extend_path(__path__, __name__)
|
|
22
|
-
|
|
23
|
-
# End of file
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env python
|
|
2
2
|
##############################################################################
|
|
3
3
|
#
|
|
4
|
-
# (c)
|
|
4
|
+
# (c) 2022-2025 The Trustees of Columbia University in the City of New York.
|
|
5
|
+
# (c) 2026 - present, diffpy.fourigui contributors
|
|
5
6
|
# All rights reserved.
|
|
6
7
|
#
|
|
7
|
-
# File coded by: Billinge Group members
|
|
8
|
+
# File coded by: Simon Billinge, Billinge Group members.
|
|
8
9
|
#
|
|
9
10
|
# See GitHub contributions for a more detailed list of contributors.
|
|
10
11
|
# https://github.com/diffpy/diffpy.fourigui/graphs/contributors
|
|
@@ -12,11 +13,10 @@
|
|
|
12
13
|
# See LICENSE.rst for license information.
|
|
13
14
|
#
|
|
14
15
|
##############################################################################
|
|
15
|
-
|
|
16
|
-
"""Tool for visualizing 3D diffraction and PDF Images."""
|
|
16
|
+
"""Tool for visualizing 3D diffraction and PDF images."""
|
|
17
17
|
|
|
18
18
|
# package version
|
|
19
|
-
from diffpy.fourigui.version import __version__
|
|
19
|
+
from diffpy.fourigui.version import __version__ # noqa
|
|
20
20
|
|
|
21
21
|
# silence the pyflakes syntax checker
|
|
22
22
|
assert __version__ or True
|
|
@@ -5,7 +5,10 @@ import h5py
|
|
|
5
5
|
import matplotlib
|
|
6
6
|
import numpy as np
|
|
7
7
|
from matplotlib import pyplot as plt
|
|
8
|
-
from matplotlib.backends.backend_tkagg import
|
|
8
|
+
from matplotlib.backends.backend_tkagg import (
|
|
9
|
+
FigureCanvasTkAgg,
|
|
10
|
+
NavigationToolbar2Tk,
|
|
11
|
+
)
|
|
9
12
|
|
|
10
13
|
matplotlib.use("tkagg")
|
|
11
14
|
|
|
@@ -21,18 +24,28 @@ class Gui(tk.Frame):
|
|
|
21
24
|
self.initUI()
|
|
22
25
|
|
|
23
26
|
def initUI(self):
|
|
24
|
-
"""Initialize the GUI for fourigui"""
|
|
27
|
+
"""Initialize the GUI for fourigui."""
|
|
25
28
|
|
|
26
29
|
self.loaded = False # denotes whether a dataset is loaded
|
|
27
|
-
self.transformed =
|
|
28
|
-
|
|
29
|
-
|
|
30
|
+
self.transformed = (
|
|
31
|
+
False # denotes whether dataset is Fourier transformed
|
|
32
|
+
)
|
|
33
|
+
self.cutoff_applied = (
|
|
34
|
+
False # denotes whether cutoff frequencies are applied to dataset
|
|
35
|
+
)
|
|
36
|
+
self.transcutted = (
|
|
37
|
+
False # denotes whether cutoff frequencies are applied
|
|
38
|
+
)
|
|
39
|
+
# and Fourier transformed
|
|
30
40
|
|
|
31
41
|
self.master.title("FouriGUI")
|
|
32
42
|
self.pack(fill=tk.BOTH, expand=True)
|
|
33
43
|
|
|
34
44
|
print("\nNew Session started ...")
|
|
35
|
-
print(
|
|
45
|
+
print(
|
|
46
|
+
"Enjoy exploring the beautiful reconstructions in real and in "
|
|
47
|
+
"reciprocal space!"
|
|
48
|
+
)
|
|
36
49
|
|
|
37
50
|
# 4 frames:
|
|
38
51
|
# frame 00: all buttons
|
|
@@ -54,7 +67,9 @@ class Gui(tk.Frame):
|
|
|
54
67
|
self.filename_entry.grid(row=0, column=1, columnspan=3)
|
|
55
68
|
self.filename_entry.insert(0, "/path/data.h5")
|
|
56
69
|
|
|
57
|
-
loadbutton = Button(
|
|
70
|
+
loadbutton = Button(
|
|
71
|
+
frame00, text="load", command=lambda: self.load_cube()
|
|
72
|
+
)
|
|
58
73
|
loadbutton.grid(row=0, column=4)
|
|
59
74
|
|
|
60
75
|
# row 1: change axis area
|
|
@@ -125,7 +140,9 @@ class Gui(tk.Frame):
|
|
|
125
140
|
self.colorbarmax.grid(row=3, column=3)
|
|
126
141
|
self.colorbarmin = tk.Entry(frame00, width=7)
|
|
127
142
|
self.colorbarmin.grid(row=4, column=3)
|
|
128
|
-
set_range = Button(
|
|
143
|
+
set_range = Button(
|
|
144
|
+
frame00, text="set range", command=lambda: self.colorrange_upd()
|
|
145
|
+
)
|
|
129
146
|
set_range.grid(row=2, column=4)
|
|
130
147
|
toglobalmax = Button(
|
|
131
148
|
frame00,
|
|
@@ -151,13 +168,13 @@ class Gui(tk.Frame):
|
|
|
151
168
|
anilabel.grid(row=7, column=3, columnspan=2, sticky=tk.W)
|
|
152
169
|
self.anientry = tk.Entry(frame00, width=7)
|
|
153
170
|
self.anientry.grid(row=8, column=3)
|
|
154
|
-
anibutton = Button(
|
|
171
|
+
anibutton = Button(
|
|
172
|
+
frame00, text="animation", command=lambda: self.animation()
|
|
173
|
+
)
|
|
155
174
|
anibutton.grid(row=8, column=4)
|
|
156
175
|
|
|
157
176
|
# row 10-12 Fourier transformation
|
|
158
|
-
separator = tk.Label(
|
|
159
|
-
frame00, text=" "
|
|
160
|
-
) # __________________________________________________________________")
|
|
177
|
+
separator = tk.Label(frame00, text=" ")
|
|
161
178
|
separator.grid(row=9, column=0, columnspan=5)
|
|
162
179
|
cutofflabel = tk.Label(frame00, text="cutoff frequency")
|
|
163
180
|
cutofflabel.grid(row=10, column=2, columnspan=2)
|
|
@@ -170,7 +187,9 @@ class Gui(tk.Frame):
|
|
|
170
187
|
self.qmaxentry = tk.Entry(frame00, width=7)
|
|
171
188
|
self.qmaxentry.grid(row=12, column=3)
|
|
172
189
|
self.cutoff = tk.IntVar()
|
|
173
|
-
newcutoffbutton = Button(
|
|
190
|
+
newcutoffbutton = Button(
|
|
191
|
+
frame00, text="new cutoff", command=lambda: self.newcutoff()
|
|
192
|
+
)
|
|
174
193
|
newcutoffbutton.grid(row=10, column=4)
|
|
175
194
|
cutoffon = tk.Radiobutton(
|
|
176
195
|
frame00,
|
|
@@ -225,13 +244,19 @@ class Gui(tk.Frame):
|
|
|
225
244
|
label="slider",
|
|
226
245
|
orient=tk.HORIZONTAL,
|
|
227
246
|
length=WIDTH // 2, # resolution=-1,
|
|
228
|
-
command=lambda x: self.multiple_funcs(
|
|
247
|
+
command=lambda x: self.multiple_funcs(
|
|
248
|
+
self.plot_plane(), self.intensity_upd_local()
|
|
249
|
+
),
|
|
229
250
|
)
|
|
230
251
|
# command=lambda p: self.plot_plane())
|
|
231
|
-
self.slider.grid(
|
|
252
|
+
self.slider.grid(
|
|
253
|
+
row=0, column=0, padx=10, pady=10, sticky=tk.N + tk.E + tk.S + tk.W
|
|
254
|
+
)
|
|
232
255
|
|
|
233
256
|
self.frame01_plotcell = tk.Frame(self.frame01)
|
|
234
|
-
self.frame01_plotcell.grid(
|
|
257
|
+
self.frame01_plotcell.grid(
|
|
258
|
+
row=1, column=0, padx=10, pady=10, sticky=tk.N + tk.E + tk.S + tk.W
|
|
259
|
+
)
|
|
235
260
|
|
|
236
261
|
self.frame01_toolbar = tk.Frame(self.frame01)
|
|
237
262
|
self.frame01_toolbar.grid(row=2, column=0)
|
|
@@ -239,11 +264,15 @@ class Gui(tk.Frame):
|
|
|
239
264
|
# 10 #
|
|
240
265
|
# frame 10, lower left
|
|
241
266
|
frame10 = tk.Frame(self)
|
|
242
|
-
frame10.place(
|
|
267
|
+
frame10.place(
|
|
268
|
+
x=5, y=HEIGHT - 30
|
|
269
|
+
) # , height=HEIGHT//2, width=WIDTH//2)
|
|
243
270
|
quit = Button(
|
|
244
271
|
frame10,
|
|
245
272
|
text="exit",
|
|
246
|
-
command=lambda: self.multiple_funcs(
|
|
273
|
+
command=lambda: self.multiple_funcs(
|
|
274
|
+
print("Session ended...\n", self.quit())
|
|
275
|
+
),
|
|
247
276
|
)
|
|
248
277
|
quit.pack(side=tk.TOP)
|
|
249
278
|
|
|
@@ -251,14 +280,15 @@ class Gui(tk.Frame):
|
|
|
251
280
|
# frame 00, lower right
|
|
252
281
|
# no functionality
|
|
253
282
|
frame11 = tk.Frame(self)
|
|
254
|
-
frame11.place(
|
|
283
|
+
frame11.place(
|
|
284
|
+
x=WIDTH // 2, y=HEIGHT // 2
|
|
285
|
+
) # , height=HEIGHT//2, width=WIDTH//2)
|
|
255
286
|
|
|
256
287
|
def load_cube(self):
|
|
257
|
-
"""
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
"""
|
|
288
|
+
"""Loads 3D array in h5py file format from the filename input
|
|
289
|
+
panel 3D array is expected to be a reconstructed reciprocal
|
|
290
|
+
scattering volume when executed, one slide perpendicular to the
|
|
291
|
+
selected axis will be plotted in the plot panel."""
|
|
262
292
|
|
|
263
293
|
filename = self.filename_entry.get()
|
|
264
294
|
f = h5py.File(filename, "r")
|
|
@@ -286,9 +316,13 @@ class Gui(tk.Frame):
|
|
|
286
316
|
label="slider",
|
|
287
317
|
orient=tk.HORIZONTAL,
|
|
288
318
|
length=WIDTH // 2, # resolution=-1,
|
|
289
|
-
command=lambda x: self.multiple_funcs(
|
|
319
|
+
command=lambda x: self.multiple_funcs(
|
|
320
|
+
self.plot_plane(), self.intensity_upd_local()
|
|
321
|
+
),
|
|
322
|
+
)
|
|
323
|
+
self.slider.grid(
|
|
324
|
+
row=0, column=0, padx=10, pady=10, sticky=tk.N + tk.E + tk.S + tk.W
|
|
290
325
|
)
|
|
291
|
-
self.slider.grid(row=0, column=0, padx=10, pady=10, sticky=tk.N + tk.E + tk.S + tk.W)
|
|
292
326
|
|
|
293
327
|
if not self.loaded:
|
|
294
328
|
fig, ax = plt.subplots(figsize=(4.95, 4.95))
|
|
@@ -308,26 +342,30 @@ class Gui(tk.Frame):
|
|
|
308
342
|
ax.set_xlabel("pixel")
|
|
309
343
|
ax.set_ylabel("pixel")
|
|
310
344
|
self.canvas = FigureCanvasTkAgg(fig, master=self.frame01_plotcell)
|
|
311
|
-
self.toolbar = NavigationToolbar2Tk(
|
|
345
|
+
self.toolbar = NavigationToolbar2Tk(
|
|
346
|
+
self.canvas, self.frame01_toolbar
|
|
347
|
+
)
|
|
312
348
|
self.toolbar.pack(side=tk.LEFT)
|
|
313
349
|
# self.toolbar.children['!button6'].pack_forget()
|
|
314
350
|
# self.toolbar.children['!button7'].pack_forget()
|
|
315
351
|
self.toolbar.update()
|
|
316
352
|
self.canvas.draw()
|
|
317
|
-
self.canvas.get_tk_widget().pack(
|
|
353
|
+
self.canvas.get_tk_widget().pack(
|
|
354
|
+
side=tk.LEFT, fill=tk.BOTH, expand=1
|
|
355
|
+
)
|
|
318
356
|
self.loaded = True
|
|
319
357
|
else:
|
|
320
358
|
self.plot_plane()
|
|
321
359
|
self.transformed = False
|
|
322
360
|
self.transcutted = False
|
|
323
|
-
self.
|
|
361
|
+
self.cutoff_applied = False
|
|
324
362
|
self.cutoff.set(0)
|
|
325
363
|
self.space.set(0)
|
|
326
364
|
|
|
327
365
|
self.intensity_upd_global()
|
|
328
366
|
|
|
329
367
|
def plot_plane(self):
|
|
330
|
-
"""
|
|
368
|
+
"""Update plotted plane perpendicular to the selected axis."""
|
|
331
369
|
if self.axis.get() == 0:
|
|
332
370
|
self.im.set_data(self.cube[self.plane_num.get(), :, :])
|
|
333
371
|
elif self.axis.get() == 1:
|
|
@@ -339,7 +377,7 @@ class Gui(tk.Frame):
|
|
|
339
377
|
self.canvas.draw()
|
|
340
378
|
|
|
341
379
|
def colorrange_upd(self):
|
|
342
|
-
"""
|
|
380
|
+
"""Change color range in plot."""
|
|
343
381
|
try:
|
|
344
382
|
if self.colorbarmin.get() and self.colorbarmax.get():
|
|
345
383
|
vmin = float(self.colorbarmin.get())
|
|
@@ -359,7 +397,8 @@ class Gui(tk.Frame):
|
|
|
359
397
|
self.plot_plane()
|
|
360
398
|
|
|
361
399
|
def intensity_upd_local(self):
|
|
362
|
-
"""
|
|
400
|
+
"""Show local intensity minimum, maximum and sum of current
|
|
401
|
+
plotted plane."""
|
|
363
402
|
if self.axis.get() == 0:
|
|
364
403
|
plane = self.cube[self.plane_num.get(), :, :]
|
|
365
404
|
elif self.axis.get() == 1:
|
|
@@ -367,25 +406,37 @@ class Gui(tk.Frame):
|
|
|
367
406
|
elif self.axis.get() == 2:
|
|
368
407
|
plane = self.cube[:, :, self.plane_num.get()]
|
|
369
408
|
nan_ratio = np.count_nonzero(np.isnan(plane)) / plane.size
|
|
370
|
-
self.localmax["text"] =
|
|
371
|
-
|
|
372
|
-
|
|
409
|
+
self.localmax["text"] = (
|
|
410
|
+
f"{np.format_float_scientific(np.nanmax(plane), 1)}"
|
|
411
|
+
)
|
|
412
|
+
self.localmin["text"] = (
|
|
413
|
+
f"{np.format_float_scientific(np.nanmin(plane), 1)}"
|
|
414
|
+
)
|
|
415
|
+
self.localsum["text"] = (
|
|
416
|
+
f"{np.format_float_scientific(np.nansum(plane), 1)}"
|
|
417
|
+
)
|
|
373
418
|
self.localnanratio["text"] = f"{round(nan_ratio, 2)}"
|
|
374
419
|
|
|
375
420
|
def intensity_upd_global(self):
|
|
376
|
-
"""Load global intensity minimum, maximum and sum of 3D
|
|
421
|
+
"""Load global intensity minimum, maximum and sum of 3D
|
|
422
|
+
array."""
|
|
377
423
|
self.intensity_upd_local()
|
|
378
424
|
nan_ratio = np.count_nonzero(np.isnan(self.cube)) / self.cube.size
|
|
379
|
-
self.globalmax["text"] =
|
|
380
|
-
|
|
381
|
-
|
|
425
|
+
self.globalmax["text"] = (
|
|
426
|
+
f"{np.format_float_scientific(np.nanmax(self.cube), 1)}"
|
|
427
|
+
)
|
|
428
|
+
self.globalmin["text"] = (
|
|
429
|
+
f"{np.format_float_scientific(np.nanmin(self.cube), 1)}"
|
|
430
|
+
)
|
|
431
|
+
self.globalsum["text"] = (
|
|
432
|
+
f"{np.format_float_scientific(np.nansum(self.cube), 1)}"
|
|
433
|
+
)
|
|
382
434
|
self.globalnanratio["text"] = "{}".format(round(nan_ratio, 2))
|
|
383
435
|
|
|
384
436
|
def fft(self):
|
|
385
|
-
"""
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
"""
|
|
437
|
+
"""Fourier transform 3D array from reciprocal to real space the
|
|
438
|
+
origin of reciprocal and real space is expected to be the
|
|
439
|
+
central voxel."""
|
|
389
440
|
|
|
390
441
|
def perform_fft(fftholder):
|
|
391
442
|
fftholder = np.nan_to_num(fftholder)
|
|
@@ -438,10 +489,9 @@ class Gui(tk.Frame):
|
|
|
438
489
|
self.intensity_upd_global()
|
|
439
490
|
|
|
440
491
|
def ifft(self):
|
|
441
|
-
"""
|
|
442
|
-
|
|
443
|
-
the
|
|
444
|
-
"""
|
|
492
|
+
"""Inverse Fourier transform 3D array from real to reciprocal
|
|
493
|
+
space the origin of real and reciprocal space is expected to be
|
|
494
|
+
the central voxel."""
|
|
445
495
|
if not self.cutoff.get():
|
|
446
496
|
self.cube_real = self.cube
|
|
447
497
|
self.cube = self.cube_reci
|
|
@@ -455,11 +505,10 @@ class Gui(tk.Frame):
|
|
|
455
505
|
self.intensity_upd_global()
|
|
456
506
|
|
|
457
507
|
def applycutoff(self):
|
|
458
|
-
"""
|
|
459
|
-
shape the reciprocal-space array
|
|
508
|
+
"""Shape the reciprocal-space array.
|
|
460
509
|
|
|
461
|
-
reassign all voxels with distance smaller than qmin and greater than
|
|
462
|
-
to np.nan.
|
|
510
|
+
reassign all voxels with distance smaller than qmin and greater than
|
|
511
|
+
qmax to np.nan.
|
|
463
512
|
|
|
464
513
|
parameters:
|
|
465
514
|
-----------
|
|
@@ -470,7 +519,7 @@ class Gui(tk.Frame):
|
|
|
470
519
|
--------
|
|
471
520
|
nothing
|
|
472
521
|
"""
|
|
473
|
-
if not self.
|
|
522
|
+
if not self.cutoff_applied:
|
|
474
523
|
xdim, ydim, zdim = self.cube.shape
|
|
475
524
|
sphere = np.ones((xdim, ydim, zdim))
|
|
476
525
|
qmin = float(self.qminentry.get())
|
|
@@ -479,9 +528,17 @@ class Gui(tk.Frame):
|
|
|
479
528
|
# convert qmax to pixels
|
|
480
529
|
r2_inner = qmin**2
|
|
481
530
|
r2_outer = qmax**2
|
|
482
|
-
i, j, k = np.meshgrid(
|
|
483
|
-
|
|
484
|
-
|
|
531
|
+
i, j, k = np.meshgrid(
|
|
532
|
+
np.arange(xdim), np.arange(ydim), np.arange(zdim)
|
|
533
|
+
)
|
|
534
|
+
r2 = (
|
|
535
|
+
(i - xdim // 2) ** 2
|
|
536
|
+
+ (j - ydim // 2) ** 2
|
|
537
|
+
+ (k - zdim // 2) ** 2
|
|
538
|
+
)
|
|
539
|
+
mask = (r2 < r2_inner) | (
|
|
540
|
+
r2 > r2_outer
|
|
541
|
+
) # True if voxel is out of range
|
|
485
542
|
sphere[mask] = np.nan # therefore set to np.nan if out of range
|
|
486
543
|
|
|
487
544
|
if self.space.get():
|
|
@@ -496,7 +553,7 @@ class Gui(tk.Frame):
|
|
|
496
553
|
self.plot_plane()
|
|
497
554
|
self.intensity_upd_global()
|
|
498
555
|
|
|
499
|
-
self.
|
|
556
|
+
self.cutoff_applied = True
|
|
500
557
|
|
|
501
558
|
else:
|
|
502
559
|
if self.space.get(): # in real space
|
|
@@ -507,9 +564,8 @@ class Gui(tk.Frame):
|
|
|
507
564
|
self.intensity_upd_global()
|
|
508
565
|
|
|
509
566
|
def redocutuff(self):
|
|
510
|
-
"""
|
|
511
|
-
|
|
512
|
-
"""
|
|
567
|
+
"""Redo the cutoff operation depending on the current space
|
|
568
|
+
(real or reciprocal)."""
|
|
513
569
|
if self.space.get(): # in real space
|
|
514
570
|
self.cube_realcut = self.cube
|
|
515
571
|
if not self.transformed:
|
|
@@ -522,22 +578,20 @@ class Gui(tk.Frame):
|
|
|
522
578
|
self.intensity_upd_global()
|
|
523
579
|
|
|
524
580
|
def newcutoff(self):
|
|
525
|
-
"""
|
|
526
|
-
|
|
527
|
-
"""
|
|
581
|
+
"""Apply a new cutoff based on the current space and cutoff
|
|
582
|
+
settings."""
|
|
528
583
|
if self.cutoff.get():
|
|
529
584
|
if self.space.get() and self.transformed:
|
|
530
585
|
self.cube = self.cube_real
|
|
531
586
|
else:
|
|
532
587
|
self.cube = self.cube_reci
|
|
533
|
-
self.
|
|
588
|
+
self.cutoff_applied = False
|
|
534
589
|
self.transcutted = False
|
|
535
590
|
self.applycutoff()
|
|
536
591
|
|
|
537
592
|
def plot_next_plane(self):
|
|
538
|
-
"""
|
|
539
|
-
|
|
540
|
-
"""
|
|
593
|
+
"""Plot the next plane in the dataset, looping back to the first
|
|
594
|
+
if at the end."""
|
|
541
595
|
n = self.plane_num.get()
|
|
542
596
|
if n == len(self.cube[self.axis.get()]) - 1:
|
|
543
597
|
n = 0
|
|
@@ -547,25 +601,25 @@ class Gui(tk.Frame):
|
|
|
547
601
|
self.plot_plane()
|
|
548
602
|
|
|
549
603
|
def animation(self):
|
|
550
|
-
"""
|
|
551
|
-
slices through the 3D array along the selected axis
|
|
552
|
-
"""
|
|
604
|
+
"""Slices through the 3D array along the selected axis."""
|
|
553
605
|
try:
|
|
554
606
|
if not self.anientry.get():
|
|
555
607
|
anispeed = 1
|
|
556
608
|
else:
|
|
557
609
|
anispeed = self.anientry.get()
|
|
558
610
|
except ValueError:
|
|
559
|
-
print(
|
|
611
|
+
print(
|
|
612
|
+
"Oops... animation speed must be an integer > 0 "
|
|
613
|
+
"or empty string."
|
|
614
|
+
)
|
|
560
615
|
n = self.plane_num.get() - 1
|
|
561
616
|
while n is not self.plane_num.get():
|
|
562
617
|
self.slider.after(anispeed, self.plot_next_plane())
|
|
563
618
|
self.plot_next_plane()
|
|
564
619
|
|
|
565
620
|
def multiple_funcs(*funcs):
|
|
566
|
-
"""
|
|
567
|
-
|
|
568
|
-
"""
|
|
621
|
+
"""Executes multiple functions passed as arguments in
|
|
622
|
+
sequence."""
|
|
569
623
|
for func in funcs:
|
|
570
624
|
func
|
|
571
625
|
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import argparse
|
|
2
|
+
|
|
3
|
+
from diffpy.fourigui.version import __version__ # noqa
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
def main():
|
|
7
|
+
parser = argparse.ArgumentParser(
|
|
8
|
+
prog="diffpy.fourigui",
|
|
9
|
+
description=(
|
|
10
|
+
"Tool for visualizing 3D diffraction and PDF images.\n\n"
|
|
11
|
+
"For more information, visit: "
|
|
12
|
+
"https://github.com/diffpy/diffpy.fourigui/"
|
|
13
|
+
),
|
|
14
|
+
formatter_class=argparse.RawDescriptionHelpFormatter,
|
|
15
|
+
)
|
|
16
|
+
|
|
17
|
+
parser.add_argument(
|
|
18
|
+
"--version",
|
|
19
|
+
action="store_true",
|
|
20
|
+
help="Show the program's version number and exit",
|
|
21
|
+
)
|
|
22
|
+
|
|
23
|
+
args = parser.parse_args()
|
|
24
|
+
|
|
25
|
+
if args.version:
|
|
26
|
+
print(f"diffpy.fourigui {__version__}")
|
|
27
|
+
else:
|
|
28
|
+
# Default behavior when no arguments are given
|
|
29
|
+
parser.print_help()
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
if __name__ == "__main__":
|
|
33
|
+
main()
|
|
@@ -1,26 +1,27 @@
|
|
|
1
1
|
#!/usr/bin/env python
|
|
2
2
|
##############################################################################
|
|
3
3
|
#
|
|
4
|
-
# (c)
|
|
4
|
+
# (c) 2022-2025 The Trustees of Columbia University in the City of New York.
|
|
5
|
+
# (c) 2026 - present, diffpy.fourigui contributors
|
|
5
6
|
# All rights reserved.
|
|
6
7
|
#
|
|
7
|
-
# File coded by: Billinge Group members
|
|
8
|
+
# File coded by: Simon Billinge, Billinge Group members.
|
|
8
9
|
#
|
|
9
10
|
# See GitHub contributions for a more detailed list of contributors.
|
|
10
|
-
# https://github.com/diffpy/diffpy.fourigui/graphs/contributors
|
|
11
|
+
# https://github.com/diffpy/diffpy.fourigui/graphs/contributors # noqa: E501
|
|
11
12
|
#
|
|
12
13
|
# See LICENSE.rst for license information.
|
|
13
14
|
#
|
|
14
15
|
##############################################################################
|
|
15
|
-
|
|
16
16
|
"""Definition of __version__."""
|
|
17
17
|
|
|
18
18
|
# We do not use the other three variables, but can be added back if needed.
|
|
19
19
|
# __all__ = ["__date__", "__git_commit__", "__timestamp__", "__version__"]
|
|
20
20
|
|
|
21
21
|
# obtain version information
|
|
22
|
-
from importlib.metadata import version
|
|
23
|
-
|
|
24
|
-
__version__ = version("diffpy.fourigui")
|
|
22
|
+
from importlib.metadata import PackageNotFoundError, version
|
|
25
23
|
|
|
26
|
-
|
|
24
|
+
try:
|
|
25
|
+
__version__ = version("diffpy.fourigui")
|
|
26
|
+
except PackageNotFoundError:
|
|
27
|
+
__version__ = "unknown"
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: diffpy.fourigui
|
|
3
|
-
Version: 0.
|
|
4
|
-
Summary: Tool for visualizing 3D diffraction and PDF
|
|
5
|
-
Author-email:
|
|
6
|
-
Maintainer-email:
|
|
3
|
+
Version: 0.3.0
|
|
4
|
+
Summary: Tool for visualizing 3D diffraction and PDF images.
|
|
5
|
+
Author-email: Simon Billinge <sbillinge@ucsb.edu>
|
|
6
|
+
Maintainer-email: Simon Billinge <sbillinge@ucsb.edu>
|
|
7
7
|
Project-URL: Homepage, https://github.com/diffpy/diffpy.fourigui/
|
|
8
8
|
Project-URL: Issues, https://github.com/diffpy/diffpy.fourigui/issues/
|
|
9
|
-
Keywords: diffraction,
|
|
9
|
+
Keywords: diffraction,PDF,pair distribution function,gui
|
|
10
10
|
Classifier: Development Status :: 5 - Production/Stable
|
|
11
11
|
Classifier: Environment :: Console
|
|
12
12
|
Classifier: Intended Audience :: Developers
|
|
@@ -16,12 +16,12 @@ Classifier: Operating System :: MacOS :: MacOS X
|
|
|
16
16
|
Classifier: Operating System :: Microsoft :: Windows
|
|
17
17
|
Classifier: Operating System :: POSIX
|
|
18
18
|
Classifier: Operating System :: Unix
|
|
19
|
-
Classifier: Programming Language :: Python :: 3.11
|
|
20
19
|
Classifier: Programming Language :: Python :: 3.12
|
|
21
20
|
Classifier: Programming Language :: Python :: 3.13
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
22
22
|
Classifier: Topic :: Scientific/Engineering :: Physics
|
|
23
23
|
Classifier: Topic :: Scientific/Engineering :: Chemistry
|
|
24
|
-
Requires-Python: <3.
|
|
24
|
+
Requires-Python: <3.15,>=3.12
|
|
25
25
|
Description-Content-Type: text/x-rst
|
|
26
26
|
License-File: LICENSE.rst
|
|
27
27
|
License-File: AUTHORS.rst
|
|
@@ -29,6 +29,7 @@ Requires-Dist: h5py
|
|
|
29
29
|
Requires-Dist: tk
|
|
30
30
|
Requires-Dist: matplotlib
|
|
31
31
|
Requires-Dist: numpy
|
|
32
|
+
Dynamic: license-file
|
|
32
33
|
|
|
33
34
|
|Icon| |title|_
|
|
34
35
|
===============
|
|
@@ -40,15 +41,15 @@ Requires-Dist: numpy
|
|
|
40
41
|
:target: https://diffpy.github.io/diffpy.fourigui
|
|
41
42
|
:height: 100px
|
|
42
43
|
|
|
43
|
-
|
|
|
44
|
+
|PyPI| |Forge| |PythonVersion| |PR|
|
|
44
45
|
|
|
45
46
|
|CI| |Codecov| |Black| |Tracking|
|
|
46
47
|
|
|
47
48
|
.. |Black| image:: https://img.shields.io/badge/code_style-black-black
|
|
48
49
|
:target: https://github.com/psf/black
|
|
49
50
|
|
|
50
|
-
.. |CI| image:: https://github.com/diffpy/diffpy.fourigui/actions/workflows/matrix-and-codecov
|
|
51
|
-
:target: https://github.com/diffpy/diffpy.fourigui/actions/workflows/matrix-and-codecov
|
|
51
|
+
.. |CI| image:: https://github.com/diffpy/diffpy.fourigui/actions/workflows/matrix-and-codecov.yml/badge.svg
|
|
52
|
+
:target: https://github.com/diffpy/diffpy.fourigui/actions/workflows/matrix-and-codecov.yml
|
|
52
53
|
|
|
53
54
|
.. |Codecov| image:: https://codecov.io/gh/diffpy/diffpy.fourigui/branch/main/graph/badge.svg
|
|
54
55
|
:target: https://codecov.io/gh/diffpy/diffpy.fourigui
|
|
@@ -57,8 +58,9 @@ Requires-Dist: numpy
|
|
|
57
58
|
:target: https://anaconda.org/conda-forge/diffpy.fourigui
|
|
58
59
|
|
|
59
60
|
.. |PR| image:: https://img.shields.io/badge/PR-Welcome-29ab47ff
|
|
61
|
+
:target: https://github.com/diffpy/diffpy.fourigui/pulls
|
|
60
62
|
|
|
61
|
-
.. |
|
|
63
|
+
.. |PyPI| image:: https://img.shields.io/pypi/v/diffpy.fourigui
|
|
62
64
|
:target: https://pypi.org/project/diffpy.fourigui/
|
|
63
65
|
|
|
64
66
|
.. |PythonVersion| image:: https://img.shields.io/pypi/pyversions/diffpy.fourigui
|
|
@@ -67,7 +69,7 @@ Requires-Dist: numpy
|
|
|
67
69
|
.. |Tracking| image:: https://img.shields.io/badge/issue_tracking-github-blue
|
|
68
70
|
:target: https://github.com/diffpy/diffpy.fourigui/issues
|
|
69
71
|
|
|
70
|
-
Tool for visualizing 3D diffraction and PDF
|
|
72
|
+
Tool for visualizing 3D diffraction and PDF images.
|
|
71
73
|
|
|
72
74
|
Diffpy.fourigui is a tool to visualize and process 3D data sets written with the Python programming language.
|
|
73
75
|
Diffpy.fourigui always displays one slice perpendicular to one axis and allows scrolling through the 3D data set along
|
|
@@ -123,6 +125,19 @@ and run the following ::
|
|
|
123
125
|
|
|
124
126
|
pip install .
|
|
125
127
|
|
|
128
|
+
This package also provides command-line utilities. To check the software has been installed correctly, type ::
|
|
129
|
+
|
|
130
|
+
diffpy.fourigui --version
|
|
131
|
+
|
|
132
|
+
You can also type the following command to verify the installation. ::
|
|
133
|
+
|
|
134
|
+
python -c "import diffpy.fourigui; print(diffpy.fourigui.__version__)"
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
To view the basic usage and available commands, type ::
|
|
138
|
+
|
|
139
|
+
diffpy.fourigui -h
|
|
140
|
+
|
|
126
141
|
Getting Started
|
|
127
142
|
---------------
|
|
128
143
|
|
|
@@ -156,9 +171,14 @@ trying to commit again.
|
|
|
156
171
|
|
|
157
172
|
Improvements and fixes are always appreciated.
|
|
158
173
|
|
|
159
|
-
Before contributing, please read our `Code of Conduct <https://github.com/diffpy/diffpy.fourigui/blob/main/
|
|
174
|
+
Before contributing, please read our `Code of Conduct <https://github.com/diffpy/diffpy.fourigui/blob/main/CODE-OF-CONDUCT.rst>`_.
|
|
160
175
|
|
|
161
176
|
Contact
|
|
162
177
|
-------
|
|
163
178
|
|
|
164
|
-
For more information on diffpy.fourigui please visit the project `web-page <https://diffpy.github.io/>`_ or email
|
|
179
|
+
For more information on diffpy.fourigui please visit the project `web-page <https://diffpy.github.io/>`_ or email the maintainers ``Simon Billinge(sbillinge@ucsb.edu)``.
|
|
180
|
+
|
|
181
|
+
Acknowledgements
|
|
182
|
+
----------------
|
|
183
|
+
|
|
184
|
+
``diffpy.fourigui`` is built and maintained with `scikit-package <https://scikit-package.github.io/scikit-package/>`_.
|
|
@@ -3,11 +3,10 @@ LICENSE.rst
|
|
|
3
3
|
MANIFEST.in
|
|
4
4
|
README.rst
|
|
5
5
|
pyproject.toml
|
|
6
|
-
requirements/build.txt
|
|
7
6
|
requirements/conda.txt
|
|
8
7
|
requirements/docs.txt
|
|
9
8
|
requirements/pip.txt
|
|
10
|
-
requirements/
|
|
9
|
+
requirements/tests.txt
|
|
11
10
|
src/diffpy/__init__.py
|
|
12
11
|
src/diffpy.fourigui.egg-info/PKG-INFO
|
|
13
12
|
src/diffpy.fourigui.egg-info/SOURCES.txt
|
|
@@ -17,6 +16,7 @@ src/diffpy.fourigui.egg-info/requires.txt
|
|
|
17
16
|
src/diffpy.fourigui.egg-info/top_level.txt
|
|
18
17
|
src/diffpy/fourigui/__init__.py
|
|
19
18
|
src/diffpy/fourigui/fourigui.py
|
|
19
|
+
src/diffpy/fourigui/fourigui_app.py
|
|
20
20
|
src/diffpy/fourigui/version.py
|
|
21
21
|
tests/conftest.py
|
|
22
22
|
tests/integration_test.py
|
|
@@ -24,12 +24,12 @@ tests/test_fourigui.py
|
|
|
24
24
|
tests/test_version.py
|
|
25
25
|
tests/testdata/__init__.py
|
|
26
26
|
tests/testdata/dummydata.h5
|
|
27
|
+
tests/testdata/gofr-.h5
|
|
28
|
+
tests/testdata/gofr-cut.h5
|
|
29
|
+
tests/testdata/gofr-from-sofq-cut-10to40px.h5
|
|
30
|
+
tests/testdata/gofr-from-sofq-cut-15to35px.h5
|
|
27
31
|
tests/testdata/gofr.h5
|
|
28
|
-
tests/testdata/gofr_.h5
|
|
29
|
-
tests/testdata/gofr_cut.h5
|
|
30
|
-
tests/testdata/gofr_from_sofq_cut_10to40px.h5
|
|
31
|
-
tests/testdata/gofr_from_sofq_cut_15to35px.h5
|
|
32
32
|
tests/testdata/make_testdata.py
|
|
33
|
-
tests/testdata/sofq.h5
|
|
34
|
-
tests/testdata/
|
|
35
|
-
tests/testdata/
|
|
33
|
+
tests/testdata/sofq-cut-10to40px.h5
|
|
34
|
+
tests/testdata/sofq-cut-15to35px.h5
|
|
35
|
+
tests/testdata/sofq.h5
|
|
@@ -13,11 +13,19 @@ class TestGui(unittest.TestCase):
|
|
|
13
13
|
|
|
14
14
|
# set up test data
|
|
15
15
|
self.test_sofq = h5py.File("tests/testdata/sofq.h5")["data"]
|
|
16
|
-
self.test_sofq_cut_10to40px = h5py.File(
|
|
17
|
-
|
|
16
|
+
self.test_sofq_cut_10to40px = h5py.File(
|
|
17
|
+
"tests/testdata/sofq-cut-10to40px.h5"
|
|
18
|
+
)["data"]
|
|
19
|
+
self.test_sofq_cut_15to35px = h5py.File(
|
|
20
|
+
"tests/testdata/sofq-cut-15to35px.h5"
|
|
21
|
+
)["data"]
|
|
18
22
|
self.test_gofr = h5py.File("tests/testdata/gofr.h5")["data"]
|
|
19
|
-
self.test_gofr_cut_10to40px = h5py.File(
|
|
20
|
-
|
|
23
|
+
self.test_gofr_cut_10to40px = h5py.File(
|
|
24
|
+
"tests/testdata/gofr-from-sofq-cut-10to40px.h5"
|
|
25
|
+
)["data"]
|
|
26
|
+
self.test_gofr_cut_15to35px = h5py.File(
|
|
27
|
+
"tests/testdata/gofr-from-sofq-cut-15to35px.h5"
|
|
28
|
+
)["data"]
|
|
21
29
|
|
|
22
30
|
def test_load_cube_testdataset1(self):
|
|
23
31
|
# given
|
|
@@ -34,26 +42,40 @@ class TestGui(unittest.TestCase):
|
|
|
34
42
|
def test_load_cube_testdataset2(self):
|
|
35
43
|
# given
|
|
36
44
|
self.test_gui.filename_entry.delete(0, "end")
|
|
37
|
-
self.test_gui.filename_entry.insert(
|
|
45
|
+
self.test_gui.filename_entry.insert(
|
|
46
|
+
0, "tests/testdata/sofq-cut-10to40px.h5"
|
|
47
|
+
)
|
|
38
48
|
|
|
39
49
|
# when
|
|
40
50
|
self.test_gui.load_cube()
|
|
41
51
|
result = self.test_gui.cube
|
|
42
52
|
|
|
43
53
|
# then
|
|
44
|
-
self.assertTrue(
|
|
54
|
+
self.assertTrue(
|
|
55
|
+
np.allclose(
|
|
56
|
+
np.nan_to_num(result),
|
|
57
|
+
np.nan_to_num(self.test_sofq_cut_10to40px),
|
|
58
|
+
)
|
|
59
|
+
)
|
|
45
60
|
|
|
46
61
|
def test_load_cube_testdataset3(self):
|
|
47
62
|
# given
|
|
48
63
|
self.test_gui.filename_entry.delete(0, "end")
|
|
49
|
-
self.test_gui.filename_entry.insert(
|
|
64
|
+
self.test_gui.filename_entry.insert(
|
|
65
|
+
0, "tests/testdata/sofq-cut-15to35px.h5"
|
|
66
|
+
)
|
|
50
67
|
|
|
51
68
|
# when
|
|
52
69
|
self.test_gui.load_cube()
|
|
53
70
|
result = self.test_gui.cube
|
|
54
71
|
|
|
55
72
|
# then
|
|
56
|
-
self.assertTrue(
|
|
73
|
+
self.assertTrue(
|
|
74
|
+
np.allclose(
|
|
75
|
+
np.nan_to_num(result),
|
|
76
|
+
np.nan_to_num(self.test_sofq_cut_15to35px),
|
|
77
|
+
)
|
|
78
|
+
)
|
|
57
79
|
|
|
58
80
|
def test_fft_testdataset1(self):
|
|
59
81
|
# given
|
|
@@ -18,7 +18,7 @@ class TestGui(unittest.TestCase):
|
|
|
18
18
|
def test_init(self):
|
|
19
19
|
self.assertFalse(self.test_gui.loaded)
|
|
20
20
|
self.assertFalse(self.test_gui.transformed)
|
|
21
|
-
self.assertFalse(self.test_gui.
|
|
21
|
+
self.assertFalse(self.test_gui.cutoff_applied)
|
|
22
22
|
self.assertFalse(self.test_gui.transcutted)
|
|
23
23
|
self.assertFalse(self.test_gui.cutoff.get())
|
|
24
24
|
self.assertFalse(self.test_gui.space.get())
|
|
@@ -60,7 +60,9 @@ class TestGui(unittest.TestCase):
|
|
|
60
60
|
self.test_gui.fft()
|
|
61
61
|
|
|
62
62
|
# then
|
|
63
|
-
self.assertTrue(
|
|
63
|
+
self.assertTrue(
|
|
64
|
+
self.test_gui.transformed and not self.test_gui.transcutted
|
|
65
|
+
)
|
|
64
66
|
|
|
65
67
|
def test_fft_010(self):
|
|
66
68
|
# given
|
|
@@ -76,8 +78,10 @@ class TestGui(unittest.TestCase):
|
|
|
76
78
|
self.test_gui.fft()
|
|
77
79
|
|
|
78
80
|
# then
|
|
79
|
-
self.assertTrue(
|
|
80
|
-
|
|
81
|
+
self.assertTrue(
|
|
82
|
+
not self.test_gui.transformed and self.test_gui.transcutted
|
|
83
|
+
)
|
|
84
|
+
# self.assertTrue(self.test_gui.cutoff_applied)
|
|
81
85
|
|
|
82
86
|
def test_fft_001(self):
|
|
83
87
|
# given
|
|
@@ -94,7 +98,9 @@ class TestGui(unittest.TestCase):
|
|
|
94
98
|
self.test_gui.fft()
|
|
95
99
|
|
|
96
100
|
# then
|
|
97
|
-
self.assertTrue(
|
|
101
|
+
self.assertTrue(
|
|
102
|
+
self.test_gui.transformed and self.test_gui.transcutted
|
|
103
|
+
)
|
|
98
104
|
|
|
99
105
|
def test_fft_011(self):
|
|
100
106
|
# given
|
|
@@ -111,7 +117,9 @@ class TestGui(unittest.TestCase):
|
|
|
111
117
|
self.test_gui.fft()
|
|
112
118
|
|
|
113
119
|
# then
|
|
114
|
-
self.assertTrue(
|
|
120
|
+
self.assertTrue(
|
|
121
|
+
not self.test_gui.transformed and self.test_gui.transcutted
|
|
122
|
+
)
|
|
115
123
|
|
|
116
124
|
def test_fft_101(self):
|
|
117
125
|
# given
|
|
@@ -128,7 +136,9 @@ class TestGui(unittest.TestCase):
|
|
|
128
136
|
self.test_gui.fft()
|
|
129
137
|
|
|
130
138
|
# then
|
|
131
|
-
self.assertTrue(
|
|
139
|
+
self.assertTrue(
|
|
140
|
+
self.test_gui.transformed and self.test_gui.transcutted
|
|
141
|
+
)
|
|
132
142
|
|
|
133
143
|
def test_fft_111(self):
|
|
134
144
|
# given
|
|
@@ -145,7 +155,9 @@ class TestGui(unittest.TestCase):
|
|
|
145
155
|
self.test_gui.fft()
|
|
146
156
|
|
|
147
157
|
# then
|
|
148
|
-
self.assertTrue(
|
|
158
|
+
self.assertTrue(
|
|
159
|
+
self.test_gui.transformed and self.test_gui.transcutted
|
|
160
|
+
)
|
|
149
161
|
|
|
150
162
|
|
|
151
163
|
def test_applycutoff(mocker):
|
|
@@ -155,8 +167,10 @@ def test_applycutoff(mocker):
|
|
|
155
167
|
# pixels as NaN's
|
|
156
168
|
mocker.patch.object(fg.qminentry, "get", return_value=1.0)
|
|
157
169
|
mocker.patch.object(fg.qmaxentry, "get", return_value=2.0)
|
|
158
|
-
mocker.patch.object(
|
|
159
|
-
|
|
170
|
+
mocker.patch.object(
|
|
171
|
+
fg, "plot_plane"
|
|
172
|
+
) # we don't want it to plot anything so intercept
|
|
173
|
+
fg.cutoff_applied = False
|
|
160
174
|
fg.cube = np.ones((5, 5, 5))
|
|
161
175
|
expected_ones = np.ones((5, 5, 5))
|
|
162
176
|
expected_recip = np.array(
|
|
@@ -213,8 +227,9 @@ def test_applycutoff(mocker):
|
|
|
213
227
|
mocker.patch.object(fg.qmaxentry, "get", return_value=2)
|
|
214
228
|
mocker.patch.object(
|
|
215
229
|
fg, "fft"
|
|
216
|
-
) # we don't want it to do the fft so intercept.
|
|
217
|
-
|
|
230
|
+
) # we don't want it to do the fft so intercept.
|
|
231
|
+
# Should be tested separately (fixme).
|
|
232
|
+
fg.cutoff_applied = False
|
|
218
233
|
fg.cube_reci = np.ones((5, 5, 5))
|
|
219
234
|
fg.cube = np.ones((5, 5, 5))
|
|
220
235
|
mocker.patch.object(fg.space, "get", return_value=1)
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
"""Unit tests for __version__.py
|
|
2
|
-
"""
|
|
1
|
+
"""Unit tests for __version__.py."""
|
|
3
2
|
|
|
4
|
-
import diffpy.fourigui
|
|
3
|
+
import diffpy.fourigui # noqa
|
|
5
4
|
|
|
6
5
|
|
|
7
6
|
def test_package_version():
|
|
8
|
-
"""Ensure the package version is defined and not set to the initial
|
|
7
|
+
"""Ensure the package version is defined and not set to the initial
|
|
8
|
+
placeholder."""
|
|
9
9
|
assert hasattr(diffpy.fourigui, "__version__")
|
|
10
10
|
assert diffpy.fourigui.__version__ != "0.0.0"
|
|
@@ -44,9 +44,9 @@ def dummydata(fname="dummydata.h5"):
|
|
|
44
44
|
f.close()
|
|
45
45
|
|
|
46
46
|
|
|
47
|
-
# cutcube("sofq.h5", "
|
|
48
|
-
# cutcube("sofq.h5", "
|
|
47
|
+
# cutcube("sofq.h5", "sofq-cut-10to40px.h5", 10, 40)
|
|
48
|
+
# cutcube("sofq.h5", "sofq-cut-15to35px.h5", 15, 35)
|
|
49
49
|
# fftcube("sofq.h5", "gofr.h5")
|
|
50
|
-
# fftcube("
|
|
51
|
-
# fftcube("
|
|
50
|
+
# fftcube("sofq-cut-10to40px.h5", "gofr-from-sofq-cut-10to40px.h5")
|
|
51
|
+
# fftcube("sofq-cut-15to35px.h5", "gofr-from-sofq-cut-15to35px.h5")
|
|
52
52
|
dummydata()
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/diffpy_fourigui-0.2.0rc3/requirements/test.txt → /diffpy_fourigui-0.3.0/requirements/tests.txt
RENAMED
|
File without changes
|
|
File without changes
|
{diffpy_fourigui-0.2.0rc3 → diffpy_fourigui-0.3.0}/src/diffpy.fourigui.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
{diffpy_fourigui-0.2.0rc3 → diffpy_fourigui-0.3.0}/src/diffpy.fourigui.egg-info/entry_points.txt
RENAMED
|
File without changes
|
{diffpy_fourigui-0.2.0rc3 → diffpy_fourigui-0.3.0}/src/diffpy.fourigui.egg-info/requires.txt
RENAMED
|
File without changes
|
{diffpy_fourigui-0.2.0rc3 → diffpy_fourigui-0.3.0}/src/diffpy.fourigui.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/diffpy_fourigui-0.2.0rc3/tests/testdata/gofr_.h5 → /diffpy_fourigui-0.3.0/tests/testdata/gofr-.h5
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|