Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Finishing the manipulatons.py Rewrite #47

Open
wants to merge 37 commits into
base: release_0.9.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 23 commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
9573f92
Added file with unit tests for slicer averagers based on constructed …
ehewins Aug 23, 2023
a5cb0a4
Initial version of averagers with cartesian ROI, and made correspondi…
ehewins Aug 31, 2023
b8423ba
Changed the binning/weighting process for _Slab to make the fractiona…
ehewins Sep 1, 2023
b10edd3
Refactoring to test SlabX, SlabY, SectorQ and SectorPhi rather than t…
ehewins Sep 4, 2023
7670d2b
Restructured ROI classes and added DirectionalAverage class, which of…
ehewins Sep 7, 2023
b3829a4
Updated the unit tests to suit the new_manipulations.py implementation.
ehewins Sep 7, 2023
2503d81
Added dedicated WedgeQ and WedgePhi classes, plus corresponding unit …
ehewins Sep 8, 2023
c2ee6bd
Added documentation to new manipulations module
ehewins Sep 17, 2023
fb0da1a
Replaced python logical_and with numpy logical_and for speed
ehewins Sep 17, 2023
1bcd84f
Removed some superfluous logical_and checks. Both arrays should have …
ehewins Sep 17, 2023
78df64b
Added scipy to dependencies
lucas-wilkins Sep 18, 2023
66a29a0
Merge branch 'master' into 46-manipulations-dot-py-rewrite
lucas-wilkins Sep 22, 2023
980fafe
Forgot to remove 'angles + np.pi' from SectorQ call, no longer needed…
ehewins Sep 18, 2023
cb27521
Added unit tests for DirectionalAverage class
ehewins Sep 22, 2023
f13fad4
Move averaging tests from data loader to manipulations folder
krzywon Oct 16, 2023
7b46314
Move files used in averaging tests
krzywon Oct 16, 2023
f7950c4
Create and apply interval type enum to remove hard-coded strings
krzywon Oct 16, 2023
17bb08c
Allow for non-linear bin spacings in the directional averaging
krzywon Oct 16, 2023
a95eee0
Update unit tests to account for new bin widths
krzywon Oct 16, 2023
b41b7f6
Rename manipulations_new to averaging and update internal references …
krzywon Oct 16, 2023
d7996ef
Add deprecation warning that is triggered on import of manipulations.py
krzywon Oct 16, 2023
06da060
Use Enum instead of StrEnum to ensure backwards compatibility with py…
krzywon Oct 16, 2023
bda0ec8
Merge branch 'master' into 46-manipulations-dot-py-rewrite
krzywon Oct 16, 2023
715a8d6
Grammar
lucas-wilkins Oct 24, 2023
71560b9
Move 2D data restructure function to data_info where it is more seman…
krzywon Oct 24, 2023
fc5a712
Merge remote-tracking branch 'origin/46-manipulations-dot-py-rewrite'…
krzywon Oct 24, 2023
4020cef
Revert removal of reader2d_converter from manipulations
krzywon Oct 25, 2023
31ed62a
Update deprecation messages
krzywon Oct 25, 2023
85842d7
Port RingCut from manipulations to averaging
krzywon Oct 25, 2023
b92576c
Port Boxcut from manipulations to averaging
krzywon Oct 25, 2023
3e81f2d
Update documentation in manipulations to point to new test location
krzywon Oct 25, 2023
01f4daa
Move Sectorcut to averaging from manipulations
krzywon Oct 25, 2023
f8d7cbf
Use unmasked data for masking purposes
krzywon Oct 25, 2023
f657a53
Fix issue where sector cut only masked one half of region
krzywon Oct 26, 2023
8edf310
Type hinting
lucas-wilkins Dec 6, 2023
30f8bf0
Fix for first bug
lucas-wilkins Dec 7, 2023
03c45b5
Merge branch 'release_0.9.0' into 46-manipulations-dot-py-rewrite
wpotrzebowski Oct 27, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ lxml

# Calculation
numpy
scipy
krzywon marked this conversation as resolved.
Show resolved Hide resolved

# Unit testing
pytest
Expand Down
917 changes: 917 additions & 0 deletions sasdata/data_util/averaging.py

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions sasdata/data_util/manipulations.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,12 @@
import math
import numpy as np
from typing import Optional, Union
from warnings import warn

from sasdata.dataloader.data_info import Data1D, Data2D

warn("sasdata.data_util.manipulations is deprecated and replaced by sasdata.data_util.averaging.",
krzywon marked this conversation as resolved.
Show resolved Hide resolved
DeprecationWarning, stacklevel=2)

def position_and_wavelength_to_q(dx: float, dy: float, detector_distance: float, wavelength: float) -> float:
"""
Expand Down
Binary file added test/sasmanipulations/data/MAR07232_rest.h5
Binary file not shown.
21 changes: 21 additions & 0 deletions test/sasmanipulations/data/avg_testdata.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
0.00019987186878 -0.01196215 0.148605728355
0.000453772721237 0.02091606 0.23372601
0.000750492390439 -0.01337855 0.17169562
0.00103996394336 0.03062 0.13136407
0.0013420198959 0.0811008333333 0.10681163
0.001652061869 0.167022288372 0.10098903
0.00196086470492 27.5554711176 0.7350533
0.00226262401224 105.031578947 1.35744586624
0.00256734439716 82.1791776119 1.10749938588
0.0028637128388 54.714657971 0.890486416264
0.00315257408712 36.8455584416 0.691746880003
0.00344644126616 24.8938701149 0.534917225468
0.00374248202229 16.5905619565 0.424655384023
0.00404393067437 11.4714217925 0.328969543128
0.004346317814 8.05405805556 0.273083524998
0.00465162170627 5.5823291129 0.21217630209
0.00495449803049 4.2574845082 0.186808495528
0.00525641407066 3.30448963768 0.154743584955
0.00555735057365 2.6995389781 0.140373302568
0.00585577429002 2.03298512 0.116418358232

Loading
Loading