Skip to content

Refactor to tidy, remove duplication, and increase usability #1

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

Draft
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

blackwer
Copy link
Member

@blackwer blackwer commented Jul 28, 2025

Overview of changes in this PR

  • Add LICENSE
  • Cleaning up the CLI
    • State should be wrangled on a per run basis, so no prep-work needed
    • Parameters should have clear names, and only specified when they can't be derived, with no repeats
    • Parameters should use existing markup features, rather than parsing strings
    • Parameters should be documented, with clear definitions specified via --help or -h
      This is already done mostly before, but it needs to be audited after the refactor
    • Parameters should be handled via a class, rather than a dictionary. This ensures you're always accessing keys that exist, that you can do static type analysis, and that you can more strongly type your parameters in general. It makes it safer, and your IDE can do autocomplete and validate on your parameters
    • CLI should just be a single run-script with flags
    • MPI sub-runs should run automatically, rather than requiring multiple invocations
      I think this should probably be accomplished by just using smaller communicators, but I haven't thought heavily about it yet. Alternatively the script can launch mpi subjobs itself.
  • pip installable
  • no hidden environment variables
  • No loss in functionality
  • Directory agnostic (mostly there)
  • De-dupe code (I've done a bit of this, but haven't analyzed it deeply)
  • Remove unreachable code (I got a lot of the obvious stuff)
  • Use a consistent style. I usually use PEP-8 with a few changes. ruff is a good companion here
  • Re-organize code paths to be more standard

Notes

This is a (slow) work in progress. I think, once I get the MPI stuff implemented and tested properly, it could be used as a starting point for future changes. Notably any changes upstream are going to be a pain in the butt to merge because of all the formatting changes and file moves.

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.

1 participant