nxs-analysis-tools 0.1.2__tar.gz → 0.1.3__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.

Potentially problematic release.


This version of nxs-analysis-tools might be problematic. Click here for more details.

Files changed (31) hide show
  1. nxs_analysis_tools-0.1.3/MANIFEST.in +3 -0
  2. {nxs_analysis_tools-0.1.2/src/nxs_analysis_tools.egg-info → nxs_analysis_tools-0.1.3}/PKG-INFO +6 -4
  3. {nxs_analysis_tools-0.1.2 → nxs_analysis_tools-0.1.3}/pyproject.toml +29 -5
  4. {nxs_analysis_tools-0.1.2 → nxs_analysis_tools-0.1.3}/src/_meta/__init__.py +1 -1
  5. {nxs_analysis_tools-0.1.2 → nxs_analysis_tools-0.1.3}/src/nxs_analysis_tools/datareduction.py +16 -17
  6. {nxs_analysis_tools-0.1.2 → nxs_analysis_tools-0.1.3}/src/nxs_analysis_tools/pairdistribution.py +2 -0
  7. {nxs_analysis_tools-0.1.2 → nxs_analysis_tools-0.1.3}/src/nxs_analysis_tools.egg-info/SOURCES.txt +0 -5
  8. nxs_analysis_tools-0.1.2/MANIFEST.in +0 -3
  9. nxs_analysis_tools-0.1.2/PKG-INFO +0 -99
  10. nxs_analysis_tools-0.1.2/src/nxs_analysis_tools.egg-info/dependency_links.txt +0 -1
  11. nxs_analysis_tools-0.1.2/src/nxs_analysis_tools.egg-info/requires.txt +0 -25
  12. nxs_analysis_tools-0.1.2/src/nxs_analysis_tools.egg-info/top_level.txt +0 -2
  13. {nxs_analysis_tools-0.1.2 → nxs_analysis_tools-0.1.3}/LICENSE +0 -0
  14. {nxs_analysis_tools-0.1.2 → nxs_analysis_tools-0.1.3}/README.md +0 -0
  15. {nxs_analysis_tools-0.1.2 → nxs_analysis_tools-0.1.3}/setup.cfg +0 -0
  16. {nxs_analysis_tools-0.1.2 → nxs_analysis_tools-0.1.3}/setup.py +0 -0
  17. {nxs_analysis_tools-0.1.2 → nxs_analysis_tools-0.1.3}/src/nxs_analysis_tools/__init__.py +0 -0
  18. {nxs_analysis_tools-0.1.2 → nxs_analysis_tools-0.1.3}/src/nxs_analysis_tools/chess.py +0 -0
  19. {nxs_analysis_tools-0.1.2 → nxs_analysis_tools-0.1.3}/src/nxs_analysis_tools/fitting.py +0 -0
  20. {nxs_analysis_tools-0.1.2 → nxs_analysis_tools-0.1.3}/tests/test_accurate_highlight.py +0 -0
  21. {nxs_analysis_tools-0.1.2 → nxs_analysis_tools-0.1.3}/tests/test_chess.py +0 -0
  22. {nxs_analysis_tools-0.1.2 → nxs_analysis_tools-0.1.3}/tests/test_chess_fitting.py +0 -0
  23. {nxs_analysis_tools-0.1.2 → nxs_analysis_tools-0.1.3}/tests/test_datareduction.py +0 -0
  24. {nxs_analysis_tools-0.1.2 → nxs_analysis_tools-0.1.3}/tests/test_fitting.py +0 -0
  25. {nxs_analysis_tools-0.1.2 → nxs_analysis_tools-0.1.3}/tests/test_lmfit.py +0 -0
  26. {nxs_analysis_tools-0.1.2 → nxs_analysis_tools-0.1.3}/tests/test_mask_plotting.py +0 -0
  27. {nxs_analysis_tools-0.1.2 → nxs_analysis_tools-0.1.3}/tests/test_pairdistribution.py +0 -0
  28. {nxs_analysis_tools-0.1.2 → nxs_analysis_tools-0.1.3}/tests/test_plot_slice_with_ndarray.py +0 -0
  29. {nxs_analysis_tools-0.1.2 → nxs_analysis_tools-0.1.3}/tests/test_rotate_data.py +0 -0
  30. {nxs_analysis_tools-0.1.2 → nxs_analysis_tools-0.1.3}/tests/test_sum_axis.py +0 -0
  31. {nxs_analysis_tools-0.1.2 → nxs_analysis_tools-0.1.3}/tests/test_symmetrizer_rectangular_plane.py +0 -0
@@ -0,0 +1,3 @@
1
+ # Exclude generated files
2
+ prune */__pycache__
3
+ global-exclude *.pyc *.pyo *.pyd *.swp *.bak *~ */nxs_analysis_tools.egg-info/*
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: nxs-analysis-tools
3
- Version: 0.1.2
3
+ Version: 0.1.3
4
4
  Summary: Reduce and transform nexus format (.nxs) scattering data.
5
5
  Author-email: "Steven J. Gomez Alvarado" <stevenjgomez@ucsb.edu>
6
6
  License: MIT License
@@ -29,8 +29,9 @@ Project-URL: Download, https://pypi.org/project/nxs-analysis-tools/
29
29
  Project-URL: Bug Tracker, https://github.com/stevenjgomez/nxs_analysis_tools/issues
30
30
  Project-URL: Documentation, https://nxs-analysis-tools.readthedocs.io/en/stable/
31
31
  Project-URL: Source Code, https://github.com/stevenjgomez/nxs_analysis_tools
32
+ Project-URL: DOI, https://doi.org/10.5281/zenodo.15186359
32
33
  Keywords: diffraction,xrd,nexusformat,nexus,nxs,scattering
33
- Classifier: Development Status :: 1 - Planning
34
+ Classifier: Development Status :: 5 - Production/Stable
34
35
  Classifier: Intended Audience :: Science/Research
35
36
  Classifier: License :: OSI Approved :: MIT License
36
37
  Classifier: Programming Language :: Python
@@ -43,14 +44,15 @@ Requires-Python: >=3.7
43
44
  Description-Content-Type: text/markdown
44
45
  License-File: LICENSE
45
46
  Requires-Dist: matplotlib>=3.10.0
46
- Requires-Dist: numpy>=2.0.0
47
+ Requires-Dist: numpy>=2.2.4
47
48
  Requires-Dist: ipython>=1.0.0
48
- Requires-Dist: pandas>=2.0.2
49
+ Requires-Dist: pandas>=2.2.3
49
50
  Requires-Dist: nexusformat>=1.0.8
50
51
  Requires-Dist: lmfit>=1.2.1
51
52
  Requires-Dist: astropy>=6.1.7
52
53
  Requires-Dist: pyfftw>=0.13.1
53
54
  Requires-Dist: scipy>=1.14.1
55
+ Requires-Dist: h5py>=3.13.0
54
56
  Provides-Extra: dev
55
57
  Requires-Dist: build>=0.8.0; extra == "dev"
56
58
  Requires-Dist: furo>=2022.6.21; extra == "dev"
@@ -6,7 +6,7 @@ build-backend = 'setuptools.build_meta'
6
6
 
7
7
  [project]
8
8
  name = 'nxs-analysis-tools'
9
- version = '0.1.2'
9
+ version = '0.1.3'
10
10
  description = 'Reduce and transform nexus format (.nxs) scattering data.'
11
11
  readme = 'README.md'
12
12
  requires-python = '>=3.7'
@@ -22,7 +22,7 @@ keywords = [
22
22
  'scattering',
23
23
  ]
24
24
  classifiers = [
25
- 'Development Status :: 1 - Planning',
25
+ 'Development Status :: 5 - Production/Stable',
26
26
  'Intended Audience :: Science/Research',
27
27
  'License :: OSI Approved :: MIT License',
28
28
  'Programming Language :: Python',
@@ -34,14 +34,15 @@ classifiers = [
34
34
  ]
35
35
  dependencies = [
36
36
  'matplotlib>=3.10.0',
37
- 'numpy>=2.0.0',
37
+ 'numpy>=2.2.4',
38
38
  'ipython>=1.0.0',
39
- 'pandas>=2.0.2',
39
+ 'pandas>=2.2.3',
40
40
  'nexusformat>=1.0.8',
41
41
  'lmfit>=1.2.1',
42
42
  'astropy>=6.1.7',
43
43
  'pyfftw>=0.13.1',
44
- 'scipy>=1.14.1'
44
+ 'scipy>=1.14.1',
45
+ 'h5py>=3.13.0',
45
46
  ]
46
47
 
47
48
  [project.optional-dependencies]
@@ -67,3 +68,26 @@ dev = [
67
68
  'Bug Tracker' = 'https://github.com/stevenjgomez/nxs_analysis_tools/issues'
68
69
  'Documentation' = 'https://nxs-analysis-tools.readthedocs.io/en/stable/'
69
70
  'Source Code' = 'https://github.com/stevenjgomez/nxs_analysis_tools'
71
+ 'DOI' = 'https://doi.org/10.5281/zenodo.15186359'
72
+
73
+ [tool.bumpver]
74
+ current_version = "0.1.3"
75
+ version_pattern = "MAJOR.MINOR.PATCH[-TAG]"
76
+ tag_pattern = "vMAJOR.MINOR.PATCH[-TAG]"
77
+ commit_message = "Bump version {old_version} -> {new_version}"
78
+ tag_message = "{new_version}"
79
+ tag_scope = "default"
80
+ pre_commit_hook = ""
81
+ post_commit_hook = ""
82
+ commit = true
83
+ tag = false
84
+ push = true
85
+
86
+ [tool.bumpver.file_patterns]
87
+ "pyproject.toml" = [
88
+ 'current_version = "{version}"',
89
+ "version = '{version}'"
90
+ ]
91
+ "src/_meta/__init__.py" = [
92
+ "__version__ = '{version}'",
93
+ ]
@@ -6,5 +6,5 @@ __author__ = 'Steven J. Gomez Alvarado'
6
6
  __email__ = 'stevenjgomez@ucsb.edu'
7
7
  __copyright__ = f"2023-2025, {__author__}"
8
8
  __license__ = 'MIT'
9
- __version__ = '0.1.2'
9
+ __version__ = '0.1.3'
10
10
  __repo_url__ = 'https://github.com/stevenjgomez/nxs_analysis_tools'
@@ -104,8 +104,7 @@ def array_to_nxdata(array, data_template, signal_name=None):
104
104
  d = data_template
105
105
  if signal_name is None:
106
106
  signal_name = d.signal
107
- return NXdata(NXfield(array, name=signal_name),
108
- tuple(d[d.axes[i]] for i in range(len(d.axes))))
107
+ return NXdata(NXfield(array, name=signal_name), d.nxaxes)
109
108
 
110
109
 
111
110
  def rebin_3d(array):
@@ -341,12 +340,12 @@ def plot_slice(data, X=None, Y=None, sum_axis=None, transpose=False, vmin=None,
341
340
 
342
341
  # If three-dimensional, demand sum_axis to reduce to two dimensions.
343
342
  if is_array and len(data.shape) == 3:
344
- assert sum_axis is not None, "sum_axis must be specified when data is a 3D array"
343
+ assert sum_axis is not None, "sum_axis must be specified when data is 3D."
345
344
 
346
345
  data = data.sum(axis=sum_axis)
347
346
 
348
347
  if is_nxdata and len(data.shape) == 3:
349
- assert sum_axis is not None, "sum_axis must be specified when data is a 3D array"
348
+ assert sum_axis is not None, "sum_axis must be specified when data is 3D."
350
349
 
351
350
  arr = data.nxsignal.nxdata
352
351
  arr = arr.sum(axis=sum_axis)
@@ -452,22 +451,22 @@ def plot_slice(data, X=None, Y=None, sum_axis=None, transpose=False, vmin=None,
452
451
  # Add tick marks all around
453
452
  ax.tick_params(direction='in', top=True, right=True, which='both')
454
453
 
455
- # Set tick locations
456
- if xticks is None:
457
- # Add default minor ticks
454
+ # Automatically set tick locations, only if NXdata or if X,Y axes are provided for an array
455
+ if is_nxdata or (is_array and (X is not None and Y is not None)):
456
+ # Add default minor ticks on x
458
457
  ax.xaxis.set_minor_locator(MultipleLocator(1))
459
- else:
460
- # Otherwise use user provided values
461
- ax.xaxis.set_major_locator(MultipleLocator(xticks))
462
- ax.xaxis.set_minor_locator(MultipleLocator(1))
463
- if yticks is None:
464
- # Add default minor ticks
465
- ax.yaxis.set_minor_locator(MultipleLocator(1))
466
- else:
467
- # Otherwise use user provided values
468
- ax.yaxis.set_major_locator(MultipleLocator(yticks))
458
+
459
+ if xticks is not None:
460
+ # Use user provided values
461
+ ax.xaxis.set_major_locator(MultipleLocator(xticks))
462
+
463
+ # Add default minor ticks on y
469
464
  ax.yaxis.set_minor_locator(MultipleLocator(1))
470
465
 
466
+ if yticks is not None:
467
+ # Use user provided values
468
+ ax.yaxis.set_major_locator(MultipleLocator(yticks))
469
+
471
470
  # Apply transform to tick marks
472
471
  for i in range(0, len(ax.xaxis.get_ticklines())):
473
472
  # Tick marker
@@ -400,6 +400,8 @@ class Symmetrizer3D:
400
400
  The input 3D dataset to be symmetrized.
401
401
  """
402
402
 
403
+ assert data is not None, "Symmetrizer3D requires a 3D NXdata object for initialization."
404
+
403
405
  self.a, self.b, self.c, self.al, self.be, self.ga = [None] * 6
404
406
  self.a_star, self.b_star, self.c_star, self.al_star, self.be_star, self.ga_star = [None] * 6
405
407
  self.lattice_params = None
@@ -9,11 +9,6 @@ src/nxs_analysis_tools/chess.py
9
9
  src/nxs_analysis_tools/datareduction.py
10
10
  src/nxs_analysis_tools/fitting.py
11
11
  src/nxs_analysis_tools/pairdistribution.py
12
- src/nxs_analysis_tools.egg-info/PKG-INFO
13
- src/nxs_analysis_tools.egg-info/SOURCES.txt
14
- src/nxs_analysis_tools.egg-info/dependency_links.txt
15
- src/nxs_analysis_tools.egg-info/requires.txt
16
- src/nxs_analysis_tools.egg-info/top_level.txt
17
12
  tests/test_accurate_highlight.py
18
13
  tests/test_chess.py
19
14
  tests/test_chess_fitting.py
@@ -1,3 +0,0 @@
1
- # Exclude generated files
2
- prune */__pycache__
3
- global-exclude *.pyc *.pyo *.pyd *.swp *.bak *~ */magentropy.egg-info/*
@@ -1,99 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: nxs-analysis-tools
3
- Version: 0.1.2
4
- Summary: Reduce and transform nexus format (.nxs) scattering data.
5
- Author-email: "Steven J. Gomez Alvarado" <stevenjgomez@ucsb.edu>
6
- License: MIT License
7
-
8
- Copyright (c) 2023-2025 Steven J. Gomez Alvarado
9
-
10
- Permission is hereby granted, free of charge, to any person obtaining a copy
11
- of this software and associated documentation files (the "Software"), to deal
12
- in the Software without restriction, including without limitation the rights
13
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14
- copies of the Software, and to permit persons to whom the Software is
15
- furnished to do so, subject to the following conditions:
16
-
17
- The above copyright notice and this permission notice shall be included in all
18
- copies or substantial portions of the Software.
19
-
20
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26
- SOFTWARE.
27
-
28
- Project-URL: Download, https://pypi.org/project/nxs-analysis-tools/
29
- Project-URL: Bug Tracker, https://github.com/stevenjgomez/nxs_analysis_tools/issues
30
- Project-URL: Documentation, https://nxs-analysis-tools.readthedocs.io/en/stable/
31
- Project-URL: Source Code, https://github.com/stevenjgomez/nxs_analysis_tools
32
- Keywords: diffraction,xrd,nexusformat,nexus,nxs,scattering
33
- Classifier: Development Status :: 1 - Planning
34
- Classifier: Intended Audience :: Science/Research
35
- Classifier: License :: OSI Approved :: MIT License
36
- Classifier: Programming Language :: Python
37
- Classifier: Programming Language :: Python :: 3
38
- Classifier: Programming Language :: Python :: 3.9
39
- Classifier: Programming Language :: Python :: 3.10
40
- Classifier: Topic :: Scientific/Engineering :: Image Processing
41
- Classifier: Topic :: Scientific/Engineering
42
- Requires-Python: >=3.7
43
- Description-Content-Type: text/markdown
44
- License-File: LICENSE
45
- Requires-Dist: matplotlib>=3.10.0
46
- Requires-Dist: numpy>=2.0.0
47
- Requires-Dist: ipython>=1.0.0
48
- Requires-Dist: pandas>=2.0.2
49
- Requires-Dist: nexusformat>=1.0.8
50
- Requires-Dist: lmfit>=1.2.1
51
- Requires-Dist: astropy>=6.1.7
52
- Requires-Dist: pyfftw>=0.13.1
53
- Requires-Dist: scipy>=1.14.1
54
- Provides-Extra: dev
55
- Requires-Dist: build>=0.8.0; extra == "dev"
56
- Requires-Dist: furo>=2022.6.21; extra == "dev"
57
- Requires-Dist: ipykernel>=6.9.1; extra == "dev"
58
- Requires-Dist: myst-nb>=0.16.0; extra == "dev"
59
- Requires-Dist: myst-parser>=0.18.0; extra == "dev"
60
- Requires-Dist: numpydoc>=1.4.0; extra == "dev"
61
- Requires-Dist: pandoc>=2.2; extra == "dev"
62
- Requires-Dist: pylint>=2.12.2; extra == "dev"
63
- Requires-Dist: pytest>=7.1.2; extra == "dev"
64
- Requires-Dist: sphinx>=5.0.2; extra == "dev"
65
- Requires-Dist: sphinx-autobuild>=2021.3.14; extra == "dev"
66
- Requires-Dist: sphinx-copybutton>=0.5.0; extra == "dev"
67
- Requires-Dist: sphinxext-opengraph>=0.6.3; extra == "dev"
68
- Requires-Dist: twine>=4.0.1; extra == "dev"
69
- Dynamic: license-file
70
-
71
- # nxs-analysis-tools
72
-
73
- [![DOI](https://zenodo.org/badge/644189683.svg)](https://doi.org/10.5281/zenodo.15186359)
74
- [![PyPI](https://img.shields.io/pypi/v/nxs-analysis-tools)](https://pypi.org/project/nxs-analysis-tools/)
75
- [![Documentation Status](https://readthedocs.org/projects/nxs-analysis-tools/badge/?version=latest)](https://nxs-analysis-tools.readthedocs.io/en/latest/?badge=latest)
76
-
77
- ## Overview
78
-
79
- nxs-analysis-tools provides a suite of tools for slicing (2D), cutting (1D), and transforming (_e.g._, symmetrization, interpolation, delta-PDF) nexus format (.nxs) scattering data.
80
-
81
- View the documentation [here](https://nxs-analysis-tools.readthedocs.io/en/stable/).
82
-
83
- ## Installation
84
-
85
- Install nxs-analysis-tools with ``pip``:
86
-
87
- ```{code-block} console
88
- pip install nxs-analysis-tools
89
- ```
90
-
91
- The source code can be downloaded from the nxs-analysis-tools Git repository:
92
-
93
- ```{code-block} console
94
- git clone https://github.com/stevenjgomez/nxs-analysis-tools.git
95
- ```
96
-
97
- ## License
98
-
99
- This project is licensed under the MIT License.
@@ -1,25 +0,0 @@
1
- matplotlib>=3.10.0
2
- numpy>=2.0.0
3
- ipython>=1.0.0
4
- pandas>=2.0.2
5
- nexusformat>=1.0.8
6
- lmfit>=1.2.1
7
- astropy>=6.1.7
8
- pyfftw>=0.13.1
9
- scipy>=1.14.1
10
-
11
- [dev]
12
- build>=0.8.0
13
- furo>=2022.6.21
14
- ipykernel>=6.9.1
15
- myst-nb>=0.16.0
16
- myst-parser>=0.18.0
17
- numpydoc>=1.4.0
18
- pandoc>=2.2
19
- pylint>=2.12.2
20
- pytest>=7.1.2
21
- sphinx>=5.0.2
22
- sphinx-autobuild>=2021.3.14
23
- sphinx-copybutton>=0.5.0
24
- sphinxext-opengraph>=0.6.3
25
- twine>=4.0.1
@@ -1,2 +0,0 @@
1
- _meta
2
- nxs_analysis_tools