Re-added natural sort func required for merging outpot

这个提交包含在:
Craig Warren
2023-05-02 13:55:35 +01:00
父节点 da1b50fbee
当前提交 77fc219d05

查看文件

@@ -25,6 +25,7 @@ from shutil import get_terminal_size
import numpy as np
from colorama import Fore, Style, init
init()
logger = logging.getLogger(__name__)
@@ -173,6 +174,16 @@ def timer():
return timer_fn()
def atoi(text):
"""Converts a string into an integer."""
return int(text) if text.isdigit() else text
def natural_keys(text):
"""Human sorting of a string."""
return [atoi(c) for c in re.split(r'(\d+)', text)]
def numeric_list_to_int_list(l):
"""List of int from a numerical list."""
return list(map(int, l))