code-loader 1.0.180.dev3__py3-none-any.whl → 1.0.180.dev4__py3-none-any.whl
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.
- code_loader/inner_leap_binder/leapbinder_decorators.py +60 -25
- {code_loader-1.0.180.dev3.dist-info → code_loader-1.0.180.dev4.dist-info}/METADATA +1 -1
- {code_loader-1.0.180.dev3.dist-info → code_loader-1.0.180.dev4.dist-info}/RECORD +5 -5
- {code_loader-1.0.180.dev3.dist-info → code_loader-1.0.180.dev4.dist-info}/LICENSE +0 -0
- {code_loader-1.0.180.dev3.dist-info → code_loader-1.0.180.dev4.dist-info}/WHEEL +0 -0
|
@@ -1424,7 +1424,7 @@ def tensorleap_simulation(name: str, sim_params: dict):
|
|
|
1424
1424
|
leap_binder.set_simulation(user_function, name, sim_params)
|
|
1425
1425
|
|
|
1426
1426
|
if not _call_from_tl_platform:
|
|
1427
|
-
|
|
1427
|
+
register_sim(name)
|
|
1428
1428
|
|
|
1429
1429
|
def _validate_input_args(*args, **kwargs):
|
|
1430
1430
|
assert len(args) == 0, (
|
|
@@ -1442,29 +1442,35 @@ def tensorleap_simulation(name: str, sim_params: dict):
|
|
|
1442
1442
|
f"{user_function.__name__}() validation failed: "
|
|
1443
1443
|
f"Expected return type PreprocessResponse. Got {type(result).__name__}."
|
|
1444
1444
|
)
|
|
1445
|
-
assert result.state == DataStateType.additional, (
|
|
1446
|
-
f"{user_function.__name__}() validation failed: "
|
|
1447
|
-
f"Simulation must return a PreprocessResponse with state=DataStateType.additional. "
|
|
1448
|
-
f"Got state={result.state!r}."
|
|
1449
|
-
)
|
|
1450
1445
|
|
|
1451
1446
|
def inner(*args, **kwargs):
|
|
1452
1447
|
if not _call_from_tl_platform:
|
|
1453
|
-
set_current('
|
|
1454
|
-
_validate_input_args(*args, **kwargs)
|
|
1455
|
-
result = user_function(*args, **kwargs)
|
|
1456
|
-
_validate_result(result)
|
|
1457
|
-
result.tl_generated = True
|
|
1458
|
-
if not _call_from_tl_platform:
|
|
1459
|
-
update_env_params_func(f"tensorleap_simulation:{name}", "v")
|
|
1448
|
+
set_current('tensorleap simulation')
|
|
1460
1449
|
try:
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1450
|
+
_validate_input_args(*args, **kwargs)
|
|
1451
|
+
result = user_function(*args, **kwargs)
|
|
1452
|
+
_validate_result(result)
|
|
1453
|
+
if result.state != DataStateType.additional:
|
|
1454
|
+
logger.warning(
|
|
1455
|
+
f"{user_function.__name__}() returned state={result.state!r}; "
|
|
1456
|
+
f"overriding to DataStateType.additional."
|
|
1457
|
+
)
|
|
1458
|
+
result.state = DataStateType.additional
|
|
1459
|
+
result.tl_generated = True
|
|
1460
|
+
try:
|
|
1461
|
+
emit_integration_event_once(AnalyticsEvent.SIMULATION_INTEGRATION_TEST, {
|
|
1462
|
+
'simulation_name': name,
|
|
1463
|
+
'sim_params_count': len(sim_params)
|
|
1464
|
+
})
|
|
1465
|
+
except Exception as e:
|
|
1466
|
+
logger.debug(f"Failed to emit simulation integration test event: {e}")
|
|
1467
|
+
if not _call_from_tl_platform:
|
|
1468
|
+
mark_sim_result(name, True)
|
|
1469
|
+
return result
|
|
1470
|
+
except Exception:
|
|
1471
|
+
if not _call_from_tl_platform:
|
|
1472
|
+
mark_sim_result(name, False)
|
|
1473
|
+
raise
|
|
1468
1474
|
|
|
1469
1475
|
return inner
|
|
1470
1476
|
|
|
@@ -2092,6 +2098,9 @@ def tensorleap_status_table():
|
|
|
2092
2098
|
def _print_table():
|
|
2093
2099
|
_print_param_default_warnings()
|
|
2094
2100
|
|
|
2101
|
+
for msg in _sim_messages:
|
|
2102
|
+
print(f"\n⚠️ {msg}")
|
|
2103
|
+
|
|
2095
2104
|
if not started_from("leap_integration.py"):
|
|
2096
2105
|
return
|
|
2097
2106
|
|
|
@@ -2144,12 +2153,41 @@ def tensorleap_status_table():
|
|
|
2144
2153
|
else:
|
|
2145
2154
|
_set_status(name, CROSS)
|
|
2146
2155
|
|
|
2156
|
+
_sim_tracking: dict = {}
|
|
2157
|
+
_sim_messages: list = []
|
|
2158
|
+
|
|
2159
|
+
def register_sim(sim_name: str):
|
|
2160
|
+
if not _sim_tracking:
|
|
2161
|
+
table.append({"name": "tensorleap simulation (optional)", "Added to integration": UNKNOWN})
|
|
2162
|
+
_sim_tracking[sim_name] = "registered"
|
|
2163
|
+
|
|
2164
|
+
def mark_sim_result(sim_name: str, passed: bool):
|
|
2165
|
+
_sim_tracking[sim_name] = "passed" if passed else "failed"
|
|
2166
|
+
|
|
2167
|
+
def _resolve_sim_row():
|
|
2168
|
+
if not _sim_tracking:
|
|
2169
|
+
return
|
|
2170
|
+
row = _find_row("tensorleap simulation")
|
|
2171
|
+
if not row:
|
|
2172
|
+
return
|
|
2173
|
+
failed = [n for n, s in _sim_tracking.items() if s == "failed"]
|
|
2174
|
+
not_called = [n for n, s in _sim_tracking.items() if s == "registered"]
|
|
2175
|
+
if failed:
|
|
2176
|
+
row["Added to integration"] = CROSS
|
|
2177
|
+
_sim_messages.append(f"Simulation(s) failed validation: {', '.join(sorted(failed))}")
|
|
2178
|
+
elif not_called:
|
|
2179
|
+
row["Added to integration"] = UNKNOWN
|
|
2180
|
+
_sim_messages.append(f"Simulation(s) not called in integration test: {', '.join(sorted(not_called))}")
|
|
2181
|
+
else:
|
|
2182
|
+
row["Added to integration"] = CHECK
|
|
2183
|
+
|
|
2147
2184
|
def run_on_exit():
|
|
2148
2185
|
if _finalizer_called["done"]:
|
|
2149
2186
|
return
|
|
2150
2187
|
_finalizer_called["done"] = True
|
|
2151
2188
|
if not _crashed["value"]:
|
|
2152
2189
|
_mark_unknowns_as_cross()
|
|
2190
|
+
_resolve_sim_row()
|
|
2153
2191
|
|
|
2154
2192
|
_print_table()
|
|
2155
2193
|
|
|
@@ -2164,17 +2202,14 @@ def tensorleap_status_table():
|
|
|
2164
2202
|
traceback.print_exception(exc_type, exc_value, exc_traceback)
|
|
2165
2203
|
run_on_exit()
|
|
2166
2204
|
|
|
2167
|
-
def add_table_row(name: str):
|
|
2168
|
-
table.append({"name": name, "Added to integration": UNKNOWN})
|
|
2169
|
-
|
|
2170
2205
|
atexit.register(run_on_exit)
|
|
2171
2206
|
sys.excepthook = handle_exception
|
|
2172
2207
|
|
|
2173
|
-
return set_current, update_env_params,
|
|
2208
|
+
return set_current, update_env_params, register_sim, mark_sim_result
|
|
2174
2209
|
|
|
2175
2210
|
|
|
2176
2211
|
if not _call_from_tl_platform:
|
|
2177
|
-
set_current, update_env_params_func,
|
|
2212
|
+
set_current, update_env_params_func, register_sim, mark_sim_result = tensorleap_status_table()
|
|
2178
2213
|
|
|
2179
2214
|
|
|
2180
2215
|
|
|
@@ -22,7 +22,7 @@ code_loader/experiment_api/utils.py,sha256=XZHtxge12TS4H4-8PjV3sKuhp8Ud6ojAiIzTZ
|
|
|
22
22
|
code_loader/experiment_api/workingspace_config_utils.py,sha256=DLzXQCg4dgTV_YgaSbeTVzq-2ja_SQw4zi7LXwKL9cY,990
|
|
23
23
|
code_loader/inner_leap_binder/__init__.py,sha256=koOlJyMNYzGbEsoIbXathSmQ-L38N_pEXH_HvL7beXU,99
|
|
24
24
|
code_loader/inner_leap_binder/leapbinder.py,sha256=Avt4lQv4mehoEOlH7UyF7Wna_GGJWSAF6r55qUk1MYE,38497
|
|
25
|
-
code_loader/inner_leap_binder/leapbinder_decorators.py,sha256=
|
|
25
|
+
code_loader/inner_leap_binder/leapbinder_decorators.py,sha256=iu5m72-ugEze3UBfNXL_QrL151FXI94JICykEyN3hTM,105461
|
|
26
26
|
code_loader/leaploader.py,sha256=vz812i2a0-9UTqsxNx9z0lqJlLt4BWGsPwl4E4lWjZ4,33022
|
|
27
27
|
code_loader/leaploaderbase.py,sha256=NJGaas8S6JeHYSsKkMSutyfcSKdK9jXTic7BcjC5uNc,6303
|
|
28
28
|
code_loader/mixpanel_tracker.py,sha256=rNwRmFifNbdUoqLQvvhhgpKczWpWiEmd8MfyJe27sxw,9131
|
|
@@ -32,7 +32,7 @@ code_loader/plot_functions/visualize.py,sha256=gsBAYYkwMh7jIpJeDMPS8G4CW-pxwx6Lz
|
|
|
32
32
|
code_loader/utils.py,sha256=YecipkdTA-VcE9F0RQcY9cFnY8P3AksPnHM2Db7xUSk,3972
|
|
33
33
|
code_loader/visualizers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
34
34
|
code_loader/visualizers/default_visualizers.py,sha256=onRnLE_TXfgLN4o52hQIOOhUcFexGlqJ3xSpQDVLuZM,2604
|
|
35
|
-
code_loader-1.0.180.
|
|
36
|
-
code_loader-1.0.180.
|
|
37
|
-
code_loader-1.0.180.
|
|
38
|
-
code_loader-1.0.180.
|
|
35
|
+
code_loader-1.0.180.dev4.dist-info/LICENSE,sha256=qIwWjdspQeSMTtnFZBC8MuT-95L02FPvzRUdWFxrwJY,1067
|
|
36
|
+
code_loader-1.0.180.dev4.dist-info/METADATA,sha256=rXrzhwdLrT5gn1PUab_L0ee4z1Wx-aH8TwWq54EG7Hw,1095
|
|
37
|
+
code_loader-1.0.180.dev4.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
|
38
|
+
code_loader-1.0.180.dev4.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|