Skip to content
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

115 supplying list of SSOIDs to CLI #122

Merged
merged 4 commits into from
May 14, 2024
Merged

115 supplying list of SSOIDs to CLI #122

merged 4 commits into from
May 14, 2024

Conversation

astronomerritt
Copy link
Collaborator

@astronomerritt astronomerritt commented May 14, 2024

Fixes #115.

  • Added a new command-line argument, -sl, that allows the user to supply the location of a list of SSOIDs. This command-line argument is mutually exclusive with -s and the user must supply one or the other.
  • Added validation of this command-line argument to AdlerCLIArguments - to check the file exists.
  • Changed adler.py to now iterate over a list of objects. Added a helpful message that prints to the log and lets the user know how far along we are.
  • Wrote a function, adler.utilities.readin_utilities.read_in_SSObjectID_file(), that simply reads in the contents of a text file assuming that it consists of a list of SSOIDs, one on each line. Does some basic validation to make sure the input is sensible.
  • Wrote unit test for the above function.
  • Wrote extra unit tests for AdlerCLIArguments to cover the new argument.

Also:

  • As we're now iterating over a list of objects, I have stopped warnings from printing to the terminal (to reduce terminal spam). The warnings print to the logs so they're still readily accessible.
  • I removed the unit test that checked to see if warnings were printed to the terminal (as they're not).
  • Forgot to add a docstring to my logging function, oops.

If you'd like to test this on the RSP:

>> adler -sl ./tests/data/test_SSOIDs.txt

Review Checklist for Source Code Changes

  • Does pip install still work?
  • Have you written a unit test for any new functions?
  • Do all the units tests run successfully?
  • Does adler run successfully on a test set of input files/databases?
  • Have you used black on the files you have updated to confirm python programming style guide enforcement?

@astronomerritt astronomerritt marked this pull request as ready for review May 14, 2024 12:55
@astronomerritt astronomerritt requested a review from jrob93 May 14, 2024 12:55
Copy link
Collaborator

@jrob93 jrob93 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@astronomerritt astronomerritt merged commit 84112d4 into main May 14, 2024
10 checks passed
@astronomerritt astronomerritt deleted the 115-object-list branch May 14, 2024 13:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

get Adler working with a list of objects
2 participants