code-loader 1.0.186.dev2__py3-none-any.whl → 1.0.186.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/leaploader.py CHANGED
@@ -503,6 +503,19 @@ class LeapLoader(LeapLoaderBase):
503
503
  returned_sample_ids = original_sample_ids
504
504
  return {"encoded": encoded, "sample_ids": returned_sample_ids}
505
505
 
506
+ def prune_synthetic_lookup(self, keep_ids):
507
+ # type: (List[str]) -> None
508
+ # Keep only the given synthetic sample_ids in the in-memory lookup and
509
+ # drop the rest, so preprocess responses don't accumulate across many
510
+ # run_simulation calls (e.g. a synthetic calibration loop keeps only its
511
+ # running top-K trials). Keep-set semantics (rather than evict-list) so
512
+ # the caller can bound the lookup to a known-good set each iteration
513
+ # without tracking everything it ever generated.
514
+ keep = set(keep_ids)
515
+ self._synthetic_lookup = {
516
+ sid: entry for sid, entry in self._synthetic_lookup.items() if sid in keep
517
+ }
518
+
506
519
  def _extend_additional_preprocess(self, new_sample_ids: List[str]) -> None:
507
520
  if self._preprocess_result_cached is None:
508
521
  self._preprocess_result()
@@ -159,6 +159,10 @@ class LeapLoaderBase:
159
159
  # type: (str, Optional[Dict[str, Any]], int, int, Optional[List[str]], bool, bool) -> Dict[str, Any]
160
160
  pass
161
161
 
162
+ def prune_synthetic_lookup(self, keep_ids):
163
+ # type: (List[str]) -> None
164
+ pass
165
+
162
166
  def is_custom_latent_space(self) -> bool:
163
167
  if not self.code_entry_name or not self.code_path:
164
168
  return False
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: code-loader
3
- Version: 1.0.186.dev2
3
+ Version: 1.0.186.dev4
4
4
  Summary:
5
5
  Home-page: https://github.com/tensorleap/code-loader
6
6
  License: MIT
@@ -23,8 +23,8 @@ code_loader/experiment_api/workingspace_config_utils.py,sha256=DLzXQCg4dgTV_YgaS
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=XLYYcV50qjMvoC1S6WW0tLBch_0g5gl1UyHiVSWYbvg,40491
25
25
  code_loader/inner_leap_binder/leapbinder_decorators.py,sha256=8a7aJ1o4f60VnlErNjX_4RbUXpLWt91pgGcIDLBvOWc,115314
26
- code_loader/leaploader.py,sha256=kbzsJapHrQE8JEnNUvH_OAybX0RdMc8WjJuA9aIoVVM,45046
27
- code_loader/leaploaderbase.py,sha256=rXLdPKPUl-2qYKCoLuT-Tv9MUJl1PNh5vYRuLXHz99Y,6610
26
+ code_loader/leaploader.py,sha256=8Jkmn2k2vyUdRbKM5bTxFFUrUBYZdkHp54kQa5LCdWM,45744
27
+ code_loader/leaploaderbase.py,sha256=QynV_LE0l4HnsXLZKjM8p4w2VQL4Fo8dnjQ618OgGjs,6708
28
28
  code_loader/mixpanel_tracker.py,sha256=rNwRmFifNbdUoqLQvvhhgpKczWpWiEmd8MfyJe27sxw,9131
29
29
  code_loader/plot_functions/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
30
30
  code_loader/plot_functions/plot_functions.py,sha256=6Q7VWGxetL2W0EK2QeCdObVATvBuHs3YBA09H4uoIk0,14996
@@ -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.186.dev2.dist-info/LICENSE,sha256=qIwWjdspQeSMTtnFZBC8MuT-95L02FPvzRUdWFxrwJY,1067
36
- code_loader-1.0.186.dev2.dist-info/METADATA,sha256=eKHDUl5VyL5X2L9f_Zdg6krcfqc8TP-MTLEbNif_f6w,1095
37
- code_loader-1.0.186.dev2.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
38
- code_loader-1.0.186.dev2.dist-info/RECORD,,
35
+ code_loader-1.0.186.dev4.dist-info/LICENSE,sha256=qIwWjdspQeSMTtnFZBC8MuT-95L02FPvzRUdWFxrwJY,1067
36
+ code_loader-1.0.186.dev4.dist-info/METADATA,sha256=qsP-4jYZ3tDf_6C8Z36Zh7fZU7qIplT0wCtSw-RR5kc,1095
37
+ code_loader-1.0.186.dev4.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
38
+ code_loader-1.0.186.dev4.dist-info/RECORD,,