2525from openapi_lavender_data_rest .api .iterations import (
2626 create_iteration_iterations_post ,
2727 get_next_iterations_iteration_id_next_get ,
28- submit_next_iterations_iteration_id_next_post ,
29- get_submitted_result_iterations_iteration_id_next_cache_key_get ,
3028 get_iteration_iterations_iteration_id_get ,
3129 get_iterations_iterations_get ,
3230 complete_index_iterations_iteration_id_complete_index_post ,
@@ -304,10 +302,15 @@ def create_iteration(
304302 categorizer : Optional [IterationCategorizer ] = None ,
305303 collater : Optional [IterationCollater ] = None ,
306304 preprocessors : Optional [list [IterationPreprocessor ]] = None ,
305+ max_retry_count : int = 0 ,
307306 rank : int = 0 ,
308307 world_size : Optional [int ] = None ,
309308 wait_participant_threshold : Optional [float ] = None ,
310- cluster_sync : bool = False ,
309+ no_cache : Optional [bool ] = None ,
310+ num_workers : Optional [int ] = None ,
311+ prefetch_factor : Optional [int ] = None ,
312+ in_order : Optional [bool ] = None ,
313+ cluster_sync : Optional [bool ] = None ,
311314 ):
312315 with self ._get_client () as client :
313316 response = create_iteration_iterations_post .sync_detailed (
@@ -324,9 +327,14 @@ def create_iteration(
324327 collater = collater ,
325328 preprocessors = preprocessors ,
326329 replication_pg = replication_pg ,
330+ max_retry_count = max_retry_count ,
327331 rank = rank ,
328332 world_size = world_size ,
329333 wait_participant_threshold = wait_participant_threshold ,
334+ no_cache = no_cache ,
335+ num_workers = num_workers ,
336+ prefetch_factor = prefetch_factor ,
337+ in_order = in_order ,
330338 cluster_sync = cluster_sync ,
331339 ),
332340 )
@@ -366,61 +374,22 @@ def get_next_item(
366374 self ,
367375 iteration_id : str ,
368376 rank : int = 0 ,
369- no_cache : bool = False ,
370- max_retry_count : int = 0 ,
371377 client : Optional [Client ] = None ,
372378 ):
373379 with self ._get_client () if client is None else nullcontext () as _client :
374380 response = get_next_iterations_iteration_id_next_get .sync_detailed (
375381 client = client or _client ,
376382 iteration_id = iteration_id ,
377383 rank = rank ,
378- no_cache = no_cache ,
379- max_retry_count = max_retry_count ,
380384 )
381-
382385 try :
383386 current = int (response .headers .get ("X-Lavender-Data-Sample-Current" ))
384387 except TypeError :
385388 current = None
386- return self ._check_response (response ).payload .read (), current
387-
388- def submit_next_item (
389- self ,
390- iteration_id : str ,
391- rank : int = 0 ,
392- no_cache : bool = False ,
393- max_retry_count : int = 0 ,
394- client : Optional [Client ] = None ,
395- ):
396- with self ._get_client () if client is None else nullcontext () as _client :
397- response = submit_next_iterations_iteration_id_next_post .sync_detailed (
398- client = client or _client ,
399- iteration_id = iteration_id ,
400- rank = rank ,
401- no_cache = no_cache ,
402- max_retry_count = max_retry_count ,
403- )
404- return self ._check_response (response )
405389
406- def get_submitted_result (
407- self ,
408- iteration_id : str ,
409- cache_key : str ,
410- client : Optional [Client ] = None ,
411- ):
412- with self ._get_client () if client is None else nullcontext () as _client :
413- response = get_submitted_result_iterations_iteration_id_next_cache_key_get .sync_detailed (
414- client = client or _client ,
415- iteration_id = iteration_id ,
416- cache_key = cache_key ,
417- )
418390 if response .status_code == 202 :
419391 raise LavenderDataApiError (response .content .decode ("utf-8" ))
420- try :
421- current = int (response .headers .get ("X-Lavender-Data-Sample-Current" ))
422- except TypeError :
423- current = None
392+
424393 return self ._check_response (response ).payload .read (), current
425394
426395 def complete_index (self , iteration_id : str , index : int ):
@@ -602,10 +571,15 @@ def create_iteration(
602571 categorizer : Optional [IterationCategorizer ] = None ,
603572 collater : Optional [IterationCollater ] = None ,
604573 preprocessors : Optional [list [IterationPreprocessor ]] = None ,
574+ max_retry_count : int = 0 ,
605575 rank : int = 0 ,
606576 world_size : Optional [int ] = None ,
607577 wait_participant_threshold : Optional [float ] = None ,
608- cluster_sync : bool = False ,
578+ no_cache : Optional [bool ] = None ,
579+ num_workers : Optional [int ] = None ,
580+ prefetch_factor : Optional [int ] = None ,
581+ in_order : Optional [bool ] = None ,
582+ cluster_sync : Optional [bool ] = None ,
609583):
610584 return _client_instance .create_iteration (
611585 dataset_id = dataset_id ,
@@ -619,9 +593,14 @@ def create_iteration(
619593 categorizer = categorizer ,
620594 collater = collater ,
621595 preprocessors = preprocessors ,
596+ max_retry_count = max_retry_count ,
622597 rank = rank ,
623598 world_size = world_size ,
624599 wait_participant_threshold = wait_participant_threshold ,
600+ no_cache = no_cache ,
601+ num_workers = num_workers ,
602+ prefetch_factor = prefetch_factor ,
603+ in_order = in_order ,
625604 cluster_sync = cluster_sync ,
626605 )
627606
@@ -644,36 +623,10 @@ def get_iteration(iteration_id: str):
644623def get_next_item (
645624 iteration_id : str ,
646625 rank : int = 0 ,
647- no_cache : bool = False ,
648- max_retry_count : int = 0 ,
649626):
650627 return _client_instance .get_next_item (
651628 iteration_id = iteration_id ,
652629 rank = rank ,
653- no_cache = no_cache ,
654- max_retry_count = max_retry_count ,
655- )
656-
657-
658- @ensure_client ()
659- def submit_next_item (
660- iteration_id : str ,
661- rank : int = 0 ,
662- no_cache : bool = False ,
663- max_retry_count : int = 0 ,
664- ):
665- return _client_instance .submit_next_item (
666- iteration_id = iteration_id ,
667- rank = rank ,
668- no_cache = no_cache ,
669- max_retry_count = max_retry_count ,
670- )
671-
672-
673- @ensure_client ()
674- def get_submitted_result (iteration_id : str , cache_key : str ):
675- return _client_instance .get_submitted_result (
676- iteration_id = iteration_id , cache_key = cache_key
677630 )
678631
679632
0 commit comments