everestapi 0.2.4__tar.gz → 0.2.5__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.
- {everestapi-0.2.4/src/everestapi.egg-info → everestapi-0.2.5}/PKG-INFO +1 -1
- {everestapi-0.2.4 → everestapi-0.2.5}/src/everestapi/__init__.py +1 -1
- {everestapi-0.2.4 → everestapi-0.2.5}/src/everestapi/client.py +8 -0
- {everestapi-0.2.4 → everestapi-0.2.5/src/everestapi.egg-info}/PKG-INFO +1 -1
- {everestapi-0.2.4 → everestapi-0.2.5}/tests/test_client.py +17 -0
- {everestapi-0.2.4 → everestapi-0.2.5}/tests/test_mcp_and_models.py +8 -6
- {everestapi-0.2.4 → everestapi-0.2.5}/LICENSE +0 -0
- {everestapi-0.2.4 → everestapi-0.2.5}/README.md +0 -0
- {everestapi-0.2.4 → everestapi-0.2.5}/pyproject.toml +0 -0
- {everestapi-0.2.4 → everestapi-0.2.5}/setup.cfg +0 -0
- {everestapi-0.2.4 → everestapi-0.2.5}/src/everestapi/__main__.py +0 -0
- {everestapi-0.2.4 → everestapi-0.2.5}/src/everestapi/cli.py +0 -0
- {everestapi-0.2.4 → everestapi-0.2.5}/src/everestapi/mcp/__init__.py +0 -0
- {everestapi-0.2.4 → everestapi-0.2.5}/src/everestapi/mcp/__main__.py +0 -0
- {everestapi-0.2.4 → everestapi-0.2.5}/src/everestapi/mcp/server.py +0 -0
- {everestapi-0.2.4 → everestapi-0.2.5}/src/everestapi/plots.py +0 -0
- {everestapi-0.2.4 → everestapi-0.2.5}/src/everestapi/types.py +0 -0
- {everestapi-0.2.4 → everestapi-0.2.5}/src/everestapi.egg-info/SOURCES.txt +0 -0
- {everestapi-0.2.4 → everestapi-0.2.5}/src/everestapi.egg-info/dependency_links.txt +0 -0
- {everestapi-0.2.4 → everestapi-0.2.5}/src/everestapi.egg-info/entry_points.txt +0 -0
- {everestapi-0.2.4 → everestapi-0.2.5}/src/everestapi.egg-info/requires.txt +0 -0
- {everestapi-0.2.4 → everestapi-0.2.5}/src/everestapi.egg-info/top_level.txt +0 -0
- {everestapi-0.2.4 → everestapi-0.2.5}/tests/test_cli.py +0 -0
- {everestapi-0.2.4 → everestapi-0.2.5}/tests/test_diagnostics.py +0 -0
- {everestapi-0.2.4 → everestapi-0.2.5}/tests/test_json_or_raise.py +0 -0
- {everestapi-0.2.4 → everestapi-0.2.5}/tests/test_prediction_range.py +0 -0
|
@@ -561,9 +561,17 @@ class EverestAPI:
|
|
|
561
561
|
|
|
562
562
|
Splits: ``train`` / ``validation`` (features + targets), ``live``
|
|
563
563
|
(current round features only).
|
|
564
|
+
|
|
565
|
+
Futures is served by the futures endpoint (``version`` is a no-op):
|
|
566
|
+
it returns the real bregen tree to full-scope keys and the
|
|
567
|
+
target-stripped hackathon tree to hackathon-scoped keys (EVE-931).
|
|
564
568
|
"""
|
|
565
569
|
if output_path is None:
|
|
566
570
|
output_path = f"{universe}_{split}.parquet"
|
|
571
|
+
# Futures uses the futures endpoint (see docstring); the version route
|
|
572
|
+
# below is full-scope-only and 403s hackathon-scoped keys.
|
|
573
|
+
if universe == "futures":
|
|
574
|
+
return self.download_futures_data(split=split, output_path=output_path)
|
|
567
575
|
if version in (None, "latest", "current"):
|
|
568
576
|
version = self._current_dataset_version(universe) or "v0"
|
|
569
577
|
path = f"/api/v1/data/download/{version}/{universe}/{split}"
|
|
@@ -92,6 +92,23 @@ def test_safe_output_path_rejects_traversal(api, tmp_path):
|
|
|
92
92
|
assert _safe_output_path(str(tmp_path / "ok.bin")) == str(tmp_path / "ok.bin")
|
|
93
93
|
|
|
94
94
|
|
|
95
|
+
def test_download_dataset_futures_uses_futures_endpoint(httpx_mock, api, tmp_path):
|
|
96
|
+
# EVE-931: futures must route through the futures endpoint (which serves
|
|
97
|
+
# hackathon-scoped keys), NOT the full-scope-only version route that 403s
|
|
98
|
+
# them. version is a no-op for futures.
|
|
99
|
+
httpx_mock.add_response(
|
|
100
|
+
url="http://test/api/v1/futures/data/validation", content=b"PARQUET"
|
|
101
|
+
)
|
|
102
|
+
out = api.download_dataset(
|
|
103
|
+
universe="futures", split="validation",
|
|
104
|
+
output_path=str(tmp_path / "f.parquet"), version="bregen",
|
|
105
|
+
)
|
|
106
|
+
assert out == str(tmp_path / "f.parquet")
|
|
107
|
+
paths = [r.url.path for r in httpx_mock.get_requests()]
|
|
108
|
+
assert paths == ["/api/v1/futures/data/validation"]
|
|
109
|
+
assert not any("/data/download" in p or "/data/versions" in p for p in paths)
|
|
110
|
+
|
|
111
|
+
|
|
95
112
|
# --- Cloudflare Access service token ---------------------------------------
|
|
96
113
|
# Staging sits behind Cloudflare Access; a service token clears the gate
|
|
97
114
|
# programmatically. Headers ride alongside X-API-Key and stay absent by default.
|
|
@@ -75,18 +75,20 @@ def test_get_models(httpx_mock, api):
|
|
|
75
75
|
# -- client: versioned dataset download (the #558 fix) -------------------
|
|
76
76
|
|
|
77
77
|
|
|
78
|
+
# Non-futures universes still use the version-scoped route (futures bypasses it
|
|
79
|
+
# via the futures endpoint, EVE-931 — see test_client.py).
|
|
78
80
|
def test_download_dataset_uses_versioned_route(httpx_mock, api, tmp_path):
|
|
79
81
|
httpx_mock.add_response(
|
|
80
|
-
url="http://test/api/v1/data/download/bregen/
|
|
82
|
+
url="http://test/api/v1/data/download/bregen/equities/train",
|
|
81
83
|
content=b"PAR1data",
|
|
82
84
|
)
|
|
83
85
|
out = api.download_dataset(
|
|
84
|
-
universe="
|
|
86
|
+
universe="equities",
|
|
85
87
|
split="train",
|
|
86
88
|
version="bregen",
|
|
87
89
|
output_path=str(tmp_path / "t.parquet"),
|
|
88
90
|
)
|
|
89
|
-
assert httpx_mock.get_request().url.path == "/api/v1/data/download/bregen/
|
|
91
|
+
assert httpx_mock.get_request().url.path == "/api/v1/data/download/bregen/equities/train"
|
|
90
92
|
with open(out, "rb") as f:
|
|
91
93
|
assert f.read() == b"PAR1data"
|
|
92
94
|
|
|
@@ -94,14 +96,14 @@ def test_download_dataset_uses_versioned_route(httpx_mock, api, tmp_path):
|
|
|
94
96
|
def test_download_dataset_latest_resolves_version(httpx_mock, api, tmp_path):
|
|
95
97
|
httpx_mock.add_response(
|
|
96
98
|
url="http://test/api/v1/data/versions",
|
|
97
|
-
json={"versions": [{"version": "bregen", "universes": ["
|
|
99
|
+
json={"versions": [{"version": "bregen", "universes": ["equities"]}]},
|
|
98
100
|
)
|
|
99
101
|
httpx_mock.add_response(
|
|
100
|
-
url="http://test/api/v1/data/download/bregen/
|
|
102
|
+
url="http://test/api/v1/data/download/bregen/equities/live",
|
|
101
103
|
content=b"PAR1live",
|
|
102
104
|
)
|
|
103
105
|
out = api.download_dataset(
|
|
104
|
-
universe="
|
|
106
|
+
universe="equities",
|
|
105
107
|
split="live",
|
|
106
108
|
version="latest",
|
|
107
109
|
output_path=str(tmp_path / "l.parquet"),
|
|
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
|