Skip to content

Triage scripts and port to argparse - #66

Merged
dnadeau-lanl merged 5 commits into
spacepy:masterfrom
jtniehof:script_cleanup
Feb 9, 2021
Merged

dnadeau-lanl merged 5 commits into
spacepy:masterfrom
jtniehof:script_cleanup

Conversation

@jtniehof

@jtniehof jtniehof commented Feb 9, 2021

Copy link
Copy Markdown
Member

This PR does a few things relating to script handling.

  • Consolidates all of our notes on what scripts are useful or not into the Sphinx documentation...still rough but at least in one place.
  • Sorts scripts into "scripts" that are likely to be more commonly used, "examples" that are less maintained but might be useful for reference/mission-specific, and some which are deleted. (Relevant to Script installation into default location #5).
  • Takes all scripts which use optparse and ports them to argparse (Relevant to Use of postgresql instead of sqlite #60 -- it will be much easier to add support for other databases to the scripts if all scripts are using a common argument parsing code, and getting them using the same parsing mechanism is a first step.)

Some more clarity on the last part is probably in order. optparse was introduced in 2.3 or so and deprecated in 2.7, when argparse was introduced. That forced us to stay with optparse for as long as we wanted 2.6 support, even though we knew it was going away. So earlier scripts were written with optparse and often newer ones with argparse. Now that 2.6 is well in the rearview mirror, getting everything on argparse prepares us for the future.

There are a few scripts that directly parse sys.argv; they aren't changed for now.

Functionality shouldn't be changed; I did some chunk checks on every script (sometimes just primarily checking that the parsing worked) but we don't have deep testing on the scripts right now.

PR Checklist

  • Pull request has descriptive title
  • Pull request gives overview of changes
  • New code has inline comments where necessary
  • (N/A) Any new modules, functions or classes have docstrings consistent with dbprocessing style
  • (N/A) Major new functionality has appropriate Sphinx documentation
  • (N/A) Added an entry to release notes if fixing a major bug or providing a major new feature
  • (N/A) New features and bug fixes should have unit tests
  • Relevant issues are linked in the description (use Closes # if this PR closes the issue, or some other reference, such as See # if it is related in some other way)

 * This was the configuation file for emailing information from a quality
   control loop that was never fully implemented.
 * These were scratch work towards fast data that were never completed.
 * Added in repo fbea64f to avoid losing,
   since status was uncertain.
 * This will ultimately allow for common argument handling.
 * Scripts that parse sys.argv directly are left alone for now.
@jtniehof
jtniehof requested a review from dnadeau-lanl February 9, 2021 22:26
@dnadeau-lanl
dnadeau-lanl merged commit 80d12b5 into spacepy:master Feb 9, 2021
@jtniehof
jtniehof deleted the script_cleanup branch February 10, 2021 15:56
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.

2 participants