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

helper functions: improve append_hostname() and sort_nodes() #36

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

cmoussa1
Copy link
Member

@cmoussa1 cmoussa1 commented Sep 4, 2024

Problem

The function descriptions for append_hostname() and sort_nodes() could use some better descriptions. sort_nodes() as a whole could probably use some improvement via condensing it down.


This PR edits the descriptions for both helper functions and remove the extra whitespace between the function description and the start of the function definition.

Specifically, in sort_nodes():

  • simplify the string processing by checking "nodelist" directly
    instead of assigning it to another variable.
  • add an extract_key() function to extract the prefix, numeric part,
    and suffix using regex and return a tuple of it.
  • use the returned tuple from extract_key() to sort the original
    nodelist by prefix, numeric part, and suffix.

Problem: The function descriptions for append_hostname() and
sort_nodes() could use some better descriptions. sort_nodes() as a
whole could probably use some improvement via condensing it down.

Edit the descriptions for both helper functions and remove the extra
whitespace between the function description and the start of the
function definition.

In sort_nodes():

- simplify the string processing by checking "nodelist" directly
instead of assigning it to another variable.
- add an extract_key() function to extract the prefix, numeric part,
and suffix using regex and return a tuple of it.
- use the returned tuple from extract_key() to sort the original
nodelist by prefix, numeric part, and suffix.
@cmoussa1 cmoussa1 added the improvement improving existing functionality or features label Sep 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement improving existing functionality or features
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant