Update Interop to support float instead of Int Now
This commit is contained in:
@@ -27,12 +27,12 @@ namespace Controllers.PythonInterop {
|
||||
}
|
||||
|
||||
// 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);
|
||||
if (!Success.Item1) {
|
||||
return (Success.Item2, 0);
|
||||
} else {
|
||||
if (int.TryParse(Success.Item2, out int parsed)) {
|
||||
if (float.TryParse(Success.Item2, out float parsed)) {
|
||||
return ("", parsed);
|
||||
}
|
||||
return ("Python returns an unknown value", 0);
|
||||
|
||||
Reference in New Issue
Block a user