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 |
bsipocz
left a comment
There was a problem hiding this comment.
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.
| 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.
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.
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.
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