-
-
Notifications
You must be signed in to change notification settings - Fork 390
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
IPAC/IRSA Moving Object Search Tool (MOST) interface #2660
Conversation
Codecov Report
@@ Coverage Diff @@
## main #2660 +/- ##
==========================================
+ Coverage 66.04% 66.11% +0.07%
==========================================
Files 233 234 +1
Lines 17927 18048 +121
==========================================
+ Hits 11840 11933 +93
- Misses 6087 6115 +28
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
268182f
to
386b5e4
Compare
I can't seem to reproduce the error locally. Error:
On the lines
in |
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.
Overall this PR is very close to be ready.
Leaving some big picture comments, they are mostly logistics and nitpicks. I'll do a run on the docs once it's been moved around.
astroquery/ipac/irsa/most/core.py
Outdated
|
||
def get_images( | ||
self, | ||
catalog="wise_merge", |
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.
mandate all optional kwargs to be kwarg only, here and in all the other methods, too (at minimum in the public ones).
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.
The way this reads to me is as if you want me to make optional keyword arguments just keyword arguments - in which case every invocation of the method will require the user to provide them and that sounds wrong? Alternative understanding is to user **kwargs
but that sounds wrong too? Could you clarify what you meant?
4690e08
to
4c83a17
Compare
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.
A lot of nitpicks, with a few genuine fixes to be made, mostly around the tests, but all of them are very straightforward.
And this needs a changelog entry.
Also, something looks weird with the rendered API docs in the most.rst page, but it all renders well in the one layer up namespace.
obj_type = params.get("obj_type", False) | ||
if not obj_type: | ||
raise ValueError("When input type is 'mpc_input' key 'obj_type' is required.") | ||
if obj_type not in ("Asteroid", "Comet"): |
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 is good for now, but I wonder whether we can/should loosen this up a bit, elsewhere we mostly are case insensitive.
(though it probably should be an upstream fix if upstream is this sensitive to the case)
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.
For future reference
================================================================================
Toolkit version: N0065
SPICE(SPKINSUFFDATA) --
Insufficient ephemeris data has been loaded to compute the state of -99999
relative to 0 (SOLAR SYSTEM BARYCENTER) at the ephemeris epoch 2010 JAN 07
00:01:06.184.
A traceback follows. The name of the highest level module is first.
spkez_c --> SPKEZ --> SPKACS --> SPKAPS --> SPKLTC --> SPKGEO
================================================================================
are the kinds of errors that pop up if they are not first-letter-capitalized. The upstream is basically just a form whose payload is directly delivered to SPICE toolkit and their internal search engine, optionally some additional bespoke tools.
We can fix this, as well as rename some of these parameters to be more consistent in the qparams
map. Why arg_perihelion
but perih_dist
and perih_time
? Shouldn't it all be short or all of it long? Same with the input_type
and output_mode
- an arbitrary change that makes it, in my humble opinion, much harder to remember how to use the thing. Most of the obj_
prefixes could be dropped from the parameter's name too. If this is getting passed onward, something to think about.
Move the initial implementation to core.py Use the Config class for configuration. Add documentation. Add tests. General clean-up.
Mostly to test formatting is correct.
… lengths because of noqa.
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've added one more commit that makes all remote doctests pass on my laptop. We'll likely need to add a few more IGNORE_OUTPUTS
(currently only added it for those that print out the temporary workspace url, that changes for each query).
If tests keep failing on the cron CI, but for now it all looks fine.
Thank you so much @DinoBektesevic, and I'm sorry for dragging it along for so long. |
The PR adds support for MOST application at IPAC/IRSA. See the interface here.
There are some instructions, but they do not always map to the exact key names and allowed values. There is an API for the service here but because its output is the same as of the application itself the only functional difference is whether the search parameters are stringified into an URL fragment or not.
Therefore I decided to query the application itself using a POST request. The returned response is parsed, and if HTML that HTML is parsed for the "Download *" links at the bottom of the page. These tables are then returned to the user. This makes "Regular" and "Full" output mode pretty much the same output mode, causing some potential confusion, but is the simplest solution.
I added documentation, could be improved. Same with the tests.
I wasn't sure what to log and and or how exactly to handle errors - I see there are custom made errors for different events but I was too lazy to peruse the docs to be honest. Happy to get any input on that.
I also wasn't sure what all parameters should go into the
Config
class. So now some of them are in the default dict for the class and some are inconfig
- happy to get advice on the recommended way forward.There is a point to be made for unifying all of the same-meaning-but-different-named-parameters used by MOST (
input_type
butoutput_mode
,fits_region_files
forcreate_tarballs
etc..) but that seemed like not the best idea - happy to hear otherwise.EDIT: I see now I forgot to add
list_catalogs
andget_images
as methods. Also, what should I name the mainquery
method - I was not sure which example in the API Reference was the closest match?