fastled 1.4.40__py3-none-any.whl → 1.4.41__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- fastled/__version__.py +1 -1
- fastled/string_diff.py +94 -8
- {fastled-1.4.40.dist-info → fastled-1.4.41.dist-info}/METADATA +1 -1
- {fastled-1.4.40.dist-info → fastled-1.4.41.dist-info}/RECORD +8 -8
- {fastled-1.4.40.dist-info → fastled-1.4.41.dist-info}/WHEEL +0 -0
- {fastled-1.4.40.dist-info → fastled-1.4.41.dist-info}/entry_points.txt +0 -0
- {fastled-1.4.40.dist-info → fastled-1.4.41.dist-info}/licenses/LICENSE +0 -0
- {fastled-1.4.40.dist-info → fastled-1.4.41.dist-info}/top_level.txt +0 -0
fastled/__version__.py
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# IMPORTANT! There's a bug in github which will REJECT any version update
|
2
2
|
# that has any other change in the repo. Please bump the version as the
|
3
3
|
# ONLY change in a commit, or else the pypi update and the release will fail.
|
4
|
-
__version__ = "1.4.
|
4
|
+
__version__ = "1.4.41"
|
5
5
|
|
6
6
|
__version_url_latest__ = "https://raw.githubusercontent.com/zackees/fastled-wasm/refs/heads/main/src/fastled/__version__.py"
|
fastled/string_diff.py
CHANGED
@@ -80,14 +80,100 @@ def string_diff(
|
|
80
80
|
exact_matches = [s for s in string_list if s == input_string]
|
81
81
|
substring_matches = [s for s in string_list if input_string in s]
|
82
82
|
|
83
|
-
# If there's
|
84
|
-
#
|
85
|
-
if exact_matches and len(substring_matches) > 1:
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
83
|
+
# If there's exactly one exact match, and there are substring matches,
|
84
|
+
# check if we should prioritize the exact match or return all variants
|
85
|
+
if len(exact_matches) == 1 and len(substring_matches) > 1:
|
86
|
+
exact_match = exact_matches[0]
|
87
|
+
other_substring_matches = [s for s in substring_matches if s != exact_match]
|
88
|
+
|
89
|
+
# Prioritize exact match only if it appears at the start of other matches
|
90
|
+
# AND those matches have a camelCase boundary (indicating compound words)
|
91
|
+
# We need to use the original (non-lowercased) strings for camelCase detection
|
92
|
+
should_prioritize_exact = True
|
93
|
+
original_exact_match = map_string[exact_match] # Get the original casing
|
94
|
+
|
95
|
+
for other_match in other_substring_matches:
|
96
|
+
original_other_match = map_string[other_match] # Get the original casing
|
97
|
+
|
98
|
+
if not original_other_match.lower().startswith(
|
99
|
+
original_exact_match.lower()
|
100
|
+
):
|
101
|
+
# If the exact match isn't at the start, don't prioritize
|
102
|
+
should_prioritize_exact = False
|
103
|
+
break
|
104
|
+
|
105
|
+
# Check for camelCase boundary after the exact match in the ORIGINAL string
|
106
|
+
remainder = original_other_match[len(original_exact_match) :]
|
107
|
+
if remainder and remainder[0].isupper():
|
108
|
+
# Only prioritize exact match if the exact match is very short (4 chars or less)
|
109
|
+
# AND the remainder suggests a different concept
|
110
|
+
if len(original_exact_match) <= 4 and len(remainder) >= 6:
|
111
|
+
# This looks like a camelCase compound word (e.g., "wasm" -> "WasmScreenCoords")
|
112
|
+
continue
|
113
|
+
else:
|
114
|
+
# This looks like a variant (e.g., "Noise" -> "NoisePlayground", "Fire2012" -> "Fire2012WithPalette")
|
115
|
+
should_prioritize_exact = False
|
116
|
+
break
|
117
|
+
else:
|
118
|
+
# This looks like a variant/extension (e.g., "Blur" -> "Blur2d")
|
119
|
+
should_prioritize_exact = False
|
120
|
+
break
|
121
|
+
|
122
|
+
if should_prioritize_exact:
|
123
|
+
out: list[tuple[float, str]] = []
|
124
|
+
for i, s in enumerate(exact_matches):
|
125
|
+
s_mapped = map_string.get(s, s)
|
126
|
+
out.append((i, s_mapped))
|
127
|
+
return out
|
128
|
+
else:
|
129
|
+
# Apply character count filtering only for very specific compound terms
|
130
|
+
# Main criteria: contains numbers AND ends with numbers/letters (like Wave2d, Fire2012)
|
131
|
+
original_exact_match = map_string[exact_match]
|
132
|
+
should_apply_char_filter = (
|
133
|
+
len(original_exact_match) >= 5 # Longer terms
|
134
|
+
and any(c.isdigit() for c in original_exact_match) # Contains numbers
|
135
|
+
and (
|
136
|
+
original_exact_match[-1].isdigit()
|
137
|
+
or original_exact_match[-1].islower()
|
138
|
+
) # Ends specifically (compound pattern)
|
139
|
+
)
|
140
|
+
|
141
|
+
if should_apply_char_filter:
|
142
|
+
# Filter substring matches based on extra character count
|
143
|
+
# Use a more lenient threshold for shorter base terms
|
144
|
+
if len(original_exact_match) <= 6:
|
145
|
+
# For short terms, allow more extra chars (e.g., "Wave2d" + "FxWave2d")
|
146
|
+
MAX_EXTRA_CHARS = min(10, len(original_exact_match) * 2)
|
147
|
+
else:
|
148
|
+
# For longer terms, allow significant extensions (e.g., "Fire2012" + "Fire2012WithPalette")
|
149
|
+
MAX_EXTRA_CHARS = 12
|
150
|
+
|
151
|
+
filtered_matches = []
|
152
|
+
|
153
|
+
for s in substring_matches:
|
154
|
+
original_s = map_string[s]
|
155
|
+
if s == exact_match:
|
156
|
+
# Always include the exact match
|
157
|
+
filtered_matches.append(s)
|
158
|
+
else:
|
159
|
+
# Calculate extra characters
|
160
|
+
extra_chars = len(original_s) - len(original_exact_match)
|
161
|
+
if extra_chars <= MAX_EXTRA_CHARS:
|
162
|
+
filtered_matches.append(s)
|
163
|
+
|
164
|
+
# Return filtered matches
|
165
|
+
out: list[tuple[float, str]] = []
|
166
|
+
for i, s in enumerate(filtered_matches):
|
167
|
+
s_mapped = map_string.get(s, s) or s
|
168
|
+
out.append((i, s_mapped))
|
169
|
+
return out
|
170
|
+
else:
|
171
|
+
# Return all substring matches (original behavior for base terms)
|
172
|
+
out: list[tuple[float, str]] = []
|
173
|
+
for i, s in enumerate(substring_matches):
|
174
|
+
s_mapped = map_string.get(s, s) or s
|
175
|
+
out.append((i, s_mapped))
|
176
|
+
return out
|
91
177
|
|
92
178
|
# If there's only an exact match and no other substring matches, return just the exact match
|
93
179
|
if exact_matches and len(substring_matches) == 1:
|
@@ -1,6 +1,6 @@
|
|
1
1
|
fastled/__init__.py,sha256=LlLu9fO3O4FeB5-wt2wHGIFJW76H9FlhdABytEqg8A4,7717
|
2
2
|
fastled/__main__.py,sha256=OcKv2ER1_iQAsZzLIUb3C8hRC9L2clNOhCrjpshrlf4,336
|
3
|
-
fastled/__version__.py,sha256=
|
3
|
+
fastled/__version__.py,sha256=dYoUh8wtIlncUqlfTLpBVjV-GcDvlcmZ3IZmDqdi6JA,373
|
4
4
|
fastled/app.py,sha256=fWOH2SA4rxW8BPNgBrKs4xsWvUEMX6RzMWPKyyjBoVM,7539
|
5
5
|
fastled/args.py,sha256=Xa7AYnoMcsuSVQUyM6M2P_8liQtQFJzuuBdPbfw9U-g,4786
|
6
6
|
fastled/cli.py,sha256=drgR2AOxVrj3QEz58iiKscYAumbbin2vIV-k91VCOAA,561
|
@@ -29,7 +29,7 @@ fastled/server_start.py,sha256=W9yKStkRlRNuXeV6j_6O7HjjFPyVLBHMcF9Uy2QjDWQ,479
|
|
29
29
|
fastled/settings.py,sha256=8RLN3S0ZK4DMphr0gKPfwPKfwIzOtHiQsqMTpGnX7Xg,1842
|
30
30
|
fastled/sketch.py,sha256=Ftbh55Nt-p4hmPuPpj8Q9HrMzvnUazhoG_q9FHcxkns,3473
|
31
31
|
fastled/spinner.py,sha256=VHxmvB92P0Z_zYxRajb5HiNmkHHvZ5dG7hKtZltzpcs,867
|
32
|
-
fastled/string_diff.py,sha256=
|
32
|
+
fastled/string_diff.py,sha256=C1b0DQp4GLV1Axj8t1InRWhjP0HHbvWHwf1yzrBKthA,10345
|
33
33
|
fastled/types.py,sha256=tBikcoKjbBcCTi36MMCz_TjMEBoa-FppRL-yKAVwXFc,1909
|
34
34
|
fastled/util.py,sha256=lJ6Pcqgn4DiNhvAqp6i8O0ghpvvE-JfA1XwvJ5qS9B0,2701
|
35
35
|
fastled/version.py,sha256=TpBMiEVdO3_sUZEu6wmwN8Q4AgX2BiCxStCsnPKh6E0,1209
|
@@ -52,9 +52,9 @@ fastled/site/build.py,sha256=2YKU_UWKlJdGnjdbAbaL0co6kceFMSTVYwH1KCmgPZA,13987
|
|
52
52
|
fastled/site/examples.py,sha256=s6vj2zJc6BfKlnbwXr1QWY1mzuDBMt6j5MEBOWjO_U8,155
|
53
53
|
fastled/test/can_run_local_docker_tests.py,sha256=LEuUbHctRhNNFWcvnz2kEGmjDJeXO4c3kNpizm3yVJs,400
|
54
54
|
fastled/test/examples.py,sha256=M0o-5NIhCuwcUHo7CPQw5llLd3OU3FfPgussVScd8Fs,1741
|
55
|
-
fastled-1.4.
|
56
|
-
fastled-1.4.
|
57
|
-
fastled-1.4.
|
58
|
-
fastled-1.4.
|
59
|
-
fastled-1.4.
|
60
|
-
fastled-1.4.
|
55
|
+
fastled-1.4.41.dist-info/licenses/LICENSE,sha256=b6pOoifSXiUaz_lDS84vWlG3fr4yUKwB8fzkrH9R8bQ,1064
|
56
|
+
fastled-1.4.41.dist-info/METADATA,sha256=AGAa7mbAeZiuKcOmRBmORgUFCmtf6to6W6wF9LVCsG0,31944
|
57
|
+
fastled-1.4.41.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
58
|
+
fastled-1.4.41.dist-info/entry_points.txt,sha256=RCwmzCSOS4-C2i9EziANq7Z2Zb4KFnEMR1FQC0bBwAw,101
|
59
|
+
fastled-1.4.41.dist-info/top_level.txt,sha256=Bbv5kpJpZhWNCvDF4K0VcvtBSDMa8B7PTOrZa9CezHY,8
|
60
|
+
fastled-1.4.41.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|