We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent cd46874 commit d3f7774Copy full SHA for d3f7774
2 files changed
diffpy/snmf/subroutines.py
@@ -25,7 +25,7 @@ def lift_data(data_input, lift=1):
25
26
"""
27
data_input = np.asarray(data_input)
28
- return data_input - (np.min(data_input) * lift)
+ return data_input + np.abs(np.min(data_input) * lift)
29
30
31
def initialize_arrays(number_of_components, number_of_moments, signal_length):
diffpy/snmf/tests/test_subroutines.py
@@ -139,9 +139,9 @@ def test_reconstruct_data(trd):
139
tld = [(([[[1, -1, 1], [0, 0, 0], [2, 10, -3]], 1]), ([[4, 2, 4], [3, 3, 3], [5, 13, 0]])),
140
(([[[1, -1, 1], [0, 0, 0], [2, 10, -3]], 0]), ([[1, -1, 1], [0, 0, 0], [2, 10, -3]])),
141
(([[[1, -1, 1], [0, 0, 0], [2, 10, -3]], .5]), ([[2.5, .5, 2.5], [1.5, 1.5, 1.5], [3.5, 11.5, -1.5]])),
142
- (([[[1, -1, 1], [0, 0, 0], [2, 10, -3]], -1]), ([[-2, -4, -2], [-3, -3, -3], [-1, 7, -6]])),
+ (([[[1, -1, 1], [0, 0, 0], [2, 10, -3]], -1]), ([[4, 2, 4], [3, 3, 3], [5, 13, 0]])),
143
(([[[0, 0, 0], [0, 0, 0], [0, 0, 0]], 100]), ([[0, 0, 0], [0, 0, 0], [0, 0, 0]])),
144
- (([[[1.5, 2], [10.5, 1], [0.5, 2]], 1]), ([[1, 1.5], [10, .5], [0, 1.5]])),
+ (([[[1.5, 2], [10.5, 1], [0.5, 2]], 1]), ([[2, 2.5], [11, 1.5], [1, 2.5]])),
145
(([[[-10, -10.5], [-12.2, -12.2], [0, 0]], 1]), ([[2.2, 1.7], [0, 0], [12.2, 12.2]])),
146
]
147
@pytest.mark.parametrize('tld', tld)
0 commit comments