Update Interop to support float instead of Int Now
This commit is contained in:
@@ -27,12 +27,12 @@ namespace Controllers.PythonInterop {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Return ( Error, Signal )
|
// Return ( Error, Signal )
|
||||||
public (string, int) PredictAI(string StockSymbol) {
|
public (string, float) PredictAI(string StockSymbol) {
|
||||||
(bool, string) Success = PyProcess.RunPythonProcess(_PyPath, _ExecPath + "/aipredictor.py", returns: true, PyArgs: StockSymbol);
|
(bool, string) Success = PyProcess.RunPythonProcess(_PyPath, _ExecPath + "/aipredictor.py", returns: true, PyArgs: StockSymbol);
|
||||||
if (!Success.Item1) {
|
if (!Success.Item1) {
|
||||||
return (Success.Item2, 0);
|
return (Success.Item2, 0);
|
||||||
} else {
|
} else {
|
||||||
if (int.TryParse(Success.Item2, out int parsed)) {
|
if (float.TryParse(Success.Item2, out float parsed)) {
|
||||||
return ("", parsed);
|
return ("", parsed);
|
||||||
}
|
}
|
||||||
return ("Python returns an unknown value", 0);
|
return ("Python returns an unknown value", 0);
|
||||||
|
|||||||
Reference in New Issue
Block a user