Skip to content

Commit 68ce077

Browse files
committed
Merge branch 'dev' into feature/vincilb/agentsmd
2 parents eb1244e + 420ddf5 commit 68ce077

169 files changed

Lines changed: 712 additions & 454 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.editorconfig

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# This file is for EditorConfig and helps maintain consistent coding styles.
2+
3+
root = true
4+
5+
[*]
6+
indent_style = space
7+
indent_size = 4
8+
charset = utf-8
9+
end_of_line = lf
10+
insert_final_newline = true
11+
trim_trailing_whitespace = true
12+
13+
[*.md]
14+
trim_trailing_whitespace = false
15+
16+
[Makefile]
17+
indent_style = tab
18+
indent_size = 4
19+
end_of_line = lf
20+
trim_trailing_whitespace = true
21+
insert_final_newline = true

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,12 @@
22
.vscode/settings.json
33
**/__pycache__/
44
**/*.egg-info/
5+
.venv/
56
.coverage
67
.ash/
8+
.temp/
9+
uv.lock
710

811
.kiro/*
912
.kiro/**/*
13+

.vscode/settings.json.example

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"git.openRepositoryInParentFolders": "always",
3+
"python.analysis.extraPaths": [],
4+
"notebook.formatOnSave.enabled": true,
5+
"notebook.codeActionsOnSave": {
6+
"notebook.source.fixAll": "explicit",
7+
"notebook.source.organizeImports": "explicit"
8+
},
9+
"[python]": {
10+
"editor.formatOnSave": true,
11+
"editor.defaultFormatter": "charliermarsh.ruff",
12+
"editor.codeActionsOnSave": {
13+
"source.fixAll": "explicit",
14+
"source.organizeImports": "explicit"
15+
},
16+
},
17+
"makefile.configureOnOpen": false
18+
}

Makefile

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Simple Makefile for stickler
22

3+
# Define color codes for terminal output
4+
RED := \033[0;31m
5+
GREEN := \033[0;32m
6+
YELLOW := \033[1;33m
7+
NC := \033[0m # No Color
8+
39
install:
410
pip install -e .
511

@@ -12,3 +18,23 @@ test:
1218
clean:
1319
find . -type d -name "__pycache__" -exec rm -rf {} + 2>/dev/null || true
1420
find . -type f -name "*.pyc" -delete
21+
22+
# Run linting checks and automatically fix issues
23+
lint:
24+
ruff check --fix
25+
26+
# CI/CD version of lint that only checks but doesn't modify files
27+
# Used in CI pipelines to verify code quality without making changes
28+
lint-cicd:
29+
@echo "Running code quality checks..."
30+
@if ! ruff check; then \
31+
echo -e "$(RED)ERROR: Ruff linting failed!$(NC)"; \
32+
echo -e "$(YELLOW)Please run 'make ruff-lint' locally to fix these issues.$(NC)"; \
33+
exit 1; \
34+
fi
35+
@if ! ruff format --check; then \
36+
echo -e "$(RED)ERROR: Code formatting check failed!$(NC)"; \
37+
echo -e "$(YELLOW)Please run 'make format' locally to fix these issues.$(NC)"; \
38+
exit 1; \
39+
fi
40+
@echo -e "$(GREEN)All code quality checks passed!$(NC)"

docs/docs/Contributing/code-style.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,23 @@ ruff check --fix .
2626
ruff check src/stickler/comparators/
2727
```
2828

29+
### Automatic Formatting in VS Code
30+
31+
To enable automatic code formatting and linting in VS Code:
32+
33+
1. Copy the example settings file:
34+
```bash
35+
cp .vscode/settings.json.example .vscode/settings.json
36+
```
37+
38+
2. Install the Ruff extension for VS Code (if not already installed):
39+
- Open VS Code
40+
- Go to Extensions (Cmd+Shift+X on macOS, Ctrl+Shift+X on Windows/Linux)
41+
- Search for "Ruff" by Charlie Marsh
42+
- Click Install
43+
44+
The settings file configures VS Code to automatically format Python files on save and organize imports using Ruff.
45+
2946
### CI Integration
3047

3148
Linting runs automatically on every push and pull request via GitHub Actions. While currently non-blocking, you should address linting issues before submitting PRs.

examples/notebooks/Complex_nested_structure.ipynb

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,14 @@
2828
"metadata": {},
2929
"outputs": [],
3030
"source": [
31-
"from typing import Optional, List\n",
32-
"from stickler.structured_object_evaluator.models.structured_model import StructuredModel\n",
33-
"from stickler.structured_object_evaluator.models.comparable_field import ComparableField\n",
31+
"import json\n",
32+
"from typing import List, Optional\n",
33+
"\n",
34+
"from stickler.comparators.exact import ExactComparator\n",
3435
"from stickler.comparators.levenshtein import LevenshteinComparator\n",
3536
"from stickler.comparators.numeric import NumericComparator\n",
36-
"from stickler.comparators.exact import ExactComparator\n",
37-
"import json"
37+
"from stickler.structured_object_evaluator.models.comparable_field import ComparableField\n",
38+
"from stickler.structured_object_evaluator.models.structured_model import StructuredModel"
3839
]
3940
},
4041
{

examples/notebooks/Custom_Comparator_Demo.ipynb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,21 +40,22 @@
4040
}
4141
],
4242
"source": [
43-
"import sys\n",
4443
"import os\n",
44+
"import sys\n",
4545
"\n",
4646
"# Add the src directory to path so we can import stickler\n",
4747
"sys.path.insert(0, os.path.join(os.path.dirname(os.getcwd()), \"src\"))\n",
4848
"\n",
4949
"from typing import Any\n",
50+
"\n",
5051
"import pandas as pd\n",
5152
"\n",
5253
"# Import stickler library components\n",
5354
"from stickler.comparators.base import BaseComparator\n",
5455
"from stickler.comparators.exact import ExactComparator\n",
5556
"from stickler.comparators.levenshtein import LevenshteinComparator\n",
56-
"from stickler.structured_object_evaluator.models.structured_model import StructuredModel\n",
5757
"from stickler.structured_object_evaluator.models.comparable_field import ComparableField\n",
58+
"from stickler.structured_object_evaluator.models.structured_model import StructuredModel\n",
5859
"\n",
5960
"print(\"✓ Successfully imported stickler library components\")"
6061
]

examples/notebooks/Quick_start.ipynb

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,11 @@
2828
"metadata": {},
2929
"outputs": [],
3030
"source": [
31-
"from stickler.structured_object_evaluator.models.structured_model import StructuredModel\n",
32-
"from stickler.structured_object_evaluator.models.comparable_field import ComparableField\n",
31+
"from typing import List\n",
32+
"\n",
3333
"from stickler.comparators.levenshtein import LevenshteinComparator\n",
34-
"from typing import List"
34+
"from stickler.structured_object_evaluator.models.comparable_field import ComparableField\n",
35+
"from stickler.structured_object_evaluator.models.structured_model import StructuredModel"
3536
]
3637
},
3738
{

examples/scripts/aggregate_metrics_demo.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,13 @@
1313
- Provides hierarchical confusion matrix analysis
1414
"""
1515

16-
from typing import Optional, List
17-
from stickler.structured_object_evaluator.models.structured_model import StructuredModel
18-
from stickler.structured_object_evaluator.models.comparable_field import ComparableField
16+
from typing import List, Optional
17+
1918
from stickler.comparators.exact import ExactComparator
20-
from stickler.comparators.numeric import NumericComparator
2119
from stickler.comparators.levenshtein import LevenshteinComparator
20+
from stickler.comparators.numeric import NumericComparator
21+
from stickler.structured_object_evaluator.models.comparable_field import ComparableField
22+
from stickler.structured_object_evaluator.models.structured_model import StructuredModel
2223

2324

2425
# Define nested data models
@@ -211,7 +212,7 @@ def demonstrate_deprecation_warning():
211212
warnings.simplefilter("always")
212213

213214
# This will trigger a deprecation warning
214-
field = ComparableField(aggregate=True, comparator=ExactComparator())
215+
ComparableField(aggregate=True, comparator=ExactComparator())
215216

216217
if w:
217218
print(f" Warning: {w[0].message}")

examples/scripts/bulk_evaluation_demo.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,17 @@
88
python bulk_evaluation_demo.py
99
"""
1010

11-
from typing import List
12-
import time
1311
import json
14-
from stickler.structured_object_evaluator.models.structured_model import StructuredModel
15-
from stickler.structured_object_evaluator.models.comparable_field import ComparableField
12+
import random
13+
import time
14+
from typing import List
15+
1616
from stickler.comparators.levenshtein import LevenshteinComparator
1717
from stickler.structured_object_evaluator.bulk_structured_model_evaluator import (
1818
BulkStructuredModelEvaluator,
1919
)
20-
import random
20+
from stickler.structured_object_evaluator.models.comparable_field import ComparableField
21+
from stickler.structured_object_evaluator.models.structured_model import StructuredModel
2122

2223

2324
# Define a simple document model for demonstration
@@ -248,7 +249,7 @@ def demo_evaluation_with_output():
248249
evaluator.update(gt_doc, pred_doc, doc_id)
249250

250251
# Get results and save metrics
251-
result = evaluator.compute()
252+
evaluator.compute()
252253
evaluator.save_metrics(metrics_file)
253254

254255
print("\n💾 Output Files Created:")
@@ -340,7 +341,7 @@ def main():
340341
print("=" * 60)
341342

342343
# Demo 1: Basic bulk evaluation
343-
evaluator = demo_basic_bulk_evaluation()
344+
demo_basic_bulk_evaluation()
344345

345346
# Demo 2: Batch processing
346347
demo_batch_processing()

0 commit comments

Comments
 (0)