- Timestamp:
- 07/09/14 10:37:01 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.DataPreprocessing/3.4/PreprocessingTransformator.cs
r11068 r11156 42 42 43 43 public bool ApplyTransformations(IEnumerable<ITransformation> transformations, bool preserveColumns, out string errorMsg) { 44 bool success ;45 44 bool success = false; 45 errorMsg = string.Empty; 46 46 preprocessingData.BeginTransaction(DataPreprocessingChangedEventType.Transformation); 47 47 … … 64 64 renamedColumns.Clear(); 65 65 } 66 // only accept changes if everything was successful 67 if (!success) { 68 preprocessingData.Undo(); 69 } 70 } 71 catch (Exception e) { 72 preprocessingData.Undo(); 73 if (string.IsNullOrEmpty(errorMsg)) errorMsg = e.Message; 66 74 } 67 75 finally { … … 103 111 private IEnumerable<double> ApplyDoubleTransformation(Transformation<double> transformation, IList<double> data, out bool success, out string errorMsg) { 104 112 success = transformation.Check(data, out errorMsg); 105 return transformation.Apply(data); 113 // don't apply when the check fails 114 if (success) 115 return transformation.Apply(data); 116 else 117 return data; 106 118 } 107 119
Note: See TracChangeset
for help on using the changeset viewer.