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

fix script parser args format #366

Merged
merged 1 commit into from
Nov 1, 2024
Merged

fix script parser args format #366

merged 1 commit into from
Nov 1, 2024

Conversation

DaMandal0rian
Copy link
Contributor

@DaMandal0rian DaMandal0rian commented Nov 1, 2024

PR Type

Bug fix


Description

  • Fixed the argument names in the script parser to ensure consistency and correct functionality.
  • Changed --plot-size to --plot_size and --cache-percentage to --cache_percentage in the argparse setup.

Changes walkthrough 📝

Relevant files
Bug fix
manage_subspace.py
Fix argument names in script parser                                           

scripts/launch-nodes/manage_subspace.py

  • Fixed argument names in the script parser.
  • Changed --plot-size to --plot_size.
  • Changed --cache-percentage to --cache_percentage.
  • +2/-2     

    💡 PR-Agent usage: Comment /help "your question" on any pull request to receive relevant information

    Copy link

    github-actions bot commented Nov 1, 2024

    PR Reviewer Guide 🔍

    Here are some key observations to aid the review process:

    ⏱️ Estimated effort to review: 1 🔵⚪⚪⚪⚪
    🧪 No relevant tests
    🔒 No security concerns identified
    ⚡ No major issues detected

    Copy link

    github-actions bot commented Nov 1, 2024

    PR Code Suggestions ✨

    Explore these optional code suggestions:

    CategorySuggestion                                                                                                                                    Score
    Enhancement
    Validate and restrict the '--cache_percentage' input to ensure it is a percentage

    Validate the '--cache_percentage' input to ensure it is a valid integer within a
    specific range (e.g., 0-100).

    scripts/launch-nodes/manage_subspace.py [205]

    -parser.add_argument('--cache_percentage', help='Set the cache percentage on the farmer, i.e 10')
    +parser.add_argument('--cache_percentage', type=int, choices=range(101), help='Set the cache percentage on the farmer, i.e 10')
    Suggestion importance[1-10]: 8

    Why: This suggestion improves input validation by ensuring that '--cache_percentage' is an integer within a valid range (0-100). This prevents invalid input and enhances the reliability of the script, making it a significant improvement.

    8
    Ensure the '--plot_size' argument is validated and standardized

    Validate the input for '--plot_size' to ensure it follows a specific format, such as
    ending with a unit (e.g., 'G' for gigabytes), and convert it to a standard unit if
    necessary.

    scripts/launch-nodes/manage_subspace.py [204]

    -parser.add_argument('--plot_size', help='Set plot size on the farmer, i.e 10G')
    +parser.add_argument('--plot_size', type=validate_plot_size, help='Set plot size on the farmer, i.e 10G')
    Suggestion importance[1-10]: 7

    Why: The suggestion to validate the '--plot_size' argument enhances the robustness of the code by ensuring that the input follows a specific format, which can prevent potential errors during execution. This is a valuable improvement for user input handling.

    7

    @DaMandal0rian DaMandal0rian merged commit 4e44e77 into main Nov 1, 2024
    2 checks passed
    @DaMandal0rian DaMandal0rian deleted the fix/launch-node-args branch November 1, 2024 13:21
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Projects
    None yet
    Development

    Successfully merging this pull request may close these issues.

    2 participants