你已经派生过 gprMax
镜像自地址
https://gitee.com/sunhf/gprMax.git
已同步 2025-08-07 15:10:13 +08:00
Re-instated natural keys function for file sorting
这个提交包含在:
@@ -19,6 +19,7 @@
|
||||
import datetime
|
||||
import decimal as d
|
||||
import logging
|
||||
import re
|
||||
import textwrap
|
||||
from shutil import get_terminal_size
|
||||
|
||||
@@ -50,6 +51,16 @@ def get_terminal_width():
|
||||
return terminalwidth
|
||||
|
||||
|
||||
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 logo(version):
|
||||
"""Prints gprMax logo, version, and licencing/copyright information.
|
||||
|
||||
@@ -172,14 +183,4 @@ def fft_power(waveform, dt):
|
||||
|
||||
def timer():
|
||||
"""Time in fractional seconds."""
|
||||
return timer_fn()
|
||||
|
||||
|
||||
def numeric_list_to_int_list(l):
|
||||
"""List of int from a numerical list."""
|
||||
return list(map(int, l))
|
||||
|
||||
|
||||
def numeric_list_to_float_list(l):
|
||||
"""List of float from a numerical list."""
|
||||
return list(map(float, l))
|
||||
return timer_fn()
|
在新工单中引用
屏蔽一个用户