You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When writing overwrite values in /advance, the flask api in restapi.py seems to truncate floats, as they are converted to unicode by default. For example, for a particular timestep when running examples/python/testcase1_scenario.py:
Python controller sent:
{'oveAct_u': 63.82314159145608, 'oveAct_activate': 1}
Flask api sent to testcase.py:
{'oveAct_u': u'63.8231415915', 'oveAct_activate': u'1'}
On the surface this is not too much of an issue, but the rest api of boptest-service does not perform this truncation, and testing has revealed this makes a small numeric difference for the example feedback controllers for testcase1 and testcase3, causing unit tests to fail upon syncing boptest-service with the latest master branch.
This issue proposes to fix the Flask api by specifying that the overwrite value arguments in /advance be strictly defined as floats (using type=float option when defining the arguments of the api request here), which then removes any truncation from the api and delivers to testcase.py exactly what is expected.
The text was updated successfully, but these errors were encountered:
When writing overwrite values in
/advance
, the flask api inrestapi.py
seems to truncate floats, as they are converted to unicode by default. For example, for a particular timestep when runningexamples/python/testcase1_scenario.py
:Python controller sent:
{'oveAct_u': 63.82314159145608, 'oveAct_activate': 1}
Flask api sent to testcase.py:
{'oveAct_u': u'63.8231415915', 'oveAct_activate': u'1'}
On the surface this is not too much of an issue, but the rest api of boptest-service does not perform this truncation, and testing has revealed this makes a small numeric difference for the example feedback controllers for testcase1 and testcase3, causing unit tests to fail upon syncing boptest-service with the latest master branch.
This issue proposes to fix the Flask api by specifying that the overwrite value arguments in
/advance
be strictly defined as floats (usingtype=float
option when defining the arguments of the api request here), which then removes any truncation from the api and delivers to testcase.py exactly what is expected.The text was updated successfully, but these errors were encountered: