def test_update_adjustments(self, initial_adjustments, adjustments_to_add, expected_adjustments_with_append, expected_adjustments_with_prepend): methods = ['append', 'prepend'] expected_outputs = [ expected_adjustments_with_append, expected_adjustments_with_prepend ] for method, expected_output in zip(methods, expected_outputs): data = arange(30, dtype=float).reshape(6, 5) adjusted_array = AdjustedArray(data, initial_adjustments, float('nan')) adjusted_array.update_adjustments(adjustments_to_add, method) self.assertEqual(adjusted_array.adjustments, expected_output)
def test_update_adjustments(self, initial_adjustments, adjustments_to_add, expected_adjustments_with_append, expected_adjustments_with_prepend): methods = ['append', 'prepend'] expected_outputs = [ expected_adjustments_with_append, expected_adjustments_with_prepend ] for method, expected_output in zip(methods, expected_outputs): data = arange(30, dtype=float).reshape(6, 5) adjusted_array = AdjustedArray( data, initial_adjustments, float('nan') ) adjusted_array.update_adjustments(adjustments_to_add, method) self.assertEqual(adjusted_array.adjustments, expected_output)
def test_update_adjustments( self, initial_adjustments, adjustments_to_add, expected_adjustments_with_append, expected_adjustments_with_prepend, ): methods = ["append", "prepend"] expected_outputs = [ expected_adjustments_with_append, expected_adjustments_with_prepend, ] for method, expected_output in zip(methods, expected_outputs): data = np.arange(30, dtype=float).reshape(6, 5) adjusted_array = AdjustedArray(data, initial_adjustments, float("nan")) adjusted_array.update_adjustments(adjustments_to_add, method) assert adjusted_array.adjustments == expected_output