Benign huggingface Download

kepton0117/sn-79topstrategy main

pytest test frameworkReferences multiple AI or ML asset extensions
SHA-256825f67173f3d343a77b3616302204b5357c06c0f5dcb4b572e09a699f238f046
MaleculeH(F)Md(Pa)

Evidence

Imports the pytest module lines 6–19
6:35… the default is preserve.
7
8Run: pytest GenTRX/tests/test_restart_resilience.py -v
9"""
10
11import pytest
12
13
14def _make_aggregator(tmp_path, validator_store=None):
15 from GenTRX.src.gradient_server import GradientAggregator
16
17 # `no_startup_cleanup=False` re-enables the wipe path — the whole
18 # point of this file is to exercise sim-id-mismatch wipe behaviour.
19 # The constructor default is True (op-s …
Checkpoint extension after model context lines 20–30
20:45… y code paths under test.
21 return GradientAggregator(
22 checkpoint_path=str(tmp_path / "ckpt.pt"),
23 val_data_path=str(tmp_path / "val"),
24 output_path=str(tmp_path / "out.pt"),
25 books_per_miner=1,
26 interval=60,
⋯4 lines
Python test source content lines 60–66
60:31… -----------------------------------------------
61
62
63def test_save_restore_preserves_agg_round_and_assignments(tmp_path):
64 src = _make_aggregator(tmp_path)
⋯2 lines
Record dataset extension lines 68–75
68:10… round": 7,
69 "books": ["0", "1"],
70 "data": ["data/0/x.parquet", "data/1/y.parquet"],
71 "ts_start": 100,
72 "ts_end": 200,
73 "model_version": 3,
74 "_state": "DELIVERED",
75 "_delivere …
Checks condition using Python assert lines 92–110
92:27… (tmp_path)
93 dst._restore_pending_rows()
94
95 assert dst._restored_sim_id == "SIM_A"
96 assert dst._agg_round == 7
97 assert 2 in dst._assignments
98 assert dst._assignments[2]["_state"] == "DELIVERED"
99 assert dst._assignments[2]["_gradient_data"] is None
100 assert 3 in dst._prev_round_assignments
101 assert 6 in dst._pending_aggregation_rounds
102
103
104def test_save_without_sim_id_is_skipped(tmp_path):
105 """Save is a no-op when _sim_id is None; staging files stay identity-paired."""
106 src = _make_aggregator(tmp_path)
107 assert src._sim_id is None
108 src._agg_round = 5
109 src._pending_rows[0] = [{"timestamp": 1000}]
110 src._max_timestamp_ …

Keyboard shortcuts on this page: j for the next sample, k for the previous one, x to go back to the feed, d to download the original bytes, r to re-queue the sample for analysis.