Closed GeoDerp closed 5 months ago
Yes of course like I said this is basic Python so I use it extensively. But maybe there are some hidden dragons when retrieving data from flask end points, etc...
It may be good to close this issue and keep an eye open to see if there is any new issue that arrives that seems similar and go from there. Otherwise if you like we can start transitioning the if statements (ex. Anything in the /scripts that may use passed parameters)
The latest PR #175 did not solve the issue.
I've just tested it using a local compile of the standalone version and it is not taking into account the perform_backtest
parameter.
It seems to be a problem with bool
only.
Because I tested this and it changed the model type just fine:
curl -i -H "Content-Type:application/json" -X POST -d '{"sklearn_model": "LinearRegression","perform_backtest": "true"}' http://localhost:5000/action/forecast-model-fit
Sorry about that. I'll quickly run some more tests now if I see if I can't diagnose the issue before I head to bed
So the veritable is acting as a string (atleast in machine_learning_forecaster.py). so if perform_backtest == "True" or perform_backtest == "true":
will work
Going to spend a sec to work out why
Maybe try to convert to bool
when retrieving runtime params in utils.py?
Maybe try to convert to
bool
when retrieving runtime params in utils.py?
Exactly what I was thing about @davidusb-geek !
my idea was:
if 'perform_backtest' not in runtimeparams.keys():
perform_backtest = False
else:
perform_backtest = eval(str(runtimeparams['perform_backtest']).capitalize())
params['passed_data']['perform_backtest'] = perform_backtest
This might have to be done on all bool runtimes
Sorry about that @davidusb-geek , that was on me again for not testing well enough. The pull request is ruff but hopefully you can run with it and fix the bug. I'm heading to bed 👍
Sorry about that @davidusb-geek , that was on me again for not testing well enough. The pull request is ruff but hopefully you can run with it and fix the bug. I'm heading to bed 👍
Just tested this and works fine now! Releasing a patch soon...
Related to https://github.com/davidusb-geek/emhass/issues/154 , https://github.com/davidusb-geek/emhass/pull/174 , https://github.com/davidusb-geek/emhass/pull/175
Did a ruff Grep and found there is quite a flew boolean if statements, If The pr #175 does indeed to be the fix. A pull request could be done to replace all of these with
if * == True:
(Just to make sure this issue doesn't happen to anything else). If its not, or unnecessary/irrelevant in any way feel free to close the Issue.