Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12']
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13']

steps:
- name: Checkout code
Expand Down
21 changes: 13 additions & 8 deletions benchmarks/datasets/medium_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@
Expected LJPW: Balanced across dimensions
"""

from typing import List, Optional, Dict, Any
from dataclasses import dataclass
import logging
from dataclasses import dataclass
from typing import Any, Dict, List, Optional


@dataclass
class User:
"""User data model with validation"""

id: int
name: str
email: str
Expand All @@ -20,11 +22,12 @@ def __post_init__(self):
"""Validate user data"""
if not self.name:
raise ValueError("Name cannot be empty")
if '@' not in self.email:
if "@" not in self.email:
raise ValueError("Invalid email format")
if self.id < 0:
raise ValueError("ID must be positive")


class UserRepository:
"""Repository for user management with error handling"""

Expand Down Expand Up @@ -102,6 +105,7 @@ def delete_user(self, user_id: int) -> bool:
return False
return False


def validate_email(email: str) -> bool:
"""
Validate email format.
Expand All @@ -115,7 +119,8 @@ def validate_email(email: str) -> bool:
if not email:
return False

return '@' in email and '.' in email.split('@')[1]
return "@" in email and "." in email.split("@")[1]


def process_users(users: List[Dict[str, Any]]) -> List[User]:
"""
Expand All @@ -137,10 +142,10 @@ def process_users(users: List[Dict[str, Any]]) -> List[User]:
for user_data in users:
try:
user = User(
id=user_data['id'],
name=user_data['name'],
email=user_data['email'],
active=user_data.get('active', True)
id=user_data["id"],
name=user_data["name"],
email=user_data["email"],
active=user_data.get("active", True),
)
result.append(user)
except KeyError as e:
Expand Down
4 changes: 3 additions & 1 deletion benchmarks/datasets/simple_script.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@
Expected LJPW: Low across all dimensions (minimal code)
"""


def greet(name):
print(f"Hello, {name}!")

if __name__ == '__main__':

if __name__ == "__main__":
greet("World")
10 changes: 10 additions & 0 deletions benchmarks/results/benchmark_history.csv
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,13 @@ timestamp,benchmark,metric,value
2025-11-15T18:46:53.084802,edge_cases,duration,0.0003802776336669922
2025-11-15T18:46:53.084802,multi_language,status,PASS
2025-11-15T18:46:53.084802,multi_language,duration,0.00010085105895996094
2025-11-29T20:03:42.889044,compression_ratio,status,PASS
2025-11-29T20:03:42.889044,compression_ratio,duration,0.0009584426879882812
2025-11-29T20:03:42.889044,performance,status,PASS
2025-11-29T20:03:42.889044,performance,duration,0.004261016845703125
2025-11-29T20:03:42.889044,accuracy,status,PASS
2025-11-29T20:03:42.889044,accuracy,duration,4.982948303222656e-05
2025-11-29T20:03:42.889044,edge_cases,status,PASS
2025-11-29T20:03:42.889044,edge_cases,duration,0.00027871131896972656
2025-11-29T20:03:42.889044,multi_language,status,PASS
2025-11-29T20:03:42.889044,multi_language,duration,7.724761962890625e-05
57 changes: 25 additions & 32 deletions benchmarks/results/benchmark_results.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"timestamp": "2025-11-15T18:46:53.084802",
"timestamp": "2025-11-29T20:03:42.889044",
"version": "1.0",
"benchmarks": {
"compression_ratio": {
"status": "PASS",
"duration": 0.04442000389099121,
"duration": 0.0009584426879882812,
"results": {
"simple_script": {
"original_bytes": 24,
Expand All @@ -19,50 +19,43 @@
"ratio": 88.92307692307692,
"expected_ratio": 500,
"passes": false
},
"django_orm": {
"original_bytes": 111746,
"compressed_bytes": 13,
"ratio": 8595.846153846154,
"expected_ratio": 50000,
"passes": false
}
}
},
"performance": {
"status": "PASS",
"duration": 0.06415891647338867,
"duration": 0.004261016845703125,
"results": {
"small": {
"avg_time_ms": 0.014190780000831182,
"iterations": 100,
"throughput": 70468.28997006705
"avg_time_ms": 0.01110658049583435,
"iterations": 10,
"throughput": 90036.71295364594
},
"medium": {
"avg_time_ms": 0.4236111799991704,
"iterations": 50,
"throughput": 2360.6553538128014
"avg_time_ms": 0.2822446636855602,
"iterations": 5,
"throughput": 3543.0253558808395
},
"large": {
"avg_time_ms": 4.150386099999537,
"iterations": 10,
"throughput": 240.9414391591451
"avg_time_ms": 2.7257688343524933,
"iterations": 1,
"throughput": 366.8689682694791
}
}
},
"accuracy": {
"status": "PASS",
"duration": 7.033348083496094e-05,
"duration": 4.982948303222656e-05,
"results": {
"round_trip_tests": 3,
"avg_reconstruction_error": 0.24146628760559694,
"avg_reconstruction_error": 0.24146628760559696,
"max_error": 0.25757134933839204,
"accuracy_percent": 75.8533712394403
}
},
"edge_cases": {
"status": "PASS",
"duration": 0.0003802776336669922,
"duration": 0.00027871131896972656,
"results": {
"empty": {
"status": "handled",
Expand All @@ -81,28 +74,28 @@
},
"unicode": {
"status": "handled",
"health": 0.3792087699787875,
"health": 0.43707367273339787,
"has_insights": true
},
"very_long_line": {
"status": "handled",
"health": 0.3775208722204013,
"health": 0.4095097403695206,
"has_insights": true
}
}
},
"multi_language": {
"status": "PASS",
"duration": 0.00010085105895996094,
"duration": 7.724761962890625e-05,
"results": {
"python": {
"ljpw": {
"L": 0.0,
"J": 0.006,
"J": 0.08839999999999999,
"P": 0.0,
"W": 0.0025000000000000005
"W": 0.041600000000000005
},
"health": 0.3792087699787875,
"health": 0.43707367273339787,
"analyzed": true
},
"javascript": {
Expand All @@ -112,7 +105,7 @@
"P": 0.0,
"W": 0.0
},
"health": 0.3775208722204013,
"health": 0.4095097403695206,
"analyzed": true
},
"rust": {
Expand All @@ -122,17 +115,17 @@
"P": 0.0,
"W": 0.0
},
"health": 0.3775208722204013,
"health": 0.4095097403695206,
"analyzed": true
},
"java": {
"ljpw": {
"L": 0.0,
"J": 0.0,
"P": 0.0,
"W": 0.0025000000000000005
"W": 0.041600000000000005
},
"health": 0.37821595929836704,
"health": 0.4199071132580034,
"analyzed": true
}
}
Expand Down
Loading
Loading