| check_bad_prices |
Ran ran, honoured the contract we drafted |
aslcai/OpenPM-Bench/agents/data_quality.py code served (permissive licence) · get_code("997de451cd98526f") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned list, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import pandas as pd
import numpy as np
# Create a sample DataFrame with stock price data
data = {
'symbol': ['AAPL', 'AAPL', 'GOOG', 'GOOG', 'MSFT', 'MSFT'],
'open': [150.0, 152.0, 2800.0, 2805.0, 300.0, 305.0],
'high': [155.0, 156.0, 2810.0, 2815.0, 310.0, 315.0],
'low': [148.0, 150.0, 2790.0, 2800.0, 295.0, 300.0],
'close': [153.0, 154.0, 2808.0, 2812.0, 308.0, 312.0]
}
df = pd.DataFrame(data)
ARGS = {
'df': df
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- numpy, pandas — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type list, ndim 1, dtype family float — a list output has no array shape of its own; none is stated
- dtype family
- int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| check_missing_bars |
Ran ran; our contract draft was wrong, not the code |
aslcai/OpenPM-Bench/agents/data_quality.py code served (permissive licence) · get_code("fadfe44e7611fd92") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned list, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import pandas as pd
from dataclasses import asdict, dataclass
@dataclass(frozen=True)
class Issue:
severity: str
symbol: str
problem: str
count: int
def as_dict(self) -> dict:
return asdict(self)
def check_missing_bars(df: pd.DataFrame) -> list[Issue]:
"""Per-symbol bar count vs the cross-symbol max.
Single-day input → "expected = the most-complete symbol's count" is
the pragmatic baseline. Half-day boundary → every symbol has the
same shorter count → max = everyone = no flag. Symbol with halt /
late listing / partial coverage shows up with count = deficit.
"""
if df.empty:
return []
counts = df.groupby('symbol').size()
expected = int(counts.max())
return [Issue('medium', sym, 'missing_bars', int(expected - n)) for sym, n in counts.items() if n < expected]
# Construct a valid DataFrame for check_missing_bars
# The function groups by 'symbol' and counts rows per symbol
# It expects all symbols to have the same count ideally;
# missing bars are flagged for symbols with fewer rows
df = pd.DataFrame({
'symbol': ['AAPL', 'AAPL', 'AAPL', 'AAPL', 'MSFT', 'MSFT', 'MSFT', 'GOOG', 'GOOG'],
'price': [150.0, 151.0, 152.0, 153.0, 300.0, 301.0, 302.0, 2800.0, 2801.0],
'volume': [1000, 1100, 900, 1050, 500, 510, 495, 2000, 2100]
})
ARGS = {
'df': df
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- pandas — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type list, ndim 1, dtype family float — a list output has no array shape of its own; none is stated
- dtype family
- int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| check_zero_volume |
Ran ran; our contract draft was wrong, not the code |
aslcai/OpenPM-Bench/agents/data_quality.py code served (permissive licence) · get_code("b25115fe9bc4a86e") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned list, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import pandas as pd
import numpy as np
# Create a sample DataFrame with 'symbol' and 'volume' columns
# Include some rows with zero volume to test the filtering
df = pd.DataFrame({
'symbol': ['AAPL', 'AAPL', 'AAPL', 'GOOGL', 'GOOGL', 'MSFT', 'MSFT'],
'volume': [1000, 0, 0, 500, 0, 0, 0]
})
ARGS = {
'df': df
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- numpy, pandas — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type list, ndim 1, dtype family float — a list output has no array shape of its own; none is stated
- dtype family
- int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| count_rows |
Ran ran, honoured the contract we drafted |
aslcai/OpenPM-Bench/collectors/freeze.py code served (permissive licence) · get_code("548e1e5b0ad7978b") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned int, ndim 0, dtype family int, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
from pathlib import Path
import tempfile
import os
# Create temporary test files
temp_dir = tempfile.mkdtemp()
# Create a test .parquet file
parquet_path = Path(temp_dir) / "test.parquet"
try:
import pyarrow.parquet as pq
import pyarrow as pa
# Create a simple table and write to parquet
table = pa.table({
'col1': [1, 2, 3, 4, 5],
'col2': ['a', 'b', 'c', 'd', 'e']
})
pq.write_table(table, parquet_path)
except Exception:
parquet_path = Path(temp_dir) / "test.txt"
# Create a test .ndjson file
ndjson_path = Path(temp_dir) / "test.ndjson"
with open(ndjson_path, 'w') as f:
f.write('{"key": "value1"}\n')
f.write('{"key": "value2"}\n')
f.write('{"key": "value3"}\n')
# Define ARGS with valid path
ARGS = {
'path': ndjson_path
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- pyarrow — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type int, ndim 0, dtype family int, shape () — shape () as a later run recorded it
- dtype family
- int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| feature_output_filename |
Ran ran; our contract draft was wrong, not the code |
aslcai/OpenPM-Bench/agents/feature_paths.py code served (permissive licence) · get_code("909aae065d34d8ae") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned str. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import torch
import numpy as np
from typing import Iterable
torch.manual_seed(0)
# Test case 1: Valid single symbol
ARGS = {
'symbols': ['AAPL']
}
# Alternative test cases (uncomment to test different scenarios):
# Test case 2: Multiple symbols (within limit)
# ARGS = {
# 'symbols': ['AAPL', 'GOOGL', 'MSFT']
# }
# Test case 3: Symbols with whitespace and mixed case
# ARGS = {
# 'symbols': [' aapl ', 'GOOGL', ' msft']
# }
# Test case 4: Duplicate symbols (will be deduplicated)
# ARGS = {
# 'symbols': ['AAPL', 'aapl', 'AAPL']
# }
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| get_sp500_members_between |
Ran ran; our contract draft was wrong, not the code |
aslcai/OpenPM-Bench/collectors/universe.py code served (permissive licence) · get_code("03c77445ee83ba60") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned list, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
from datetime import date as DateType
import pandas as pd
from pathlib import Path
import numpy as np
# Create a minimal membership DataFrame with the required columns
membership_data = {
'symbol': ['AAPL', 'MSFT', 'GOOGL', 'TSLA', 'AMZN'],
'entry_date': [
DateType(2015, 1, 1),
DateType(2010, 6, 15),
DateType(2006, 4, 3),
DateType(2020, 12, 21),
DateType(2005, 11, 18)
],
'exit_date': [
pd.NaT,
pd.NaT,
DateType(2022, 8, 10),
pd.NaT,
pd.NaT
]
}
membership_df = pd.DataFrame(membership_data)
ARGS = {
'start_date': DateType(2020, 1, 1),
'end_date': DateType(2023, 12, 31),
'membership_df': membership_df,
'membership_path': None
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- numpy, pandas — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type list, ndim 1, dtype family float — a list output has no array shape of its own; none is stated
- dtype family
- int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| get_sp500_members_on |
Ran ran; our contract draft was wrong, not the code |
aslcai/OpenPM-Bench/collectors/universe.py code served (permissive licence) · get_code("5cd03955f627a946") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned list, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
from datetime import date as DateType
import pandas as pd
from pathlib import Path
# Create a minimal membership DataFrame with the required columns
membership_data = {
'symbol': ['AAPL', 'MSFT', 'GOOGL', 'AMZN', 'TSLA'],
'entry_date': [
DateType(2010, 1, 1),
DateType(2012, 6, 15),
DateType(2006, 4, 3),
DateType(2005, 11, 18),
DateType(2020, 12, 21),
],
'exit_date': [
None,
None,
DateType(2022, 1, 1),
None,
None,
]
}
membership_df = pd.DataFrame(membership_data)
# Test date
test_date = DateType(2021, 6, 15)
ARGS = {
'date': test_date,
'membership_df': membership_df,
'membership_path': None,
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- pandas — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type list, ndim 1, dtype family float — a list output has no array shape of its own; none is stated
- dtype family
- int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| iter_files |
Ran ran; our contract draft was wrong, not the code |
aslcai/OpenPM-Bench/collectors/freeze.py code served (permissive licence) · get_code("1d1acb98f1c8dc2e") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned list, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import tempfile
import shutil
from pathlib import Path
# Create a temporary directory structure for testing
temp_dir = tempfile.mkdtemp()
root = Path(temp_dir)
# Create some test files
(root / "file1.py").write_text("# python file")
(root / "file2.txt").write_text("text content")
# Create subdirectories with files
subdir1 = root / "subdir1"
subdir1.mkdir()
(subdir1 / "nested.py").write_text("# nested")
(subdir1 / "data.json").write_text("{}")
# Create junk files that should be excluded
(root / "file.pyc").write_text("junk")
(root / ".DS_Store").write_text("junk")
subdir2 = root / "subdir2"
subdir2.mkdir()
(subdir2 / "file.tmp").write_text("junk")
# Create __pycache__ directory
pycache_dir = root / "__pycache__"
pycache_dir.mkdir()
(pycache_dir / "cache.pyc").write_text("junk")
ARGS = {
"root": root,
"include": None,
"exclude": None,
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type list, ndim 1, dtype family float — a list output has no array shape of its own; none is stated
- dtype family
- int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| resolve_symbols_filter |
Ran ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT) |
aslcai/OpenPM-Bench/agents/feature.py code served (permissive licence) · get_code("22bc40ed82cfcf28") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
from pathlib import Path
import tempfile
import json
# Create a temporary directory for the manifest
temp_dir = Path(tempfile.gettempdir())
manifest_path = temp_dir / "test_manifest.json"
# Create a valid manifest file with resolved_tickers
manifest_data = {
"resolved_tickers": ["AAPL", "GOOGL", "MSFT"],
"mode": "test_mode",
"resolved_at": "2024-01-01T00:00:00Z",
"n_tickers": 3
}
manifest_path.write_text(json.dumps(manifest_data))
ARGS = {
"symbols": None,
"universe": None,
"manifest_path": manifest_path,
"eval_start": None,
"eval_end": None,
"scope": "union"
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- collectors — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type tuple — a tuple output has no array shape of its own; none is stated
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| sha256_file |
Ran ran; our contract draft was wrong, not the code |
aslcai/OpenPM-Bench/collectors/freeze.py code served (permissive licence) · get_code("8862dc4ae1fa2b0f") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned str. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import hashlib
from pathlib import Path
import tempfile
import os
# Create a temporary file with some content
with tempfile.NamedTemporaryFile(mode='wb', delete=False, suffix='.txt') as f:
temp_file_path = f.name
f.write(b'Hello, World! This is test content for SHA256 hashing.')
try:
# Define ARGS with all parameters
ARGS = {
'path': Path(temp_file_path),
'chunk': 1 << 20 # 1 MB default chunk size
}
finally:
# Clean up will happen after function execution
pass
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| summarize |
Ran ran; our contract draft was wrong, not the code |
aslcai/OpenPM-Bench/agents/feature_validation.py code served (permissive licence) · get_code("c03077de44bf2a39") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned str. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import torch
from collections import defaultdict
from dataclasses import dataclass
torch.manual_seed(0)
@dataclass(frozen=True)
class ValidationFinding:
severity: str
code: str
symbol: str | None
time: str | None
detail: str
def __str__(self) -> str:
where = f"{self.symbol or '-'} @ {self.time or '-'}"
return f'[{self.severity.upper():5}] {self.code}: {where} — {self.detail}'
findings = [
ValidationFinding(
severity='error',
code='OUT_OF_RANGE',
symbol='feature_1',
time='2024-01-15T10:30:00',
detail='Value exceeds maximum threshold'
),
ValidationFinding(
severity='error',
code='OUT_OF_RANGE',
symbol='feature_2',
time='2024-01-15T10:31:00',
detail='Value is negative'
),
ValidationFinding(
severity='error',
code='OUT_OF_RANGE',
symbol='feature_3',
time='2024-01-15T10:32:00',
detail='Value is NaN'
),
ValidationFinding(
severity='warning',
code='MISSING_VALUE',
symbol='feature_4',
time='2024-01-15T10:33:00',
detail='Imputed with mean'
),
ValidationFinding(
severity='warning',
code='MISSING_VALUE',
symbol='feature_5',
time='2024-01-15T10:34:00',
detail='Imputed with zero'
),
ValidationFinding(
severity='warning',
code='MISSING_VALUE',
symbol='feature_6',
time='2024-01-15T10:35:00',
detail='Dropped from batch'
),
ValidationFinding(
severity='info',
code='SKEW_DETECTED',
symbol='feature_7',
time='2024-01-15T10:36:00',
detail='High skewness observed'
),
]
ARGS = {
'findings': findings,
'max_examples': 5,
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| symbol_scoped_feature_output |
Ran ran; our contract draft was wrong, not the code |
aslcai/OpenPM-Bench/agents/feature_paths.py code served (permissive licence) · get_code("087ee2f93308c3f1") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned PosixPath. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
from pathlib import Path
def setup():
# The function uses:
# - symbols: Iterable[str] - passed to _normalize which processes strings
# - root: Path - used in Path.__truediv__ (/) operation
symbols = ['AAPL', 'MSFT', 'GOOGL']
root = Path('/tmp/feature_output')
return {
'symbols': symbols,
'root': root
}
ARGS = setup()
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type PosixPath — a PosixPath output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a PosixPath output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| validate_rows |
Ran ran; our contract draft was wrong, not the code |
aslcai/OpenPM-Bench/agents/feature_validation.py code served (permissive licence) · get_code("8cbc747c123c40b3") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned list, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
# Setup code for validate_rows function
# First, we need to understand what the function signature is by analyzing the code
# From the provided code snippets, we can see several helper functions that work with:
# - sym: str (symbol)
# - day_rows: list[dict] (rows of data for a day)
# Looking at the incomplete function signature and the helpers, we need to infer
# what validate_rows takes. Based on the helper functions, it likely takes:
# - rows or day_rows (iterable of dicts)
# - possibly a symbol or list of symbols
# - possibly other parameters
# Let's construct realistic test data structures
# Define WARMUP_BARS and _FIELD_BLOCK since they're referenced in _check_warmup
WARMUP_BARS = {
'vwap': 20,
'atr': 14,
'rsi': 14,
'bb_upper': 20,
}
_FIELD_BLOCK = {
'vwap': 'bar_state',
'atr': 'bar_state',
'rsi': 'bar_state',
'bb_upper': 'bar_state',
}
# Construct sample row data
def make_row(time_str, quote_count=150, sector_etf='XLK',
median_spread_bps=35.0, depth=150.0, illiquidity_flag=0,
volume_zscore=None, sector_rel_strength=1.5,
stock_minus_sector=0.5, vwap=100.0):
"""Helper to create a realistic row dict"""
return {
'time': time_str,
'liquidity_state': {
'quote_update_count': quote_count,
'median_spread_bps': median_spread_bps,
'mean_quoted_depth': depth,
'illiquidity_flag': illiquidity_flag,
},
'regime_state': {
'sector_etf': sector_etf,
'sector_relative_strength_5m': sector_rel_strength,
'stock_minus_sector_return': stock_minus_sector,
},
'bar_state': {
'volume_zscore': volume_zscore if volume_zscore is not None else (0.0 if time_str.endswith('09:30:00') else 1.5),
'vwap': vwap,
},
}
# Create sample data for a full trading day
sample_rows = [
make_row('2024-01-15 09:30:00', quote_count=150, volume_zscore=0.0),
make_row('2024-01-15 09:31:00', quote_count=160, volume_zscore=1.2),
make_row('2024-01-15 09:32:00', quote_count=170, volume_zscore=1.8),
make_row('2024-01-15 09:33:00', quote_count=155, volume_zscore=0.9),
make_row('2024-01-15 09:34:00', quote_count=180, volume_zscore=2.1),
make_row('2024-01-15 09:35:00', quote_count=165, volume_zscore=1.5),
]
# Test case with sector_etf missing
sample_rows_sector_issue = [
make_row('2024-01-15 09:30:00', quote_count=150, sector_etf=None),
make_row('2024-01-15 09:31:00', quote_count=160),
]
# Test case with constant volume_zscore
sample_rows_constant_volume = [
make_row('2024-01-15 09:30:00', quote_count=150, volume_zscore=0.0),
make_row('2024-01-15 09:31:00', quote_count=160, volume_zscore=0.0),
make_row('2024-01-15 09:32:00', quote_count=170, volume_zscore=0.0),
make_row('2024-01-15 09:33:00', quote_count=155, volume_zscore=0.0),
]
# Test case with false positive illiquidity flag
sample_rows_illiq = [
make_row('2024-01-15 09:30:00', quote_count=150,
median_spread_bps=40.0, depth=120.0, illiquidity_flag=1),
]
# Based on the code analysis, validate_rows likely takes rows grouped by day
# The function probably validates an iterable of rows
ARGS = {
'rows': sample_rows,
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type list, ndim 1, dtype family float — a list output has no array shape of its own; none is stated
- dtype family
- int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| cross_sections_from_panel |
Not yet run unverified (harvested, no recorded run) |
aslcai/OpenPM-Bench/agents/portfolio/backtester.py code served (permissive licence) · get_code("e5e4873ca3a5df53") How it ran |
| get_sp500_member_rows_on |
Not yet run unverified (harvested, no recorded run) |
aslcai/OpenPM-Bench/collectors/universe.py code served (permissive licence) · get_code("9444feff60cdff1c") How it ran |
| validate_file |
Not yet run unverified (harvested, no recorded run) |
aslcai/OpenPM-Bench/agents/feature_validation.py code served (permissive licence) · get_code("30f4a3867b83de47") How it ran |