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

Update sorting method in ehighways renaming #398

Merged
merged 3 commits into from
Jun 21, 2024

Conversation

brynpickering
Copy link
Member

@brynpickering brynpickering commented Jun 11, 2024

Fixes #397.

The initial method was string sorting so that [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11] would be sorted as [1, 10, 11, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11].

This will now sort the abovementioned example correctly, but also handle ordering of 1-1.1, 1-2.1 etc. by extracting all digits from the string and then combining them together into a new number (111, 121 in this example).

Checklist

Any checks which are not relevant to the PR can be pre-checked by the PR creator. All others should be checked by the reviewer. You can add extra checklist items here if required by the PR.

  • CHANGELOG updated
  • Minimal workflow tests pass
  • Tests added to cover contribution
  • Documentation updated
  • Configuration schema updated

order = (
units.id.str.extractall(r"(\d+)")
.groupby(level=0)
.sum()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not exactly clear to me what you are summing here. Maybe a comment would be helpful.

@timtroendle timtroendle merged commit ab295aa into develop Jun 21, 2024
4 checks passed
@timtroendle timtroendle deleted the fix-ehighways-renaming branch June 21, 2024 07:34
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.

e-highways connection problems in full workflow
2 participants