xrtm-data 0.3.1__tar.gz → 0.3.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {xrtm_data-0.3.1/src/xrtm_data.egg-info → xrtm_data-0.3.2}/PKG-INFO +1 -1
- {xrtm_data-0.3.1 → xrtm_data-0.3.2}/pyproject.toml +1 -1
- {xrtm_data-0.3.1 → xrtm_data-0.3.2}/src/xrtm/data/core/schemas/forecast.py +4 -0
- {xrtm_data-0.3.1 → xrtm_data-0.3.2}/src/xrtm/data/version.py +1 -1
- {xrtm_data-0.3.1 → xrtm_data-0.3.2/src/xrtm_data.egg-info}/PKG-INFO +1 -1
- {xrtm_data-0.3.1 → xrtm_data-0.3.2}/tests/test_schemas.py +31 -1
- {xrtm_data-0.3.1 → xrtm_data-0.3.2}/LICENSE +0 -0
- {xrtm_data-0.3.1 → xrtm_data-0.3.2}/README.md +0 -0
- {xrtm_data-0.3.1 → xrtm_data-0.3.2}/setup.cfg +0 -0
- {xrtm_data-0.3.1 → xrtm_data-0.3.2}/src/xrtm/data/__init__.py +0 -0
- {xrtm_data-0.3.1 → xrtm_data-0.3.2}/src/xrtm/data/core/__init__.py +0 -0
- {xrtm_data-0.3.1 → xrtm_data-0.3.2}/src/xrtm/data/core/interfaces.py +0 -0
- {xrtm_data-0.3.1 → xrtm_data-0.3.2}/src/xrtm/data/core/schemas/__init__.py +0 -0
- {xrtm_data-0.3.1 → xrtm_data-0.3.2}/src/xrtm/data/core/schemas/prior.py +0 -0
- {xrtm_data-0.3.1 → xrtm_data-0.3.2}/src/xrtm/data/core/schemas/trade.py +0 -0
- {xrtm_data-0.3.1 → xrtm_data-0.3.2}/src/xrtm/data/corpora/__init__.py +0 -0
- {xrtm_data-0.3.1 → xrtm_data-0.3.2}/src/xrtm/data/corpora/_builtin_corpora.py +0 -0
- {xrtm_data-0.3.1 → xrtm_data-0.3.2}/src/xrtm/data/corpora/real_binary.py +0 -0
- {xrtm_data-0.3.1 → xrtm_data-0.3.2}/src/xrtm/data/corpora/registry.py +0 -0
- {xrtm_data-0.3.1 → xrtm_data-0.3.2}/src/xrtm/data/providers/__init__.py +0 -0
- {xrtm_data-0.3.1 → xrtm_data-0.3.2}/src/xrtm/data/providers/online/__init__.py +0 -0
- {xrtm_data-0.3.1 → xrtm_data-0.3.2}/src/xrtm/data/providers/online/metaculus.py +0 -0
- {xrtm_data-0.3.1 → xrtm_data-0.3.2}/src/xrtm/data/providers/online/polymarket.py +0 -0
- {xrtm_data-0.3.1 → xrtm_data-0.3.2}/src/xrtm_data.egg-info/SOURCES.txt +0 -0
- {xrtm_data-0.3.1 → xrtm_data-0.3.2}/src/xrtm_data.egg-info/dependency_links.txt +0 -0
- {xrtm_data-0.3.1 → xrtm_data-0.3.2}/src/xrtm_data.egg-info/requires.txt +0 -0
- {xrtm_data-0.3.1 → xrtm_data-0.3.2}/src/xrtm_data.egg-info/top_level.txt +0 -0
- {xrtm_data-0.3.1 → xrtm_data-0.3.2}/tests/test_corpus_registry.py +0 -0
- {xrtm_data-0.3.1 → xrtm_data-0.3.2}/tests/test_prior_schemas.py +0 -0
- {xrtm_data-0.3.1 → xrtm_data-0.3.2}/tests/test_real_binary_corpus.py +0 -0
|
@@ -111,6 +111,10 @@ class ForecastQuestion(BaseModel):
|
|
|
111
111
|
description="Detailed context and background",
|
|
112
112
|
)
|
|
113
113
|
resolution_criteria: Optional[str] = Field(None, description="Explicit rules for ground truth determination")
|
|
114
|
+
context: Optional[Dict[str, Any]] = Field(
|
|
115
|
+
None,
|
|
116
|
+
description="Optional market context or metadata injected by downstream consumers (e.g., price, volume, spread)",
|
|
117
|
+
)
|
|
114
118
|
metadata: MetadataBase = Field(default_factory=MetadataBase) # type: ignore[arg-type]
|
|
115
119
|
|
|
116
120
|
@property
|
|
@@ -21,7 +21,7 @@ This module provides the single source of truth for the package version.
|
|
|
21
21
|
|
|
22
22
|
__all__ = ["__version__", "__author__", "__contact__", "__license__", "__copyright__"]
|
|
23
23
|
|
|
24
|
-
__version__ = "0.3.
|
|
24
|
+
__version__ = "0.3.2"
|
|
25
25
|
__author__ = "XRTM Team"
|
|
26
26
|
__contact__ = "moy@xrtm.org"
|
|
27
27
|
__license__ = "Apache-2.0"
|
|
@@ -16,7 +16,7 @@ from datetime import datetime, timedelta, timezone
|
|
|
16
16
|
|
|
17
17
|
import pytest
|
|
18
18
|
|
|
19
|
-
from xrtm.data import CausalEdge, CausalNode, ForecastOutput, ForecastResult, MetadataBase
|
|
19
|
+
from xrtm.data import CausalEdge, CausalNode, ForecastOutput, ForecastQuestion, ForecastResult, MetadataBase
|
|
20
20
|
from xrtm.data.core.schemas import TradeEvent, TradeWindow
|
|
21
21
|
|
|
22
22
|
|
|
@@ -172,3 +172,33 @@ def test_trade_window_normalizes_naive_boundaries_and_timestamps():
|
|
|
172
172
|
|
|
173
173
|
assert window.start_time.tzinfo == timezone.utc
|
|
174
174
|
assert window.trades[0].timestamp.tzinfo == timezone.utc
|
|
175
|
+
|
|
176
|
+
|
|
177
|
+
def test_forecast_question_context_field():
|
|
178
|
+
"""ForecastQuestion accepts an optional context dict for market metadata."""
|
|
179
|
+
q = ForecastQuestion(
|
|
180
|
+
id="q1",
|
|
181
|
+
title="Will market X exceed $100?",
|
|
182
|
+
context={"market_price": 0.55, "volume_24h": 150000, "spread": 0.02},
|
|
183
|
+
)
|
|
184
|
+
assert q.context == {"market_price": 0.55, "volume_24h": 150000, "spread": 0.02}
|
|
185
|
+
|
|
186
|
+
|
|
187
|
+
def test_forecast_question_context_defaults_to_none():
|
|
188
|
+
"""ForecastQuestion context is None by default for backward compatibility."""
|
|
189
|
+
q = ForecastQuestion(id="q2", title="Simple question")
|
|
190
|
+
assert q.context is None
|
|
191
|
+
|
|
192
|
+
|
|
193
|
+
def test_forecast_question_context_serializes():
|
|
194
|
+
"""Context field serializes to JSON and round-trips correctly."""
|
|
195
|
+
q = ForecastQuestion(
|
|
196
|
+
id="q3",
|
|
197
|
+
title="Serialization test",
|
|
198
|
+
context={"key": "value", "nested": {"a": 1}},
|
|
199
|
+
)
|
|
200
|
+
payload = q.model_dump(mode="json")
|
|
201
|
+
assert payload["context"] == {"key": "value", "nested": {"a": 1}}
|
|
202
|
+
|
|
203
|
+
reloaded = ForecastQuestion.model_validate(payload)
|
|
204
|
+
assert reloaded.context == {"key": "value", "nested": {"a": 1}}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|