gary-boon Claude commited on
Commit
9dbec03
·
1 Parent(s): c0d95bf

Fix syntax error in swe_bench_service.py

Browse files

- Remove commented-out mock data function with nested triple quotes
- Triple quotes inside comments were causing Python syntax errors
- Clean removal ensures no mock data and fixes deployment

🤖 Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>

Files changed (1) hide show
  1. backend/swe_bench_service.py +2 -67
backend/swe_bench_service.py CHANGED
@@ -95,73 +95,8 @@ class SWEBenchService:
95
  self.metrics_cache: Dict[str, Any] = {}
96
 
97
  # Removed _load_mock_tasks - real data only for research
98
- """
99
- def _load_mock_tasks(self):
100
- # Load mock tasks when dataset isn't available
101
- repos = [
102
- "astropy/astropy", "django/django", "matplotlib/matplotlib",
103
- "pandas-dev/pandas", "pytest-dev/pytest", "scikit-learn/scikit-learn"
104
- ]
105
-
106
- statements = [
107
- """Modeling's `separability_matrix` does not compute separability correctly for nested CompoundModels
108
-
109
- Consider the following model:
110
-
111
- ```python
112
- from astropy.modeling import models as m
113
- from astropy.modeling.separable import separable_matrix
114
-
115
- cm = m.Linear1D(10) & m.Linear1D(5)
116
- ```
117
-
118
- It's separability matrix as you might expect is a diagonal:
119
-
120
- ```python
121
- >>> separability_matrix(cm)
122
- array([[ True, False],
123
- [False, True]])
124
- ```""",
125
- """Please support header rows in RestructuredText output
126
-
127
- ### Description
128
- It would be great if the RestructuredText output could have header rows for tables, similar to what MySQL does for pipe formatting.
129
-
130
- ### Expected behavior
131
- According to the documentation for MyST parsers, the docutils RST table expects the first row to be treated as a header row.
132
-
133
- ### Actual behavior
134
- The RST output treats the first row as a regular data row and doesn't mark it as a header.""",
135
- """Issue when parsing empty lists/arrays in configuration
136
-
137
- When attempting to parse empty lists or arrays from configuration files, the parser incorrectly raises a ValueError instead of returning an empty list.
138
-
139
- ```python
140
- >>> config.parse_list("[]")
141
- ValueError: invalid literal for int() with base 10: '[]'
142
- ```
143
-
144
- Expected behavior: Should return an empty list []"""
145
- ]
146
-
147
- for i in range(300): # Create 300 mock tasks for better testing
148
- repo = repos[i % len(repos)]
149
- repo_name = repo.split('/')[1]
150
- issue_number = 11000 + i
151
-
152
- task = SWEBenchTask(
153
- instance_id=f"{repo_name}__{repo_name}-{issue_number}",
154
- repo=repo,
155
- problem_statement=statements[i % len(statements)],
156
- base_commit=f"commit_{i:04d}",
157
- patch="# Mock patch\n+ line added\n- line removed",
158
- FAIL_TO_PASS=["test_1", "test_2"] if i % 2 == 0 else ["test_a"],
159
- PASS_TO_PASS=["test_pass_1", "test_pass_2"]
160
- )
161
- self.tasks[task.instance_id] = task
162
-
163
- logger.info(f"Loaded {len(self.tasks)} mock SWE-bench tasks")
164
- """
165
 
166
  async def load_dataset(self, dataset_name: str = "princeton-nlp/SWE-bench_Lite"):
167
  """Load SWE-bench dataset from Hugging Face"""
 
95
  self.metrics_cache: Dict[str, Any] = {}
96
 
97
  # Removed _load_mock_tasks - real data only for research
98
+ # Mock data generation has been completely removed to ensure
99
+ # only real SWE-bench tasks are used for PhD research integrity
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
100
 
101
  async def load_dataset(self, dataset_name: str = "princeton-nlp/SWE-bench_Lite"):
102
  """Load SWE-bench dataset from Hugging Face"""