Skip to content

Commit

Permalink
refactor:Minor refactoring to prepare for using templates for differe…
Browse files Browse the repository at this point in the history
…nt programming languages.
  • Loading branch information
antononcube committed Aug 14, 2021
1 parent 41972eb commit cb045ff
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Misc/ComputationalSpecCompletion.m
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ Mathematica is (C) Copyright 1988-2021 Wolfram Research, Inc.
(* Stencils *)
(***********************************************************)

aTemplates = <|
aWLTemplates = <|
"QuantileRegression" ->
StringTemplate[
"Module[{qrData,aQRFuncs,aQRPlotData},
Expand All @@ -107,7 +107,7 @@ Mathematica is (C) Copyright 1988-2021 Wolfram Research, Inc.
Echo[ListPlot[Values[aQRPlotData], Joined -> Prepend[Table[True, Length[aQRPlotData]-1], False], PlotLegends -> Keys[aQRPlotData], PlotTheme -> \"Detailed\", FrameLabel -> {\"Regressor\", \"Value\"}, ImageSize -> Medium],\"regression quantiles:\"];
Echo[Map[Function[{qFunc},
DateListPlot[
Map[{#[[1]], (qFunc[#[[1]]] - #[[2]])/#[[2]]} &, qrData], Joined -> False, PlotRange -> All, Filling -> Axis, PlotTheme -> \"Detailed\", ImageSize -> Large]], aQRFuncs],\"errors:\"];
Map[{#[[1]], (qFunc[#[[1]]] - #[[2]])/#[[2]]} &, qrData], Joined -> False, PlotRange -> All, Filling -> Axis, PlotTheme -> \"Detailed\", ImageSize -> Medium]], aQRFuncs],\"errors:\"];
]"],

"QRMon" ->
Expand Down Expand Up @@ -526,7 +526,7 @@ Mathematica is (C) Copyright 1988-2021 Wolfram Research, Inc.

ComputationalSpecCompletion["Data"] :=
<|
"Templates" -> aTemplates,
"Templates" -> aWLTemplates,
"Questions" -> aQuestions,
"Defaults" -> aDefaults,
"Shortcuts" -> aShortcuts
Expand Down Expand Up @@ -577,7 +577,7 @@ Mathematica is (C) Copyright 1988-2021 Wolfram Research, Inc.
Return[$Failed]
];

ToExpression["Hold[" <> aTemplates[workflowType][Join[aDefaults[workflowType], aRes]] <> "]"]
ToExpression["Hold[" <> aWLTemplates[workflowType][Join[aDefaults[workflowType], aRes]] <> "]"]
];


Expand Down

0 comments on commit cb045ff

Please sign in to comment.