- Timestamp:
- 07/17/21 18:16:11 (3 years ago)
- Location:
- stable
- Files:
-
- 15 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
stable
- Property svn:mergeinfo changed
/branches/3105_PythonFormatter (added) merged: 17842,17855,17860,17918-17919 /trunk merged: 17922,17929
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Algorithms.DataAnalysis
- Property svn:mergeinfo changed
/branches/3105_PythonFormatter/HeuristicLab.Algorithms.DataAnalysis (added) merged: 17918 /trunk/HeuristicLab.Algorithms.DataAnalysis merged: 17922
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Algorithms.DataAnalysis.Views
- Property svn:mergeinfo changed
/branches/3105_PythonFormatter/HeuristicLab.Algorithms.DataAnalysis.Views (added) merged: 17918 /trunk/HeuristicLab.Algorithms.DataAnalysis.Views merged: 17922
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Algorithms.DataAnalysis/3.4
- Property svn:mergeinfo changed
/branches/3105_PythonFormatter/HeuristicLab.Algorithms.DataAnalysis/3.4 (added) merged: 17918 /trunk/HeuristicLab.Algorithms.DataAnalysis/3.4 merged: 17922
- Property svn:mergeinfo changed
-
stable/HeuristicLab.DataPreprocessing
- Property svn:mergeinfo changed
/branches/3105_PythonFormatter/HeuristicLab.DataPreprocessing (added) merged: 17918 /trunk/HeuristicLab.DataPreprocessing merged: 17922
- Property svn:mergeinfo changed
-
stable/HeuristicLab.DataPreprocessing/3.4
- Property svn:mergeinfo changed
/branches/3105_PythonFormatter/HeuristicLab.DataPreprocessing/3.4 (added) merged: 17918 /trunk/HeuristicLab.DataPreprocessing/3.4 merged: 17922
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding
- Property svn:mergeinfo changed
/branches/3105_PythonFormatter/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding (added) merged: 17918 /trunk/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding merged: 17922
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Problems.DataAnalysis
- Property svn:mergeinfo changed
/branches/3105_PythonFormatter/HeuristicLab.Problems.DataAnalysis (added) merged: 17918 /trunk/HeuristicLab.Problems.DataAnalysis merged: 17922
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Problems.DataAnalysis.Symbolic
- Property svn:mergeinfo changed
/branches/3105_PythonFormatter/HeuristicLab.Problems.DataAnalysis.Symbolic (added) merged: 17855,17860,17918-17919 /trunk/HeuristicLab.Problems.DataAnalysis.Symbolic merged: 17922,17929
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression
- Property svn:mergeinfo changed
/branches/3105_PythonFormatter/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression (added) merged: 17918 /trunk/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression merged: 17922
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4
- Property svn:mergeinfo changed
/branches/3105_PythonFormatter/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4 (added) merged: 17918 /trunk/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4 merged: 17922
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Formatters/SymbolicDataAnalysisExpressionPythonFormatter.cs
r17922 r18016 58 58 } 59 59 60 private st ring GenerateHeader(ISymbolicExpressionTree symbolicExpressionTree) {60 private static string GenerateHeader(ISymbolicExpressionTree symbolicExpressionTree) { 61 61 StringBuilder strBuilder = new StringBuilder(); 62 62 … … 102 102 } 103 103 104 private st ring GenerateNecessaryImports(int mathLibCounter, int statisticLibCounter) {104 private static string GenerateNecessaryImports(int mathLibCounter, int statisticLibCounter) { 105 105 StringBuilder strBuilder = new StringBuilder(); 106 106 if (mathLibCounter > 0 || statisticLibCounter > 0) { … … 115 115 } 116 116 117 private st ring GenerateIfThenElseSource(int evaluateIfCounter) {117 private static string GenerateIfThenElseSource(int evaluateIfCounter) { 118 118 StringBuilder strBuilder = new StringBuilder(); 119 119 if (evaluateIfCounter > 0) { … … 128 128 } 129 129 130 private st ring GenerateModelEvaluationFunction(ISet<string> variables) {130 private static string GenerateModelEvaluationFunction(ISet<string> variables) { 131 131 StringBuilder strBuilder = new StringBuilder(); 132 132 strBuilder.Append("def evaluate("); … … 142 142 } 143 143 144 private void FormatRecursively(ISymbolicExpressionTreeNode node, StringBuilder strBuilder) {144 private static void FormatRecursively(ISymbolicExpressionTreeNode node, StringBuilder strBuilder) { 145 145 ISymbol symbol = node.Symbol; 146 146 if (symbol is ProgramRootSymbol) … … 208 208 } 209 209 210 private st ring VariableName2Identifier(string variableName) => variableName.Replace(" ", "_");211 212 private void FormatNode(ISymbolicExpressionTreeNode node, StringBuilder strBuilder, string prefixSymbol = "", string openingSymbol = "(", string closingSymbol = ")", string infixSymbol = ",") {210 private static string VariableName2Identifier(string variableName) => variableName.Replace(" ", "_"); 211 212 private static void FormatNode(ISymbolicExpressionTreeNode node, StringBuilder strBuilder, string prefixSymbol = "", string openingSymbol = "(", string closingSymbol = ")", string infixSymbol = ",") { 213 213 strBuilder.Append($"{prefixSymbol}{openingSymbol}"); 214 214 foreach (var child in node.Subtrees) { … … 220 220 } 221 221 222 private void FormatVariableTreeNode(ISymbolicExpressionTreeNode node, StringBuilder strBuilder) {222 private static void FormatVariableTreeNode(ISymbolicExpressionTreeNode node, StringBuilder strBuilder) { 223 223 var varNode = node as VariableTreeNode; 224 224 var formattedVariable = VariableName2Identifier(varNode.VariableName); … … 227 227 } 228 228 229 private void FormatConstantTreeNode(ISymbolicExpressionTreeNode node, StringBuilder strBuilder) {229 private static void FormatConstantTreeNode(ISymbolicExpressionTreeNode node, StringBuilder strBuilder) { 230 230 var constNode = node as ConstantTreeNode; 231 231 strBuilder.Append(constNode.Value.ToString("g17", CultureInfo.InvariantCulture)); 232 232 } 233 233 234 private void FormatPower(ISymbolicExpressionTreeNode node, StringBuilder strBuilder, string exponent) {234 private static void FormatPower(ISymbolicExpressionTreeNode node, StringBuilder strBuilder, string exponent) { 235 235 strBuilder.Append("math.pow("); 236 236 FormatRecursively(node.GetSubtree(0), strBuilder); … … 238 238 } 239 239 240 private void FormatRoot(ISymbolicExpressionTreeNode node, StringBuilder strBuilder) {240 private static void FormatRoot(ISymbolicExpressionTreeNode node, StringBuilder strBuilder) { 241 241 strBuilder.Append("math.pow("); 242 242 FormatRecursively(node.GetSubtree(0), strBuilder); … … 246 246 } 247 247 248 private void FormatSubtraction(ISymbolicExpressionTreeNode node, StringBuilder strBuilder) {248 private static void FormatSubtraction(ISymbolicExpressionTreeNode node, StringBuilder strBuilder) { 249 249 if (node.SubtreeCount == 1) { 250 250 strBuilder.Append("-"); … … 256 256 } 257 257 258 private void FormatDivision(ISymbolicExpressionTreeNode node, StringBuilder strBuilder) {258 private static void FormatDivision(ISymbolicExpressionTreeNode node, StringBuilder strBuilder) { 259 259 strBuilder.Append("("); 260 260 if (node.SubtreeCount == 1) { … … 273 273 } 274 274 275 private void FormatAnalyticQuotient(ISymbolicExpressionTreeNode node, StringBuilder strBuilder) {275 private static void FormatAnalyticQuotient(ISymbolicExpressionTreeNode node, StringBuilder strBuilder) { 276 276 strBuilder.Append("("); 277 277 FormatRecursively(node.GetSubtree(0), strBuilder); -
stable/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/HeuristicLab.Problems.DataAnalysis.Symbolic-3.4.csproj
r17498 r18016 152 152 <Compile Include="Crossovers\SymbolicDataAnalysisExpressionDiversityPreservingCrossover.cs" /> 153 153 <Compile Include="Formatters\InfixExpressionFormatter.cs" /> 154 <Compile Include="Formatters\SymbolicDataAnalysisExpressionPythonFormatter.cs" /> 154 155 <Compile Include="Formatters\TSQLExpressionFormatter.cs" /> 155 156 <Compile Include="Formatters\SymbolicDataAnalysisExpressionMathematicaFormatter.cs" /> -
stable/HeuristicLab.Problems.DataAnalysis.Views
- Property svn:mergeinfo changed
/branches/3105_PythonFormatter/HeuristicLab.Problems.DataAnalysis.Views (added) merged: 17918 /trunk/HeuristicLab.Problems.DataAnalysis.Views merged: 17922
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Problems.DataAnalysis/3.4
- Property svn:mergeinfo changed
/branches/3105_PythonFormatter/HeuristicLab.Problems.DataAnalysis/3.4 (added) merged: 17918 /trunk/HeuristicLab.Problems.DataAnalysis/3.4 merged: 17922
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Tests
- Property svn:mergeinfo changed
/branches/3105_PythonFormatter/HeuristicLab.Tests (added) merged: 17918 /trunk/HeuristicLab.Tests merged: 17922
- Property svn:mergeinfo changed
Note: See TracChangeset
for help on using the changeset viewer.