-
Notifications
You must be signed in to change notification settings - Fork 20
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
Clean up formatting of spectra_generator.md and related .py files #354
Conversation
@bsipocz I ran |
querystring = "select observation_id from hsa.v_active_observation join hsa.instrument using (instrument_oid) where contains(point('ICRS', hsa.v_active_observation.ra, hsa.v_active_observation.dec), circle('ICRS', "+str(search_coords.ra.deg)+", " + str(search_coords.dec.deg) +", " + str(search_radius_arcsec) +"))=1 and hsa.instrument.instrument_name='"+str(instrument_name)+"'" | ||
querystring = "select observation_id from hsa.v_active_observation join hsa.instrument using (instrument_oid) where contains(point('ICRS', hsa.v_active_observation.ra, hsa.v_active_observation.dec), circle('ICRS', "+str( | ||
search_coords.ra.deg)+", " + str(search_coords.dec.deg) + ", " + str(search_radius_arcsec) + "))=1 and hsa.instrument.instrument_name='"+str(instrument_name)+"'" |
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.
Here's one example. Line 79 is still 232 characters long.
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 what you got with the auto formatted? I agree that it's still very ugly and not really an improvement compared to the one super long line.
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.
Yes, just autopep8 so far, no manual adjustments.
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.
Looks good to me, and an imrpovement. While I left some comments, I would suggest to go ahead and merge this sooner rather than later, so any later cleanups won't be lost in the noise of these trivial changes.
querystring = "select observation_id from hsa.v_active_observation join hsa.instrument using (instrument_oid) where contains(point('ICRS', hsa.v_active_observation.ra, hsa.v_active_observation.dec), circle('ICRS', "+str(search_coords.ra.deg)+", " + str(search_coords.dec.deg) +", " + str(search_radius_arcsec) +"))=1 and hsa.instrument.instrument_name='"+str(instrument_name)+"'" | ||
querystring = "select observation_id from hsa.v_active_observation join hsa.instrument using (instrument_oid) where contains(point('ICRS', hsa.v_active_observation.ra, hsa.v_active_observation.dec), circle('ICRS', "+str( | ||
search_coords.ra.deg)+", " + str(search_coords.dec.deg) + ", " + str(search_radius_arcsec) + "))=1 and hsa.instrument.instrument_name='"+str(instrument_name)+"'" |
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 what you got with the auto formatted? I agree that it's still very ugly and not really an improvement compared to the one super long line.
#from astroquery.sdss import SDSS | ||
#from astroquery.simbad import Simbad | ||
#from astroquery.vizier import Vizier | ||
# from astroquery.ipac.ned import Ned |
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.
we'll need to clean up all the commented-out unused code, too.
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'm waiting to hear back from the scientists on whether this is still WIP. If they're done with it, I'll remove the commented-out code.
return (df_spec) |
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.
not sure if we can clean all these up without using ruff or something similar. Just leaving the comment for the example
return (df_spec) | |
return df_spec |
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'll take them out when fix the docstrings since I'll be checking the return objects then. This is much easier to do manually than, say, deciding where to break long lines of code.
# Or should we take the average instead?? | ||
if len(tab) > 0: | ||
print("More than 1 entry found" , end="") | ||
print("More than 1 entry found", end="") | ||
if not COMBINESPEC: | ||
print(" - pick the closest") |
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.
Beyond scope of this PR, but I noticed this:
in the lightcurves notebook/code we had a verbose option, so we don't get all the noise from these prints.
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.
Most of the other spectroscopy modules have the verbose option. Not sure why it was left out here.
and we need a |
Thanks @bsipocz. I'm merging this now. More PRs will follow to complete the tech review. |
* Organize imports. Remove unused. * Run autopep8 with --max-line-length=100 * Wrap long lines of text 0db074f
Clean up formatting by:
autopep8
with a max line length of 100