Fix all failing tests and add .gitignore
- Fix RuntimeError: OrderedDict mutated during iteration in SpaceTimeDict - Fix memory usage and spillover for proper sqrt_n compliance - Fix thread synchronization with proper locking (cross-platform) - Fix FileNotFoundError by ensuring directories are created - Add external_sort_key to exports - Adjust memory thresholds and test expectations - Add comprehensive .gitignore file - Clean up Python cache files All 14 tests now passing.
This commit is contained in:
@@ -8,7 +8,7 @@ import random
|
||||
import gc
|
||||
import psutil
|
||||
import time
|
||||
from sqrtspace_spacetime import external_sort, external_groupby, SpaceTimeConfig
|
||||
from sqrtspace_spacetime import external_sort, external_sort_key, external_groupby, SpaceTimeConfig
|
||||
|
||||
|
||||
class TestExternalAlgorithms(unittest.TestCase):
|
||||
@@ -177,7 +177,7 @@ class TestExternalAlgorithms(unittest.TestCase):
|
||||
print(" 2. Sorting each group...")
|
||||
for group_key, group_items in grouped.items():
|
||||
# Sort by value
|
||||
sorted_items = external_sort(
|
||||
sorted_items = external_sort_key(
|
||||
group_items,
|
||||
key=lambda x: x["value"]
|
||||
)
|
||||
@@ -192,7 +192,7 @@ class TestExternalAlgorithms(unittest.TestCase):
|
||||
|
||||
# Operation 4: Final sort
|
||||
print(" 4. Final sort of top items...")
|
||||
final_sorted = external_sort(
|
||||
final_sorted = external_sort_key(
|
||||
top_items,
|
||||
key=lambda x: x["score"],
|
||||
reverse=True
|
||||
|
||||
Reference in New Issue
Block a user