-
Notifications
You must be signed in to change notification settings - Fork 6
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
New Horizons API #32
New Horizons API #32
Conversation
@PerezHz what are your thoughts on this PR? Also, I have a couple of questions:
|
Hey @LuEdRaMo! Many thanks for this PR! I'll have a look to the details of this PR as soon as I can. I would actually be in favor of scrapping the telnet methods (thus eliminating an external dependency in favor of a safer and more modern data-fetching API); ie I'm in favor of switching to the new HTTP API completely. Nostalgia-driven users won't mind using an older HORIZONS.jl version 🙃. Regarding your second question, sure go ahead! |
Just a small caveat: we should add a warning to the users explaining that we switched APIs from telnet to HTTP. |
I have a few more comments/questions:
|
Before 1, versions 0.x are considered breaking among themselves, so bumping the minor version should enough in this case.
Okay, eventually the telnet method to connect to Horizons will be removed by JPL, but let's keep it for the time being.
I agree that
So far it has worked as the documentation of the package, so on this point I do think it's worth to update together with this PR.
Many thanks for adding those!
I think that's more than enough for what the package is already covering; I agree we can leave the rest of the JPL APIs for future PRs, I'd suggest to just open an issue here regarding that point. |
Btw, julia 1.0 tests are failing, can you update the CI.yml to test julia 1.6, 1 and nightly? |
@test isa(apophis_1["data"], Vector{Any}) | ||
@test isa(apophis_1["count"], String) | ||
@test length(apophis_1["data"]) == parse(Int, apophis_1["count"]) | ||
|
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.
I think around here we can add some tests to check the output, e.g.:
@test apophis_1["fields"] == ["des", "epoch", "value", "sigma", "units", "freq", "rcvr", "xmit", "bp", "observer"] | |
@test all(first.(apophis_1["data"]) .== "99942") | |
@test apophis_1["signature"]["source"] == "NASA/JPL Small-Body Radar Astrometry API" | |
@test VersionNumber(apophis_1["signature"]["version"]) ≥ v"1" |
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.
(EDIT: added @test
to suggestions above)
@test isa(apophis_2["data"], Vector{Any}) | ||
@test isa(apophis_2["count"], String) | ||
@test length(apophis_2["data"]) == parse(Int, apophis_2["count"]) | ||
|
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.
@test apophis_2["fields"][end] == "observer"
In the last commits I've addressed all your comments @PerezHz. I think this PR is ready for review. |
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.
I think this is essentially ready for merging, there's just a couple of issues with the tests that we should address first, otherwise, LGTM! Many thanks again @LuEdRaMo!
test/runtests.jl
Outdated
x = readlines(local_file) | ||
y = split(apophisvt, "\n")[1:end-1] | ||
|
||
@test x == y |
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.
Tests are failing in 1.6 and 1.10, I'd suggest to change this test to something like this:
@test x == y | |
@test length(x) == length(y) | |
lx = length(x) | |
inds = setdiff(1:lx,[2,35]) # avoid lines 2 and 35, since they have time of retrieval | |
@test x[inds] == y[inds] |
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.
(edit: above I meant julia 1.6; wrote 1.9 instead)
@LuEdRaMo Just left one last comment. Let me know when this is ready, and then we should be good to go! |
Deleted my last comment, the branching was swapped; will update my suggestion in a bit 😅 |
I went ahead and committed the suggestion; if we get the green lights I'll merge, thanks a lot! |
In order to address #31, this PR translates functions
smb_spk
,smb_spk_ele
andvec_tbl
to the new Horizons API.