langfun 0.1.2.dev202509280803__py3-none-any.whl → 0.1.2.dev202509300805__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.
Potentially problematic release.
This version of langfun might be problematic. Click here for more details.
- langfun/env/base_environment.py +19 -7
- langfun/env/base_sandbox.py +31 -8
- langfun/env/base_test.py +134 -102
- langfun/env/event_handlers/__init__.py +2 -0
- langfun/env/event_handlers/base.py +13 -0
- langfun/env/event_handlers/event_logger.py +45 -7
- langfun/env/event_handlers/event_logger_test.py +8 -0
- langfun/env/event_handlers/metric_writer.py +545 -0
- langfun/env/event_handlers/metric_writer_test.py +160 -0
- langfun/env/test_utils.py +6 -3
- {langfun-0.1.2.dev202509280803.dist-info → langfun-0.1.2.dev202509300805.dist-info}/METADATA +1 -1
- {langfun-0.1.2.dev202509280803.dist-info → langfun-0.1.2.dev202509300805.dist-info}/RECORD +15 -13
- {langfun-0.1.2.dev202509280803.dist-info → langfun-0.1.2.dev202509300805.dist-info}/WHEEL +0 -0
- {langfun-0.1.2.dev202509280803.dist-info → langfun-0.1.2.dev202509300805.dist-info}/licenses/LICENSE +0 -0
- {langfun-0.1.2.dev202509280803.dist-info → langfun-0.1.2.dev202509300805.dist-info}/top_level.txt +0 -0
langfun/env/test_utils.py
CHANGED
|
@@ -270,11 +270,12 @@ class TestingEventHandler(
|
|
|
270
270
|
def on_environment_shutdown(
|
|
271
271
|
self,
|
|
272
272
|
environment: interface.Environment,
|
|
273
|
+
duration: float,
|
|
273
274
|
lifetime: float,
|
|
274
275
|
error: BaseException | None
|
|
275
276
|
) -> None:
|
|
276
277
|
"""Called when the environment is shutdown."""
|
|
277
|
-
assert lifetime is not None
|
|
278
|
+
assert duration > 0 and lifetime is not None
|
|
278
279
|
self._add_message(f'[{environment.id}] environment shutdown', error)
|
|
279
280
|
|
|
280
281
|
def on_sandbox_start(
|
|
@@ -306,10 +307,11 @@ class TestingEventHandler(
|
|
|
306
307
|
self,
|
|
307
308
|
environment: interface.Environment,
|
|
308
309
|
sandbox: interface.Sandbox,
|
|
310
|
+
duration: float,
|
|
309
311
|
lifetime: float,
|
|
310
312
|
error: BaseException | None
|
|
311
313
|
) -> None:
|
|
312
|
-
assert lifetime is not None
|
|
314
|
+
assert duration > 0 and lifetime is not None
|
|
313
315
|
self._add_message(f'[{sandbox.id}] sandbox shutdown', error)
|
|
314
316
|
|
|
315
317
|
def on_sandbox_housekeep(
|
|
@@ -423,11 +425,12 @@ class TestingEventHandler(
|
|
|
423
425
|
environment: interface.Environment,
|
|
424
426
|
sandbox: interface.Sandbox,
|
|
425
427
|
session_id: str,
|
|
428
|
+
duration: float,
|
|
426
429
|
lifetime: float,
|
|
427
430
|
error: BaseException | None
|
|
428
431
|
) -> None:
|
|
429
432
|
"""Called when a sandbox session ends."""
|
|
430
|
-
assert lifetime > 0
|
|
433
|
+
assert duration > 0 and lifetime > 0
|
|
431
434
|
self._add_message(
|
|
432
435
|
f'[{sandbox.id}] session {session_id!r} ended', error
|
|
433
436
|
)
|
|
@@ -166,21 +166,23 @@ langfun/core/templates/demonstration_test.py,sha256=SafcDQ0WgI7pw05EmPI2S4v1t3AB
|
|
|
166
166
|
langfun/core/templates/selfplay.py,sha256=yhgrJbiYwq47TgzThmHrDQTF4nDrTI09CWGhuQPNv-s,2273
|
|
167
167
|
langfun/core/templates/selfplay_test.py,sha256=Ot__1P1M8oJfoTp-M9-PQ6HUXqZKyMwvZ5f7yQ3yfyM,2326
|
|
168
168
|
langfun/env/__init__.py,sha256=m6Y8y16ms9lytvO_r-Br8HmTp2rNDhb3R6JJaH5dEEk,1491
|
|
169
|
-
langfun/env/base_environment.py,sha256=
|
|
169
|
+
langfun/env/base_environment.py,sha256=auiPggdMI79aeEtNMaPEFi5Zy5IHZ_HG50dztCF7nDY,18564
|
|
170
170
|
langfun/env/base_feature.py,sha256=dztFq1lcdXgUh3m8pNRC3vruyIdHCob27reiXz_02q8,6436
|
|
171
|
-
langfun/env/base_sandbox.py,sha256=
|
|
172
|
-
langfun/env/base_test.py,sha256=
|
|
171
|
+
langfun/env/base_sandbox.py,sha256=jeMaf8Qtd0TPVAmtMWXKTC818_5Flpo_QKQf8_BJAGg,37238
|
|
172
|
+
langfun/env/base_test.py,sha256=AMfx56CoVqi_wn2ahC9h9ZIfExMdFqpk6DszXhGQZro,60918
|
|
173
173
|
langfun/env/interface.py,sha256=2Amf-_op7dGRF8c4-wYxcFxs1UCBYz1AB20Lk7__V4E,25724
|
|
174
174
|
langfun/env/interface_test.py,sha256=hfQn4RRTEo1YfVHXTPzH1puzD14BTo8R_5v1IpXVZ90,1398
|
|
175
175
|
langfun/env/load_balancers.py,sha256=qRhCthqzjZIQBwta8qC1C0s0J-VQAVomJQqI7Nqv-r4,1948
|
|
176
176
|
langfun/env/load_balancers_test.py,sha256=KIDIwZeQHcW0fCL5ScZD0lm0QV4_X2y-rMqdd6R1gLc,3737
|
|
177
|
-
langfun/env/test_utils.py,sha256=
|
|
178
|
-
langfun/env/event_handlers/__init__.py,sha256=
|
|
179
|
-
langfun/env/event_handlers/base.py,sha256=
|
|
180
|
-
langfun/env/event_handlers/event_logger.py,sha256=
|
|
181
|
-
langfun/env/event_handlers/event_logger_test.py,sha256=
|
|
182
|
-
langfun
|
|
183
|
-
langfun
|
|
184
|
-
langfun-0.1.2.
|
|
185
|
-
langfun-0.1.2.
|
|
186
|
-
langfun-0.1.2.
|
|
177
|
+
langfun/env/test_utils.py,sha256=WWhFMwKTOZv5a6gCGdEcVl8_lqHrVmypWaAIfWQG5Pk,13994
|
|
178
|
+
langfun/env/event_handlers/__init__.py,sha256=H34n-TbKSgtxqBhE-yAti8fY6weF2_v3yw59M9_zmGM,443
|
|
179
|
+
langfun/env/event_handlers/base.py,sha256=pzTq57udcRnl5Q-c8zGUoxpjRpZQ4JPP7Hutsy56EMc,7960
|
|
180
|
+
langfun/env/event_handlers/event_logger.py,sha256=fi4-aMYas0LQHbO-gF24Q7vnyWIT-fK7ktUfgH5WGFc,12082
|
|
181
|
+
langfun/env/event_handlers/event_logger_test.py,sha256=QRi1hE5z2mLwbWAS7tNOR5z--6zjPpdvmuCza2bjrw0,8824
|
|
182
|
+
langfun/env/event_handlers/metric_writer.py,sha256=UPNrG27nZCGO32smLpzVKdj_RzBxJqLsCi6A0XXOLy0,15645
|
|
183
|
+
langfun/env/event_handlers/metric_writer_test.py,sha256=yotlthtUf7GENHbd6UtUYE0GG2TcocCZ-8x-YTDAtPA,4453
|
|
184
|
+
langfun-0.1.2.dev202509300805.dist-info/licenses/LICENSE,sha256=WNHhf_5RCaeuKWyq_K39vmp9F28LxKsB4SpomwSZ2L0,11357
|
|
185
|
+
langfun-0.1.2.dev202509300805.dist-info/METADATA,sha256=9sPEJHJJcja_LeacAR4qVIG8c2HgFVktgDndNgkU_k0,7380
|
|
186
|
+
langfun-0.1.2.dev202509300805.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
187
|
+
langfun-0.1.2.dev202509300805.dist-info/top_level.txt,sha256=RhlEkHxs1qtzmmtWSwYoLVJAc1YrbPtxQ52uh8Z9VvY,8
|
|
188
|
+
langfun-0.1.2.dev202509300805.dist-info/RECORD,,
|
|
File without changes
|
{langfun-0.1.2.dev202509280803.dist-info → langfun-0.1.2.dev202509300805.dist-info}/licenses/LICENSE
RENAMED
|
File without changes
|
{langfun-0.1.2.dev202509280803.dist-info → langfun-0.1.2.dev202509300805.dist-info}/top_level.txt
RENAMED
|
File without changes
|