-
-
Notifications
You must be signed in to change notification settings - Fork 408
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Validate svo_fps
query parameter names locally
#2446
Conversation
Codecov Report
@@ Coverage Diff @@
## main #2446 +/- ##
==========================================
+ Coverage 62.90% 62.92% +0.01%
==========================================
Files 133 133
Lines 17291 17300 +9
==========================================
+ Hits 10877 10886 +9
Misses 6414 6414
📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will need a short changelog mention after all the API has changed to correctly raise an exception rather than return an empty result.
Otherwise all looks good.
|
||
__all__ = ['SvoFpsClass', 'SvoFps'] | ||
|
||
FLOAT_MAX = np.finfo(np.float64).max | ||
|
||
# Valid query parameters taken from | ||
# http://svo2.cab.inta-csic.es/theory/fps/index.php?mode=voservice |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any way to parse this in rather than hard wire the params? I suppose they may not change it too often, so the hard-wiring should also work in practice.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the parameter names are not hard-coded here then they have to be monkeypatched for non-remote tests, which requires them to be hard-coded there. I have instead added a new remote test that should raise alarms if QUERY_PARAMETER
becomes outdated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a solid middle ground, thanks.
`SvoFpsClass.data_from_svo()` now checks the names of the query parameters and only connects with the server if all names are valid.
The new remote test requests valid parameter names from the server and checks that `QUERY_PARAMETERS` has not become outdated.
9a8d9bb
to
7eab91e
Compare
SvoFpsClass.data_from_svo()
now checks the names of the query parameters and only connects with the server if all names are valid. This allows replacing a failing remote test that checked for invalid queries with a local test.Contributes towards #2203