nxs-analysis-tools 0.0.27__tar.gz → 0.0.29__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 (25) hide show
  1. {nxs-analysis-tools-0.0.27/src/nxs_analysis_tools.egg-info → nxs-analysis-tools-0.0.29}/PKG-INFO +1 -1
  2. {nxs-analysis-tools-0.0.27 → nxs-analysis-tools-0.0.29}/pyproject.toml +1 -1
  3. {nxs-analysis-tools-0.0.27 → nxs-analysis-tools-0.0.29}/src/_meta/__init__.py +1 -1
  4. {nxs-analysis-tools-0.0.27 → nxs-analysis-tools-0.0.29}/src/nxs_analysis_tools/datareduction.py +3 -2
  5. {nxs-analysis-tools-0.0.27 → nxs-analysis-tools-0.0.29}/src/nxs_analysis_tools/fitting.py +5 -1
  6. {nxs-analysis-tools-0.0.27 → nxs-analysis-tools-0.0.29/src/nxs_analysis_tools.egg-info}/PKG-INFO +1 -1
  7. nxs-analysis-tools-0.0.29/tests/test_chess_fitting.py +21 -0
  8. nxs-analysis-tools-0.0.27/tests/test_chess_fitting.py +0 -21
  9. {nxs-analysis-tools-0.0.27 → nxs-analysis-tools-0.0.29}/LICENSE +0 -0
  10. {nxs-analysis-tools-0.0.27 → nxs-analysis-tools-0.0.29}/MANIFEST.in +0 -0
  11. {nxs-analysis-tools-0.0.27 → nxs-analysis-tools-0.0.29}/README.md +0 -0
  12. {nxs-analysis-tools-0.0.27 → nxs-analysis-tools-0.0.29}/setup.cfg +0 -0
  13. {nxs-analysis-tools-0.0.27 → nxs-analysis-tools-0.0.29}/setup.py +0 -0
  14. {nxs-analysis-tools-0.0.27 → nxs-analysis-tools-0.0.29}/src/nxs_analysis_tools/__init__.py +0 -0
  15. {nxs-analysis-tools-0.0.27 → nxs-analysis-tools-0.0.29}/src/nxs_analysis_tools/chess.py +0 -0
  16. {nxs-analysis-tools-0.0.27 → nxs-analysis-tools-0.0.29}/src/nxs_analysis_tools/pairdistribution.py +0 -0
  17. {nxs-analysis-tools-0.0.27 → nxs-analysis-tools-0.0.29}/src/nxs_analysis_tools.egg-info/SOURCES.txt +0 -0
  18. {nxs-analysis-tools-0.0.27 → nxs-analysis-tools-0.0.29}/src/nxs_analysis_tools.egg-info/dependency_links.txt +0 -0
  19. {nxs-analysis-tools-0.0.27 → nxs-analysis-tools-0.0.29}/src/nxs_analysis_tools.egg-info/requires.txt +0 -0
  20. {nxs-analysis-tools-0.0.27 → nxs-analysis-tools-0.0.29}/src/nxs_analysis_tools.egg-info/top_level.txt +0 -0
  21. {nxs-analysis-tools-0.0.27 → nxs-analysis-tools-0.0.29}/tests/test_chess.py +0 -0
  22. {nxs-analysis-tools-0.0.27 → nxs-analysis-tools-0.0.29}/tests/test_datareduction.py +0 -0
  23. {nxs-analysis-tools-0.0.27 → nxs-analysis-tools-0.0.29}/tests/test_fitting.py +0 -0
  24. {nxs-analysis-tools-0.0.27 → nxs-analysis-tools-0.0.29}/tests/test_lmfit.py +0 -0
  25. {nxs-analysis-tools-0.0.27 → nxs-analysis-tools-0.0.29}/tests/test_pairdistribution.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: nxs-analysis-tools
3
- Version: 0.0.27
3
+ Version: 0.0.29
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
@@ -6,7 +6,7 @@ build-backend = 'setuptools.build_meta'
6
6
 
7
7
  [project]
8
8
  name = 'nxs-analysis-tools'
9
- version = '0.0.27'
9
+ version = '0.0.29'
10
10
  description = 'Reduce and transform nexus format (.nxs) scattering data.'
11
11
  readme = 'README.md'
12
12
  requires-python = '>=3.7'
@@ -6,5 +6,5 @@ __author__ = 'Steven J. Gomez Alvarado'
6
6
  __email__ = 'stevenjgomez@ucsb.edu'
7
7
  __copyright__ = f"2023, {__author__}"
8
8
  __license__ = 'MIT'
9
- __version__= '0.0.27'
9
+ __version__= '0.0.29'
10
10
  __repo_url__ = 'https://github.com/stevenjgomez/nxs_analysis_tools'
@@ -695,7 +695,8 @@ def rotate_data(data, lattice_angle, rotation_angle, rotation_axis, printout=Fal
695
695
 
696
696
  for i in range(len(data[data.axes[rotation_axis]])):
697
697
  if printout:
698
- print(f'Rotating {data.axes[rotation_axis]}={data[data.axes[rotation_axis]][i]}...')
698
+ print(f'\rRotating {data.axes[rotation_axis]}={data[data.axes[rotation_axis]][i]}... ',
699
+ end='', flush=True)
699
700
  # Identify current slice
700
701
  if rotation_axis == 0:
701
702
  sliced_data = data[i, :, :]
@@ -762,7 +763,7 @@ def rotate_data(data, lattice_angle, rotation_angle, rotation_axis, printout=Fal
762
763
  output_array[:, i, :] = counts_unpadded
763
764
  elif rotation_axis == 2:
764
765
  output_array[:, :, i] = counts_unpadded
765
- print('Done.')
766
+ print('\nDone.')
766
767
  return NXdata(NXfield(output_array, name='counts'),
767
768
  (data[data.axes[0]], data[data.axes[1]], data[data.axes[2]]))
768
769
 
@@ -120,7 +120,11 @@ class LinecutModel:
120
120
  # Else, combine the components into a composite model and use that as the
121
121
  else:
122
122
  self.model_components = model_components
123
- self.model = CompositeModel(*model_components, operator.add)
123
+ self.model = model_components[0]
124
+
125
+ # Combine remaining components into the composite model
126
+ for component in model_components[1:]:
127
+ self.model = CompositeModel(self.model, component, operator.add)
124
128
 
125
129
  def set_param_hint(self, *args, **kwargs):
126
130
  """
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: nxs-analysis-tools
3
- Version: 0.0.27
3
+ Version: 0.0.29
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
@@ -0,0 +1,21 @@
1
+ import sys
2
+ sys.path.append('../src/nxs_analysis_tools/')
3
+ from datareduction import load_data, Scissors
4
+ from chess import *
5
+ from fitting import *
6
+
7
+ from lmfit.models import GaussianModel, LinearModel, LorentzianModel
8
+
9
+ sample = TempDependence()
10
+ sample.load_datasets(folder=r'K:\pokharel-3470-a\PrCd3P3\BRO7')
11
+ sample.cut_data(center=(0.5,-3,0), window=(0.1,0.3,0.1))
12
+
13
+ sample.set_model_components([GaussianModel(prefix='peak'), LorentzianModel(prefix='diffuse'), LinearModel(prefix='background')])
14
+ sample.set_param_hint('peakcenter', min=-0.1, max=0.1)
15
+ sample.make_params()
16
+ sample.guess()
17
+ sample.print_initial_params()
18
+ sample.plot_initial_guess()
19
+ sample.fit()
20
+ sample.plot_fit()
21
+ sample.print_fit_report()
@@ -1,21 +0,0 @@
1
- import sys
2
- sys.path.append('../src/nxs_analysis_tools/')
3
- from datareduction import load_data, Scissors
4
- from chess import *
5
- from fitting import *
6
-
7
- from lmfit.models import GaussianModel, LinearModel
8
-
9
- sample = TempDependence()
10
- sample.load_datasets(folder='../docs/source/examples/example_data/sample_name')
11
- sample.cut_data(center=(0,0,0), window=(0.1,0.75,0.1))
12
-
13
- sample.set_model_components([GaussianModel(prefix='peak'), LinearModel(prefix='background')])
14
- sample.set_param_hint('peakcenter', min=-0.1, max=0.1)
15
- sample.make_params()
16
- sample.guess()
17
- sample.print_initial_params()
18
- sample.plot_initial_guess()
19
- sample.fit()
20
- sample.plot_fit()
21
- sample.print_fit_report()