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

Standardizing code formatting and linting; modernizing package installation #1

Open
wants to merge 14 commits into
base: refactoring
Choose a base branch
from

Conversation

lucaspar
Copy link
Member

@lucaspar lucaspar commented Dec 20, 2024

I'm opening this PR onto a refactoring branch as I'd like to add more tests to make sure the repo is in a better state before merging to main, but I'm open to your feedback, and we can discuss each of these changes.

Summary

  • Standardized linting and code formatting;
  • Fixed (most) linter warnings;
  • Added type annotations;
  • Modernized packaging by moving some attributes from setup.py to pyproject.toml (we can probably remove setup.py entirely if we switch from setuptools to hatch).
  • Switched logging to loguru, which is more informative (file, method, line number), colorful, and requires no setup.
  • Unified Shepherd terminology to match SADE configuration task(s) -> service(s).
    • I'm not sure about this one, and we can make "task" the preferred term if a "service" is a kind of "task". It's just something that was confusing when reading the code and config files, so I think we should settle on one preferred term to describe this unit.
    • ha, I just noticed your latest commit was renaming them to task; I can do the same here, then. Let's talk after the break.
  • Added project instructions to run it with uv, which should be simpler and faster than pip or conda.
  • Added --work-dir and --run-dir to make it explicit where Shepherd executes scripts from and where it creates output files. run here refers to a SADE Simulation Run, and it could be renamed before this is merged with main.
  • Example #3 is working right now, but I'd like to formalize it as a test case to detect regressions.

Minimum Python version

Minimum Python version is 3.10 (type hints fail on 3.9, possibly other things do too). You can try it with this one-liner:

uv run --python=3.10 examples/example3/run_test.sh
# uv run also installs all dependencies and even the 3.10 interpreter if needed

And the most recent stable Python version:

uv run --python=3.13 examples/example3/run_test.sh

@lucaspar lucaspar added documentation Improvements or additions to documentation enhancement New feature or request labels Dec 20, 2024
@lucaspar lucaspar self-assigned this Dec 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant