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

Sorcha cite command line function #1093

Merged
merged 8 commits into from
Jan 14, 2025
Merged

Conversation

Little-Ryugu
Copy link
Collaborator

Fixes #1091.

Created a Sorcha cite command line function with two optional arguments. An argument to print the citation to the terminal and an argument to decide the file path

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 Sorcha 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?

Created a sorcha cite command line funtion with two optional arguments. An argument to print the citation to the terminal and an argument to decide the file path
Changed the function cite_sorcha() print statements to f.write and set the default to be sys.stdout. Made some formatting changes to the citation text to make it more readable when outputted in the text file. Updated the docs to include this method of getting the citation information
@Little-Ryugu Little-Ryugu requested a review from mschwamb January 14, 2025 14:41

if args.p: # prints citation to terminal
cite_sorcha()

Copy link
Collaborator

Choose a reason for hiding this comment

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

it looks if I have with -p it will execute both printing to a file and to the terminal

Copy link
Collaborator

Choose a reason for hiding this comment

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

shouldn't there be an else and then the rest?

Copy link
Collaborator

@mschwamb mschwamb left a comment

Choose a reason for hiding this comment

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

Take a look at my comments. I think you might need to include an else statement somewhere in the cite.py

@Little-Ryugu Little-Ryugu merged commit 380af93 into main Jan 14, 2025
7 checks passed
@Little-Ryugu Little-Ryugu deleted the making-a-sorcha-cite-in-the-CLI branch January 14, 2025 15:19
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.

make a sorcha cite in the CLI
2 participants