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

Refresh scripts/TakeSnapshot.py #76

Open
anthonyfok opened this issue Mar 2, 2023 · 3 comments
Open

Refresh scripts/TakeSnapshot.py #76

anthonyfok opened this issue Mar 2, 2023 · 3 comments
Assignees
Labels
Enhancement New feature or request

Comments

@anthonyfok
Copy link
Member

It was suggested during internal demo/review that script/TakeSnapshot.py would benefit from the use of Python 3 argparse for parsing command-line arguments, see https://docs.python.org/3/library/argparse.html

@anthonyfok anthonyfok self-assigned this Mar 2, 2023
@anthonyfok
Copy link
Member Author

And maybe try to deduce the arguments from existing files in the current directory so that instead of

../scripts/TakeSnapshot.py ACM4p9_GeorgiaStraitFault b 1 2 3 4 5
../scripts/TakeSnapshot.py ACM7p4_DenaliFault b 181 182 183 184 185
../scripts/TakeSnapshot.py SCM5p5_ConstanceBay b 118 119 120 121 122

we could instead simply run:

../scripts/TakeSnapshot.py ACM4p9_GeorgiaStraitFault
../scripts/TakeSnapshot.py ACM7p4_DenaliFault
../scripts/TakeSnapshot.py SCM5p5_ConstanceBay

But, if there are ambiguities, stop and ask the user to enter all 7 arguments.

@anthonyfok anthonyfok changed the title Suggestion to use argparse for TakeSnapshot.py Refresh scripts/TakeSnapshot.py Apr 20, 2023
@anthonyfok
Copy link
Member Author

And maybe try to deduce the arguments from existing files in the current directory so that instead of

Instead of modifying the Python script, I decided to write a quick-and-dirty bash script scripts/run-TakeSnapshot.sh to do the same.

@anthonyfok
Copy link
Member Author

Might like to fix this warning while we are at it:

../scripts/TakeSnapshot.py:293: FutureWarning: The frame.append method is deprecated and will be removed from pandas in a future version. Use pandas.concat instead.

@anthonyfok anthonyfok added the Enhancement New feature or request label Apr 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant